GtkWidget *w;
GtkListStore *lstore_fields;
+ GtkTreeModel *cb_model;
gint id;
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
g_strsplit ("lstore_tables"
- "|lstore_fields"
+ "|lstore_fields"
"|w_progress"
- "|w_table",
+ "|w_table",
"|", -1),
&error);
if (error != NULL)
priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_table"));
priv->lstore_fields = GTK_LIST_STORE (gtk_builder_get_object (priv->commons->gtkbuilder, "lstore_fields"));
+ priv->cb_model = gtk_combo_box_get_model (GTK_COMBO_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "combobox1")));
g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "combobox1"),
"changed", G_CALLBACK (table_on_cb_tables_changed), (gpointer *)a);
TablePrivate *priv = TABLE_GET_PRIVATE (table);
- model = gtk_combo_box_get_model (GTK_COMBO_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "combobox1")));
-
- gtk_list_store_clear (GTK_LIST_STORE (model));
+ gtk_list_store_clear (GTK_LIST_STORE (priv->cb_model));
dialog = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_progress"));
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main")));
/* updating meta store */
priv->update_metastore_datasource_id = strtol (gtk_label_get_text (GTK_LABEL (gtk_builder_get_object (priv->commons->gtkbuilder, "label8"))), NULL, 10);
error = NULL;
thr = g_thread_create (table_update_metastore,
- (gpointer)table,
- FALSE,
- &error);
+ (gpointer)table,
+ FALSE,
+ &error);
if (thr == NULL || error != NULL)
{
gtk_widget_hide_all (dialog);
dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main")),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Unable to update the metastore: %s",
- error != NULL && error->message != NULL ? error->message : "no details");
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "Unable to update the metastore: %s",
+ error != NULL && error->message != NULL ? error->message : "no details");
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
return;
}
gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (priv->commons->gtkbuilder, "label10")),
- "Updating meta store");
+ "Updating meta store");
gtk_widget_show_all (dialog);
gtk_widget_show_now (dialog);
{
gtk_widget_hide_all (dialog);
dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_builder_get_object (priv->commons->gtkbuilder, "w_main")),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- priv->error_update_metastore);
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ priv->error_update_metastore);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
return;
if (!table_is_a_system_table (priv->commons, table_name))
{
- gtk_list_store_append (GTK_LIST_STORE (model), &iter);
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ gtk_list_store_append (GTK_LIST_STORE (priv->cb_model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (priv->cb_model), &iter,
0, table_name,
-1);
}
}
g_object_unref (dm);
+
+ model = gtk_tree_model_sort_new_with_model (priv->cb_model);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), 0, GTK_SORT_ASCENDING);
+ gtk_combo_box_set_model (GTK_COMBO_BOX (gtk_builder_get_object (priv->commons->gtkbuilder, "combobox1")), model);
}
else
{