<object class="GtkMenuItem" id="mnuDb">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">_Database</property>
+ <property name="label" translatable="yes">_ZakConfi</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu" id="mnuDb_menu">
<property name="can_focus">False</property>
- <child>
- <object class="GtkImageMenuItem" id="mnuDbNew">
- <property name="label">gtk-new</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <property name="accel_group">accelgroup1</property>
- <signal name="activate" handler="on_mnuDbNew_activate" swapped="no"/>
- </object>
- </child>
<child>
<object class="GtkImageMenuItem" id="mnuDbOpen">
<property name="label">gtk-open</property>
<signal name="activate" handler="on_mnuConfigsNew_activate" swapped="no"/>
</object>
</child>
- <child>
- <object class="GtkMenuItem" id="mnuConfigsNewFromSchema">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">New from _schema</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_mnuConfigsNewFromSchema_activate" swapped="no"/>
- </object>
- </child>
<child>
<object class="GtkImageMenuItem" id="mnuConfigsEdit">
<property name="label">gtk-edit</property>
<signal name="activate" handler="on_mnuKeysNew_activate" swapped="no"/>
</object>
</child>
- <child>
- <object class="GtkMenuItem" id="mnuKeysNewFromSchema">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">New from _schema</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_mnuKeysNewFromSchema_activate" swapped="no"/>
- </object>
- </child>
<child>
<object class="GtkImageMenuItem" id="mnuKeysEdit">
<property name="label">gtk-edit</property>
</object>
</child>
</object>
- <object class="GtkDialog" id="diagNewDbCfg">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="title" translatable="yes">New - ZakConfiGUI</property>
- <property name="modal">True</property>
- <property name="window_position">center-on-parent</property>
- <property name="default_width">300</property>
- <property name="type_hint">dialog</property>
- <property name="transient_for">wMain</property>
- <property name="attached_to">wMain</property>
- <signal name="response" handler="gtk_widget_hide" swapped="no"/>
- <child internal-child="vbox">
- <object class="GtkBox" id="vbox2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">5</property>
- <property name="margin_right">5</property>
- <property name="margin_top">5</property>
- <property name="margin_bottom">5</property>
- <property name="orientation">vertical</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="button1">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button2">
- <property name="label">gtk-ok</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="table4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">3</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
- <child>
- <object class="GtkLabel" id="label13">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">1° Connection String</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="txtCncString1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="txtDbName">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="txtCncString2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Database Name</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">2° Connection String</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-6">button1</action-widget>
- <action-widget response="-5">button2</action-widget>
- </action-widgets>
- </object>
<object class="GtkDialog" id="diagOpenDbCfg">
<property name="visible">True</property>
<property name="can_focus">False</property>
#include <glib/gprintf.h>
#include <gtk/gtk.h>
-#include <libgdaex/libgdaex.h>
#include <libxml/tree.h>
#include <libxml/xinclude.h>
#include <libxml/xpath.h>
enum
{
- FOLDERS_COL_ID,
- FOLDERS_COL_NAME,
+ FOLDERS_COL_CONFIG,
+ FOLDERS_COL_PATH,
+ FOLDERS_COL_KEY,
FOLDERS_COL_VALUE,
FOLDERS_COL_DESCRIPTION,
- FOLDERS_COL_OBJPTR,
FOLDERS_COLS
};
static GtkTreeSelection *selFolders;
+static ZakConfi *confi;
+
static gchar *cnc_string;
static gchar *filter;
GtkTreeViewColumn *column;
storeFolders = gtk_tree_store_new (FOLDERS_COLS,
- G_TYPE_INT,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING,
gtk_tree_view_set_model (GTK_TREE_VIEW (trFolders), GTK_TREE_MODEL (storeFolders));
renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes ("Name",
+ column = gtk_tree_view_column_new_with_attributes ("Key",
renderer,
- "text", FOLDERS_COL_NAME,
+ "text", FOLDERS_COL_KEY,
NULL);
gtk_tree_view_column_set_resizable (column, TRUE);
gtk_tree_view_append_column (GTK_TREE_VIEW (trFolders), column);
selFolders = gtk_tree_view_get_selection (GTK_TREE_VIEW (trFolders));
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (storeFolders), FOLDERS_COL_NAME, GTK_SORT_ASCENDING);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (storeFolders), FOLDERS_COL_KEY, GTK_SORT_ASCENDING);
}
static void
gtk_tree_store_append (storeFolders, &child, &parent);
gtk_tree_store_set (storeFolders, &child,
- FOLDERS_COL_ID, ck->id,
- FOLDERS_COL_NAME, ck->key,
+ FOLDERS_COL_KEY, ck->key,
FOLDERS_COL_DESCRIPTION, ck->description,
FOLDERS_COL_VALUE, ck->value,
- FOLDERS_COL_OBJPTR, ck,
-1);
fill_trFolders_Keys (node, child);
}
static gboolean
-fill_trFolders (const gchar *cnc_string, const gchar *filter)
+fill_trFolders (const gchar *filter)
{
gboolean ret = FALSE;
- GList *lstConfigs = zak_confi_get_configs_list (cnc_string, filter);
+ GList *lstConfigs = zak_confi_get_configs_list (confi, filter);
gtk_tree_store_clear (storeFolders);
if (lstConfigs != NULL)
{
GtkTreeIter iter;
- ZakConfi *confi;
- gint id;
- gchar *name;
- gchar *description;
+ ZakConfiConfi *conficonfi;
GNode *tree;
lstConfigs = g_list_first (lstConfigs);
- while (lstConfigs && ZAK_IS_CONFI (lstConfigs->data))
+ while (lstConfigs != NULL && lstConfigs->data != NULL)
{
- confi = (ZakConfi *)lstConfigs->data;
-
- g_object_get (G_OBJECT (confi),
- "id_config", &id,
- "name", &name,
- "description", &description,
- NULL);
+ conficonfi = (ZakConfiConfi *)lstConfigs->data;
gtk_tree_store_append (storeFolders, &iter, NULL);
gtk_tree_store_set (storeFolders, &iter,
- FOLDERS_COL_ID, id,
- FOLDERS_COL_NAME, name,
- FOLDERS_COL_DESCRIPTION, description,
- FOLDERS_COL_OBJPTR, confi,
+ FOLDERS_COL_KEY, conficonfi->name,
+ FOLDERS_COL_DESCRIPTION, conficonfi->description,
-1);
tree = zak_confi_get_tree (confi);
gtk_tree_store_append (storeFolders, &iter, iterParent);
gtk_tree_store_set (storeFolders, &iter,
- FOLDERS_COL_ID, ck->id,
- FOLDERS_COL_NAME, ck->key,
+ FOLDERS_COL_KEY, ck->key,
FOLDERS_COL_VALUE, ck->value,
FOLDERS_COL_DESCRIPTION, ck->description,
- FOLDERS_COL_OBJPTR, ck,
-1);
xpresult = xmlXPathEvalExpression ((const xmlChar *)"child::gconfi-key", xpcontext);
gtk_tree_store_append (storeFolders, &iter, NULL);
gtk_tree_store_set (storeFolders, &iter,
- FOLDERS_COL_ID, id,
- FOLDERS_COL_NAME, name,
+ FOLDERS_COL_KEY, name,
FOLDERS_COL_DESCRIPTION, description,
- FOLDERS_COL_OBJPTR, confi,
-1);
xpresult = xmlXPathEvalExpression ((const xmlChar *)"child::gconfi-key", xpcontext);
ZakConfi *confi;
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iter,
- FOLDERS_COL_OBJPTR, &confi,
-1);
create_key_from_xml (confi, "", &iter, xnode, xpcontext);
ZakConfiKey *ck;
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iterConfi,
- FOLDERS_COL_OBJPTR, &confi,
-1);
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iter,
- FOLDERS_COL_OBJPTR, &ck,
-1);
if (ZAK_IS_CONFI (confi))
}
/* CALLBACKS */
-G_MODULE_EXPORT void
-on_mnuDbNew_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- GError *error = NULL;
- gtk_builder_add_objects_from_file (glaMain,
- UIDIR "/zak-confi-gui.ui",
- g_strsplit_set ("diagNewDbCfg", "|", -1),
- &error);
-
- GtkWidget *diag = GTK_WIDGET (gtk_builder_get_object (glaMain, "diagNewDbCfg"));
-
- GtkWidget *txtCncString1 = GTK_WIDGET (gtk_builder_get_object (glaMain, "txtCncString1"));
- GtkWidget *txtDbName = GTK_WIDGET (gtk_builder_get_object (glaMain, "txtDbName"));
- GtkWidget *txtCncString2 = GTK_WIDGET (gtk_builder_get_object (glaMain, "txtCncString2"));
-
- if (gtk_dialog_run (GTK_DIALOG (diag)) == GTK_RESPONSE_OK)
- {
- cnc_string = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (txtCncString1))));
- gchar *dbName = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (txtDbName))));
- if (strcmp (cnc_string, "") != 0)
- {
- GdaEx *gdao = gdaex_new_from_string (cnc_string);
- if (gdao != NULL)
- {
- GdaConnection *gdaConn = (GdaConnection *)gdaex_get_gdaconnection (gdao);
- if (gdaConn == NULL)
- {
- /* TO DO */
- g_fprintf (stderr,"error on first connection\n");
- }
- else
- {
- if (strcmp (dbName, "") != 0)
- {
- cnc_string = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (txtCncString2))));
- if (strcmp (cnc_string, "") != 0)
- {
- GError *error;
- GdaServerOperation *op = gda_server_operation_prepare_create_database (gda_connection_get_provider_name (gdaConn), dbName, &error);
- if (op == NULL || error != NULL)
- {
- /* TO DO */
- g_fprintf(stderr,"error on database creation\n%s",
- error != NULL && error->message != NULL ? error->message : "no details");
- gdao = NULL;
- }
- else
- {
- gda_connection_close (gdaConn);
- gdao = gdaex_new_from_string (cnc_string);
- if (gdao == NULL)
- {
- /* TO DO */
- g_fprintf(stderr,"error on second connection\n");
- gdao = NULL;
- }
- }
- }
- else
- {
- /* TO DO */
- g_fprintf(stderr,"second connection must be specified\n");
- gdao = NULL;
- }
- }
-
- if (gdao != NULL)
- {
- if (gdaex_execute (gdao, "CREATE TABLE configs "
- "("
- " id integer NOT NULL, "
- " name varchar(100) DEFAULT '', "
- " description varchar(255) DEFAULT '', "
- " CONSTRAINT configs_pkey PRIMARY KEY (id), "
- " CONSTRAINT name_unique UNIQUE (name)"
- ")") == -1)
- {
- /* TO DO */
- gdao = NULL;
- }
- else
- {
- gchar chrquot = '\"';
- gchar *sql;
-
- sql = g_strdup_printf ("CREATE TABLE %cvalues%c "
- "("
- " id_configs integer NOT NULL, "
- " id integer NOT NULL, "
- " id_parent integer, "
- " %ckey%c varchar(50) DEFAULT '', "
- " value text DEFAULT '', "
- " description varchar(255) DEFAULT '', "
- " CONSTRAINT values_pkey PRIMARY KEY (id_configs, id), "
- " CONSTRAINT values_name_unique UNIQUE (id_configs, id_parent, %ckey%c)"
- ")",
- chrquot, chrquot, chrquot, chrquot, chrquot, chrquot);
-
- if (gdaex_execute (gdao, sql) == -1)
- {
- /* TO DO */
- gdao = NULL;
- }
- else
- {
- if (fill_trFolders (cnc_string, NULL))
- {
- gtk_widget_set_sensitive (mnuDbClose, TRUE);
- gtk_widget_set_sensitive (mnuDbRefresh, TRUE);
- gtk_widget_set_sensitive (mnuConfigs, TRUE);
- gtk_widget_set_sensitive (mnuKeys, TRUE);
-
- gtk_statusbar_pop (GTK_STATUSBAR (stbar), 0);
- gtk_statusbar_push (GTK_STATUSBAR (stbar), 0,
- g_strconcat ("Connection string: ", cnc_string, NULL));
- }
- }
- }
- }
- }
- }
- }
- }
-
- gtk_widget_destroy (diag);
-}
-
G_MODULE_EXPORT void
on_mnuDbOpen_activate (GtkMenuItem *menuitem,
gpointer user_data)
if (cnc_string != NULL)
{
filter = (gchar *)gtk_entry_get_text (GTK_ENTRY (txtConfigsFilter));
- if (fill_trFolders (cnc_string, filter))
+
+ confi = zak_confi_new (cnc_string);
+
+ if (confi != NULL
+ && fill_trFolders (filter))
{
gtk_widget_set_sensitive (mnuDbClose, TRUE);
gtk_widget_set_sensitive (mnuDbRefresh, TRUE);
on_mnuDbClose_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
+ g_object_unref (confi);
+ confi = NULL;
+
cnc_string = g_strdup ("");
/* TO DO */
on_mnuDbRefresh_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
- fill_trFolders (cnc_string, filter);
+ fill_trFolders (filter);
}
G_MODULE_EXPORT void
gtk_tree_store_append (storeFolders, &iter, NULL);
gtk_tree_store_set (storeFolders, &iter,
- FOLDERS_COL_ID, id,
- FOLDERS_COL_NAME, name,
+ FOLDERS_COL_KEY, name,
FOLDERS_COL_DESCRIPTION, description,
- FOLDERS_COL_OBJPTR, confi,
-1);
}
}
gtk_widget_destroy (diag);
}
-G_MODULE_EXPORT void
-on_mnuConfigsNewFromSchema_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- GtkWidget *diag = gtk_file_chooser_dialog_new ("Choose a schema file - gConfi",
- GTK_WINDOW (w),
- GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
- NULL);
-
- if (gtk_dialog_run (GTK_DIALOG (diag)) == GTK_RESPONSE_ACCEPT)
- {
- const gchar *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (diag));
- load_xml_configuration_schema (filename);
- }
-
- gtk_widget_destroy (diag);
-}
-
G_MODULE_EXPORT void
on_mnuConfigsEdit_activate (GtkMenuItem *menuitem,
gpointer user_data)
gchar *description;
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iter,
- FOLDERS_COL_OBJPTR, &confi,
-1);
g_object_get (G_OBJECT (confi),
NULL);
gtk_tree_store_set (storeFolders, &iter,
- FOLDERS_COL_NAME, name,
+ FOLDERS_COL_KEY, name,
FOLDERS_COL_DESCRIPTION, description,
- FOLDERS_COL_OBJPTR, confi,
-1);
}
ZakConfi *confi;
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iter,
- FOLDERS_COL_OBJPTR, &confi,
-1);
if (ZAK_IS_CONFI (confi))
{
}
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iter,
- FOLDERS_COL_OBJPTR, &confi,
-1);
if (ZAK_IS_CONFI (confi))
{
else
{
/* saving all configurations */
- GList *configs = zak_confi_get_configs_list (cnc_string, filter);
+ GList *configs = zak_confi_get_configs_list (confi, filter);
if (configs != NULL)
{
xmlDocPtr xdoc;
gtk_tree_path_new_from_indices (gtk_tree_path_get_indices (path)[0], -1));
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iter,
- FOLDERS_COL_OBJPTR, &ck,
-1);
keyPath = g_strjoin (NULL, ck->path, "/", ck->key, NULL);
- gtk_entry_set_text (GTK_ENTRY (txtIDParent), g_strdup_printf ("%d", ck->id));
+ gtk_entry_set_text (GTK_ENTRY (txtIDParent), ck->path);
gtk_entry_set_text (GTK_ENTRY (txtParent), ck->key);
}
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iterConfi,
- FOLDERS_COL_OBJPTR, &confi,
-1);
g_object_get (G_OBJECT (confi),
gtk_tree_store_append (storeFolders, &iter, &parent);
gtk_tree_store_set (storeFolders, &iter,
- FOLDERS_COL_ID, ck->id,
- FOLDERS_COL_NAME, name,
+ FOLDERS_COL_KEY, name,
FOLDERS_COL_VALUE, value,
FOLDERS_COL_DESCRIPTION, description,
- FOLDERS_COL_OBJPTR, ck,
-1);
}
}
}
}
-G_MODULE_EXPORT void
-on_mnuKeysNewFromSchema_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- GtkWidget *diag = gtk_file_chooser_dialog_new ("Choose a key's schema file - gConfi",
- GTK_WINDOW (w),
- GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
- NULL);
-
- if (gtk_dialog_run (GTK_DIALOG (diag)) == GTK_RESPONSE_ACCEPT)
- {
- const gchar *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (diag));
- load_xml_configuration_schema (filename);
- }
-
- gtk_widget_destroy (diag);
-}
-
G_MODULE_EXPORT void
on_mnuKeysEdit_activate (GtkMenuItem *menuitem,
gpointer user_data)
gchar *name;
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iterConfi,
- FOLDERS_COL_OBJPTR, &confi,
-1);
g_object_get (G_OBJECT (confi),
}
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iter,
- FOLDERS_COL_OBJPTR, &ck,
-1);
if (ck != NULL)
{
- gtk_entry_set_text (GTK_ENTRY (txtIDConfig), g_strdup_printf ("%d", ck->id_config));
- gtk_entry_set_text (GTK_ENTRY (txtID), g_strdup_printf ("%d", ck->id));
- gtk_entry_set_text (GTK_ENTRY (txtIDParent), g_strdup_printf ("%d", ck->id_parent));
+ gtk_entry_set_text (GTK_ENTRY (txtIDConfig), ck->config);
+ gtk_entry_set_text (GTK_ENTRY (txtID), ck->key);
+ gtk_entry_set_text (GTK_ENTRY (txtIDParent), ck->path);
gtk_entry_set_text (GTK_ENTRY (txtName), ck->key);
gtk_entry_set_text (GTK_ENTRY (txtValue), ck->value);
gtk_text_buffer_set_text (buffer, ck->description, strlen (ck->description));
- if (ck->id_parent > 0 && gtk_tree_model_iter_parent (GTK_TREE_MODEL (storeFolders), &iterParent, &iter))
+ if (g_strcmp0 (ck->path, "") != 0
+ && gtk_tree_model_iter_parent (GTK_TREE_MODEL (storeFolders), &iterParent, &iter))
{
ZakConfiKey *ckParent;
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iterParent,
- FOLDERS_COL_OBJPTR, &ckParent,
-1);
gtk_entry_set_text (GTK_ENTRY (txtParent), ckParent->key);
zak_confi_key_set_key (confi, ck);
gtk_tree_store_set (storeFolders, &iter,
- FOLDERS_COL_NAME, ck->key,
+ FOLDERS_COL_KEY, ck->key,
FOLDERS_COL_VALUE, ck->value,
FOLDERS_COL_DESCRIPTION, ck->description,
- FOLDERS_COL_OBJPTR, ck,
-1);
}
}
gtk_tree_path_new_from_indices (gtk_tree_path_get_indices (path)[0], -1));
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iterConfig,
- FOLDERS_COL_OBJPTR, &confi,
-1);
if (ZAK_IS_CONFI (confi))
ZakConfiKey *ck;
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iter,
- FOLDERS_COL_OBJPTR, &ck,
-1);
if (zak_confi_remove_path (confi, g_strconcat (ck->path, "/", ck->key, NULL)))
if (cnc_string != NULL)
{
- if (fill_trFolders (cnc_string, filter))
+ confi = zak_confi_new (cnc_string);
+ if (confi!= NULL)
{
- gtk_widget_set_sensitive (mnuDbClose, TRUE);
- gtk_widget_set_sensitive (mnuDbRefresh, TRUE);
- gtk_widget_set_sensitive (mnuConfigs, TRUE);
- gtk_widget_set_sensitive (mnuKeys, TRUE);
-
- gtk_statusbar_pop (GTK_STATUSBAR (stbar), 0);
- gtk_statusbar_push (GTK_STATUSBAR (stbar), 0,
- g_strconcat ("Connection string: ", cnc_string, NULL));
+ if (fill_trFolders (filter))
+ {
+ gtk_widget_set_sensitive (mnuDbClose, TRUE);
+ gtk_widget_set_sensitive (mnuDbRefresh, TRUE);
+ gtk_widget_set_sensitive (mnuConfigs, TRUE);
+ gtk_widget_set_sensitive (mnuKeys, TRUE);
+
+ gtk_statusbar_pop (GTK_STATUSBAR (stbar), 0);
+ gtk_statusbar_push (GTK_STATUSBAR (stbar), 0,
+ g_strconcat ("Connection string: ", cnc_string, NULL));
+ }
}
}