{
gboolean ret = FALSE;
- GList *lstConfigs = zak_confi_get_configs_list (confi, filter);
+ GList *lstConfigs = zak_confi_get_configs_list (cnc_string, filter);
gtk_tree_store_clear (storeFolders);
{
filter = (gchar *)gtk_entry_get_text (GTK_ENTRY (txtConfigsFilter));
- confi = zak_confi_new (cnc_string);
-
- if (confi != NULL
- && fill_trFolders (filter))
+ if (fill_trFolders (filter))
{
gtk_widget_set_sensitive (mnuDbClose, TRUE);
gtk_widget_set_sensitive (mnuDbRefresh, TRUE);
gtk_text_buffer_get_bounds (buffer, &iter1, &iter2);
description = gtk_text_buffer_get_text (buffer, &iter1, &iter2, FALSE);
- conficonfi = zak_confi_add_config (confi, name, description);
+ conficonfi = zak_confi_add_config (cnc_string, name, description);
if (conficonfi != NULL)
{
gtk_tree_store_append (storeFolders, &iter, NULL);
GtkTreePath *path = gtk_tree_model_get_path (GTK_TREE_MODEL (storeFolders), &iter);
if (path != NULL && gtk_tree_path_get_depth (path) == 1)
{
- ZakConfi *confi;
-
GError *error = NULL;
gtk_builder_add_objects_from_file (glaMain,
&error);
GtkWidget *diag = GTK_WIDGET (gtk_builder_get_object (glaMain, "wConfiguration"));
- GtkWidget *txtID = GTK_WIDGET (gtk_builder_get_object (glaMain, "txtID"));
GtkWidget *txtName = GTK_WIDGET (gtk_builder_get_object (glaMain, "txtName"));
GtkWidget *txtvDescription = GTK_WIDGET (gtk_builder_get_object (glaMain, "txtvDescription"));
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (txtvDescription));
- gint id;
gchar *name;
gchar *description;
gtk_tree_model_get (GTK_TREE_MODEL (storeFolders), &iter,
+ FOLDERS_COL_KEY, &name,
+ FOLDERS_COL_DESCRIPTION, &description,
-1);
- g_object_get (G_OBJECT (confi),
- "id_config", &id,
- "name", &name,
- "description", &description,
- NULL);
-
- gtk_entry_set_text (GTK_ENTRY (txtID), g_strdup_printf ("%d", id));
gtk_entry_set_text (GTK_ENTRY (txtName), name);
- gtk_text_buffer_set_text (buffer, description, strlen (description));
+ gtk_text_buffer_set_text (buffer, description, -1);
if (gtk_dialog_run (GTK_DIALOG (diag)) == GTK_RESPONSE_OK)
{
+ ZakConfi *confi;
GtkTextIter iter1, iter2;
- name = g_strdup (gtk_entry_get_text (GTK_ENTRY (txtName)));
- gtk_text_buffer_get_bounds (buffer, &iter1, &iter2);
- description = gtk_text_buffer_get_text (buffer, &iter1, &iter2, FALSE);
+ confi = zak_confi_new (g_strdup_printf ("%s;CONFI_NAME=%s", cnc_string, name));
+ if (confi != NULL)
+ {
+ name = g_strdup (gtk_entry_get_text (GTK_ENTRY (txtName)));
+ gtk_text_buffer_get_bounds (buffer, &iter1, &iter2);
+ description = gtk_text_buffer_get_text (buffer, &iter1, &iter2, FALSE);
- g_object_set (G_OBJECT (confi),
- "name", name,
- "description", description,
- NULL);
+ zak_confi_set_config (confi, name, description);
- gtk_tree_store_set (storeFolders, &iter,
- FOLDERS_COL_KEY, name,
- FOLDERS_COL_DESCRIPTION, description,
- -1);
+ gtk_tree_store_set (storeFolders, &iter,
+ FOLDERS_COL_KEY, name,
+ FOLDERS_COL_DESCRIPTION, description,
+ -1);
+ }
}
gtk_widget_destroy (diag);
else
{
/* saving all configurations */
- GList *configs = zak_confi_get_configs_list (confi, filter);
+ GList *configs = zak_confi_get_configs_list (cnc_string, filter);
if (configs != NULL)
{
xmlDocPtr xdoc;
GOptionContext *context;
GError *error;
+ cnc_string = NULL;
+
gtk_init (&argc, &argv);
#ifdef G_OS_WIN32