-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<column type="gchararray"/>
</columns>
</object>
- <object class="GtkTreeStore" id="tstore_fields">
+ <object class="GtkListStore" id="lstore_show">
<columns>
<!-- column-name table_name -->
<column type="gchararray"/>
<column type="gchararray"/>
<!-- column-name name_visible -->
<column type="gchararray"/>
- <!-- column-name description -->
+ <!-- column-name alias -->
<column type="gchararray"/>
</columns>
</object>
- <object class="GtkListStore" id="lstore_show">
+ <object class="GtkTreeStore" id="tstore_fields">
<columns>
<!-- column-name table_name -->
<column type="gchararray"/>
<column type="gchararray"/>
<!-- column-name name_visible -->
<column type="gchararray"/>
- <!-- column-name alias -->
+ <!-- column-name description -->
<column type="gchararray"/>
</columns>
</object>
</columns>
</object>
<object class="GtkWindow" id="w_query_editor">
+ <property name="can_focus">False</property>
<child>
<object class="GtkHPaned" id="hpaned_query_editor">
<property name="visible">True</property>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkNotebook" id="notebook1">
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVButtonBox" id="vbuttonbox1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="button3">
<property name="label">gtk-add</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button4">
<property name="label">gtk-remove</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button5">
<property name="label">gtk-go-up</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button6">
<property name="label">gtk-go-down</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-clear</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Show</property>
</object>
<packing>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVButtonBox" id="vbuttonbox2">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="button7">
<property name="label">gtk-add</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button8">
<property name="label">gtk-remove</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button9">
<property name="label">gtk-go-up</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button10">
<property name="label">gtk-go-down</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button2">
<property name="label">gtk-clear</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Where</property>
</object>
<packing>
<child>
<object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVButtonBox" id="vbuttonbox3">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="button11">
<property name="label">gtk-add</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button12">
<property name="label">gtk-remove</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button13">
<property name="label">gtk-go-up</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button14">
<property name="label">gtk-go-down</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button17">
<property name="label">gtk-clear</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Order</property>
</object>
<packing>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox3">
+ <property name="can_focus">False</property>
<property name="no_show_all">True</property>
- <property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkVBox" id="vbox4">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="spacing">5</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="button16">
<property name="label">gtk-cancel</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child>
<object class="GtkButton" id="button15">
<property name="label">gtk-save</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
GDAEX_QE_LINK_TYPE_OR
} GdaExQueryEditorLinkType;
+enum
+ {
+ GDAEX_QE_PAGE_SHOW,
+ GDAEX_QE_PAGE_WHERE,
+ GDAEX_QE_PAGE_ORDER
+ };
+
static void gdaex_query_editor_class_init (GdaExQueryEditorClass *class);
static void gdaex_query_editor_init (GdaExQueryEditor *gdaex_query_editor);
GtkBuilder *gtkbuilder;
+ GtkWidget *notebook;
+
GtkWidget *hpaned_main;
GtkWidget *vbx_values_container;
return NULL;
}
+ priv->notebook = GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "notebook1"));
+
priv->tstore_fields = GTK_TREE_STORE (gtk_builder_get_object (priv->gtkbuilder, "tstore_fields"));
priv->lstore_show = GTK_LIST_STORE (gtk_builder_get_object (priv->gtkbuilder, "lstore_show"));
priv->tstore_where = GTK_TREE_STORE (gtk_builder_get_object (priv->gtkbuilder, "tstore_where"));
return priv->hpaned_main;
}
+void
+gdaex_query_editor_set_show_visibile (GdaExQueryEditor *qe, gboolean visibile)
+{
+ GdaExQueryEditorPrivate *priv;
+
+ GtkWidget *wpage;
+
+ g_return_if_fail (GDAEX_IS_QUERY_EDITOR (qe));
+
+ priv = GDAEX_QUERY_EDITOR_GET_PRIVATE (qe);
+
+ wpage = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), GDAEX_QE_PAGE_SHOW);
+ if (visibile)
+ {
+ gtk_widget_show_all (wpage);
+ }
+ else
+ {
+ gtk_widget_hide (wpage);
+ }
+}
+
+void
+gdaex_query_editor_set_where_visibile (GdaExQueryEditor *qe, gboolean visibile)
+{
+ GdaExQueryEditorPrivate *priv;
+
+ GtkWidget *wpage;
+
+ g_return_if_fail (GDAEX_IS_QUERY_EDITOR (qe));
+
+ priv = GDAEX_QUERY_EDITOR_GET_PRIVATE (qe);
+
+ wpage = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), GDAEX_QE_PAGE_WHERE);
+ if (visibile)
+ {
+ gtk_widget_show_all (wpage);
+ }
+ else
+ {
+ gtk_widget_hide (wpage);
+ }
+}
+
+void
+gdaex_query_editor_set_order_visibile (GdaExQueryEditor *qe, gboolean visibile)
+{
+ GdaExQueryEditorPrivate *priv;
+
+ GtkWidget *wpage;
+
+ g_return_if_fail (GDAEX_IS_QUERY_EDITOR (qe));
+
+ priv = GDAEX_QUERY_EDITOR_GET_PRIVATE (qe);
+
+ wpage = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), GDAEX_QE_PAGE_ORDER);
+ if (visibile)
+ {
+ gtk_widget_show_all (wpage);
+ }
+ else
+ {
+ gtk_widget_hide (wpage);
+ }
+}
+
+gboolean
+gdaex_query_editor_get_show_visible (GdaExQueryEditor *qe)
+{
+ GdaExQueryEditorPrivate *priv;
+
+ GtkWidget *wpage;
+
+ g_return_val_if_fail (GDAEX_IS_QUERY_EDITOR (qe), FALSE);
+
+ priv = GDAEX_QUERY_EDITOR_GET_PRIVATE (qe);
+
+ wpage = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), GDAEX_QE_PAGE_SHOW);
+ return gtk_widget_get_visible (wpage);
+}
+
+gboolean
+gdaex_query_editor_get_where_visible (GdaExQueryEditor *qe)
+{
+ GdaExQueryEditorPrivate *priv;
+
+ GtkWidget *wpage;
+
+ g_return_val_if_fail (GDAEX_IS_QUERY_EDITOR (qe), FALSE);
+
+ priv = GDAEX_QUERY_EDITOR_GET_PRIVATE (qe);
+
+ wpage = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), GDAEX_QE_PAGE_WHERE);
+ return gtk_widget_get_visible (wpage);
+}
+
+gboolean
+gdaex_query_editor_get_order_visible (GdaExQueryEditor *qe)
+{
+ GdaExQueryEditorPrivate *priv;
+
+ GtkWidget *wpage;
+
+ g_return_val_if_fail (GDAEX_IS_QUERY_EDITOR (qe), FALSE);
+
+ priv = GDAEX_QUERY_EDITOR_GET_PRIVATE (qe);
+
+ wpage = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), GDAEX_QE_PAGE_ORDER);
+ return gtk_widget_get_visible (wpage);
+}
+
gboolean
gdaex_query_editor_add_table (GdaExQueryEditor *qe,
const gchar *table_name,
GParamSpec *pspec)
{
GdaExQueryEditor *gdaex_query_editor = (GdaExQueryEditor *)object;
-
GdaExQueryEditorPrivate *priv = GDAEX_QUERY_EDITOR_GET_PRIVATE (gdaex_query_editor);
switch (property_id)
GParamSpec *pspec)
{
GdaExQueryEditor *gdaex_query_editor = (GdaExQueryEditor *)object;
-
GdaExQueryEditorPrivate *priv = GDAEX_QUERY_EDITOR_GET_PRIVATE (gdaex_query_editor);
switch (property_id)
return;
}
- page = gtk_notebook_get_current_page (GTK_NOTEBOOK (gtk_builder_get_object (priv->gtkbuilder, "notebook1")));
+ page = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
switch (page)
{
- case 0: /* show */
+ case GDAEX_QE_PAGE_SHOW:
if (gtk_widget_is_sensitive (GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "button3"))))
{
gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->gtkbuilder, "button3")));
}
break;
- case 1: /* where */
+ case GDAEX_QE_PAGE_WHERE:
if (gtk_widget_is_sensitive (GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "button7"))))
{
gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->gtkbuilder, "button7")));
}
break;
- case 2: /* order */
+ case GDAEX_QE_PAGE_ORDER:
if (gtk_widget_is_sensitive (GTK_WIDGET (gtk_builder_get_object (priv->gtkbuilder, "button11"))))
{
gtk_button_clicked (GTK_BUTTON (gtk_builder_get_object (priv->gtkbuilder, "button11")));