table_name CDATA #REQUIRED
>
-<!ELEMENT field (name, name_visible?, description?, alias?, type, for_show, always_showed, for_where, available_where_type, for_order, always_ordered, order_default, decode)>
+<!ELEMENT field (name, name_visible?, description?, alias?, type, for_show, always_showed, for_where, available_where_type, where_default_not, where_default_type, for_order, always_ordered, order_default, decode)>
<!ELEMENT table_name (#PCDATA)>
<!ELEMENT name_visible (#PCDATA)>
<!ELEMENT always_showed (#PCDATA)>
<!ELEMENT for_where (#PCDATA)>
<!ELEMENT available_where_type (#PCDATA)>
+<!ELEMENT where_default_not (#PCDATA)>
+<!ELEMENT where_default_type (#PCDATA)>
<!ELEMENT for_order (#PCDATA)>
<!ELEMENT always_ordered (#PCDATA)>
<!ELEMENT order_default (#PCDATA)>
{
field->available_where_type = gdaex_query_editor_str_to_where_type (xmlNodeGetContent (cur));
}
+ else if (xmlStrcmp (cur->name, "where_default_not") == 0)
+ {
+ field->where_default_not = zak_utils_string_to_boolean (xmlNodeGetContent (cur));
+ }
+ else if (xmlStrcmp (cur->name, "where_default_type") == 0)
+ {
+ field->where_default_type = gdaex_query_editor_str_to_where_type (xmlNodeGetContent (cur));
+ }
else if (xmlStrcmp (cur->name, "for_order") == 0)
{
field->for_order = zak_utils_string_to_boolean (xmlNodeGetContent (cur));
val1 = NULL;
val2 = NULL;
asc_desc = NULL;
+ asc_desc_visible = NULL;
switch (priv->editor_type)
{
else
{
where_type = 0;
+ val1_visible = g_strdup ("");
val1 = g_strdup ("");
val1_sql = g_strdup ("");
+ val2_visible = g_strdup ("");
val2 = g_strdup ("");
val2_sql = g_strdup ("");
}
gtk_tree_selection_unselect_all (priv->sel_where);
+ g_free (val1_visible);
g_free (val1_sql);
+ g_free (val2_visible);
g_free (val2_sql);
}
break;
static void
gdaex_query_editor_on_btn_where_add_clicked (GtkButton *button,
- gpointer user_data)
+ gpointer user_data)
{
GdaExQueryEditor *qe;
GdaExQueryEditorPrivate *priv;
COL_WHERE_TABLE_NAME, field->table_name,
COL_WHERE_NAME, field_name,
COL_WHERE_VISIBLE_NAME, g_strconcat (table->name_visible, " - ", field->name_visible, NULL),
+ COL_WHERE_CONDITION_NOT, field->where_default_not,
+ COL_WHERE_CONDITION_TYPE, field->where_default_type,
+ COL_WHERE_CONDITION_TYPE_VISIBLE, gdaex_query_editor_get_where_type_str_from_type (field->where_default_type),
-1);
if (with_parent)
if (GTK_IS_BOX (priv->hbox_where))
{
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->cb_link_type), NULL);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->chk_not), not);
gtk_container_remove (GTK_CONTAINER (priv->tbl), GTK_WIDGET (priv->txt_from));
gtk_container_remove (GTK_CONTAINER (priv->tbl), GTK_WIDGET (priv->txt_to));
}
gtk_grid_attach (GTK_GRID (priv->tbl), priv->lbl_to, 5, 1, 1, 1);
}
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->chk_not), not);
+
if (is_group)
{
gtk_label_set_label (GTK_LABEL (gtk_frame_get_label_widget (GTK_FRAME (priv->frame_where))), "");
{
gtk_list_store_append (priv->lstore_where_type, &iter_cb);
gtk_list_store_set (priv->lstore_where_type, &iter_cb,
- 0, GDAEX_QE_WHERE_TYPE_ICONTAINS,
- 1, gdaex_query_editor_get_where_type_str_from_type (GDAEX_QE_WHERE_TYPE_ICONTAINS),
- -1);
+ 0, GDAEX_QE_WHERE_TYPE_ICONTAINS,
+ 1, gdaex_query_editor_get_where_type_str_from_type (GDAEX_QE_WHERE_TYPE_ICONTAINS),
+ -1);
}
if (field->available_where_type & GDAEX_QE_WHERE_TYPE_IENDS)
{
gtk_widget_set_visible (gtk_frame_get_label_widget (GTK_FRAME (priv->frame_where)), TRUE);
gtk_widget_set_visible (priv->lbl_where_type, TRUE);
gtk_widget_set_visible (priv->cb_where_type, TRUE);
- gtk_widget_set_visible (priv->lbl_from, TRUE);
- gtk_widget_set_visible (priv->txt_from, TRUE);
}
else
{