static void gdaex_query_editor_on_sel_order_changed (GtkTreeSelection *treeselection,
gpointer user_data);
+ static void gdaex_query_editor_on_txt1_btn_browse_clicked (gpointer instance, gpointer user_data);
+ static void gdaex_query_editor_on_txt2_btn_browse_clicked (gpointer instance, gpointer user_data);
+
+
#define GDAEX_QUERY_EDITOR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_GDAEX_QUERY_EDITOR, GdaExQueryEditorPrivate))
+typedef GtkWidget *(* GtkDateEntryNew) (const gchar *format,
+ const gchar *separator,
+ gboolean calendar_button_is_visible);
+typedef void (* GtkDateEntrySetDateVisible) (gpointer gtkdateentry, gboolean visible);
+typedef void (* GtkDateEntrySetTimeVisible) (gpointer gtkdateentry, gboolean visible);
+
typedef struct _GdaExQueryEditorPrivate GdaExQueryEditorPrivate;
struct _GdaExQueryEditorPrivate
{
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
- "You must select a condition's type before.");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- return;
- }
+ _("You must select a condition's type before."));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ return;
+ }
- gtk_tree_model_get (model, &iter_val,
- 0, &where_type,
- -1);
+ gtk_tree_model_get (model, &iter_val,
+ 0, &where_type,
+ -1);
- if (GTK_IS_DATE_ENTRY (priv->txt1))
- {
- val1 = (gchar *)gtk_date_entry_get_strf (GTK_DATE_ENTRY (priv->txt1), gtk_date_entry_is_time_visible (GTK_DATE_ENTRY (priv->txt1)) ? "dmYHMS" : "dmY", NULL, NULL);
- val1_sql = (gchar *)gtk_date_entry_get_sql (GTK_DATE_ENTRY (priv->txt1));
+ val1 = (gchar *)gdaex_query_editor_iwidget_get_value (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_from));
+ val1_sql = (gchar *)gdaex_query_editor_iwidget_get_value_sql (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_from));
+ if (val1 == NULL)
+ {
+ val1 = g_strdup ("");
+ }
+ else
+ {
+ val1 = g_strdup (val1);
+ }
+ if (val1_sql == NULL)
+ {
+ val1_sql = g_strdup ("");
+ }
+ else
+ {
+ val1_sql = g_strdup (val1_sql);
+ }
+
+ val2 = (gchar *)gdaex_query_editor_iwidget_get_value (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_to));
+ val2_sql = (gchar *)gdaex_query_editor_iwidget_get_value_sql (GDAEX_QUERY_EDITOR_IWIDGET (priv->txt_to));
+ if (val2 == NULL)
+ {
+ val2 = g_strdup ("");
+ }
+ else
+ {
+ val2 = g_strdup (val2);
+ }
+ if (val2_sql == NULL)
+ {
+ val2_sql = g_strdup ("");
+ }
+ else
+ {
+ val2_sql = g_strdup (val2_sql);
+ }
}
+ else if (GTK_IS_FORM_DECODER (priv->txt1))
+ {
+ val1 = (gchar *)gtk_form_decoder_get_decoded (GTK_FORM_DECODER (priv->txt1));
+ val1_sql = (gchar *)gtk_form_decoder_get_key (GTK_FORM_DECODER (priv->txt1));
+ }
else
{
- val1 = (gchar *)gtk_entry_get_text (GTK_ENTRY (priv->txt1));
- val1_sql = (gchar *)gtk_entry_get_text (GTK_ENTRY (priv->txt1));
- }
- if (val1 == NULL)
- {
+ where_type = 0;
val1 = g_strdup ("");
- }
- else
- {
- val1 = g_strdup (val1);
- }
- if (val1_sql == NULL)
- {
val1_sql = g_strdup ("");
- }
- else
- {
- val1_sql = g_strdup (val1_sql);
- }
-
- if (GTK_IS_DATE_ENTRY (priv->txt2))
- {
- val2 = (gchar *)gtk_date_entry_get_strf (GTK_DATE_ENTRY (priv->txt2), gtk_date_entry_is_time_visible (GTK_DATE_ENTRY (priv->txt2)) ? "dmYHMS" : "dmY", NULL, NULL);
- val2_sql = (gchar *)gtk_date_entry_get_sql (GTK_DATE_ENTRY (priv->txt2));
- }
- else if (GTK_IS_FORM_DECODER (priv->txt2))
- {
- val2 = (gchar *)gtk_form_decoder_get_decoded (GTK_FORM_DECODER (priv->txt2));
- val2_sql = (gchar *)gtk_form_decoder_get_key (GTK_FORM_DECODER (priv->txt2));
- }
- else
- {
- val2 = (gchar *)gtk_entry_get_text (GTK_ENTRY (priv->txt2));
- val2_sql = (gchar *)gtk_entry_get_text (GTK_ENTRY (priv->txt2));
- }
- if (val2 == NULL)
- {
val2 = g_strdup ("");
- }
- else
- {
- val2 = g_strdup (val2);
- }
- if (val2_sql == NULL)
- {
val2_sql = g_strdup ("");
}
- else
- {
- val2_sql = g_strdup (val2_sql);
- }
gtk_tree_store_set (priv->tstore_where, &iter,
COL_WHERE_LINK_TYPE, link_type,