aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-03-13 10:13:51 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-03-13 10:13:51 +0000
commitad885ecb7b002eb107ef73011e62db7f856ec150 (patch)
tree2eda49966e925013831929973d506352502bcfd1
parente39fdf7b576e62dbaa43cc820e3a9619f016d301 (diff)
downloadgnunet-gtk-ad885ecb7b002eb107ef73011e62db7f856ec150.tar.gz
gnunet-gtk-ad885ecb7b002eb107ef73011e62db7f856ec150.zip
- setting default dir
-rw-r--r--src/gns/gnunet-gns-gtk.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/gns/gnunet-gns-gtk.c b/src/gns/gnunet-gns-gtk.c
index da5ee2e8..f2d6f219 100644
--- a/src/gns/gnunet-gns-gtk.c
+++ b/src/gns/gnunet-gns-gtk.c
@@ -59,7 +59,7 @@ static char *zone_as_string;
59/** 59/**
60 * Default directory of zone files as a string. 60 * Default directory of zone files as a string.
61 */ 61 */
62static char *zonefile_directory; 62static char *zonekey_directory;
63 63
64static GtkWidget *main_window; 64static GtkWidget *main_window;
65 65
@@ -176,6 +176,7 @@ GNUNET_GNS_GTK_open_imagemenuitem_activate_cb (GtkMenuItem *menuitem,
176 GtkBuilder *builder; 176 GtkBuilder *builder;
177 GtkWidget *toplevel; 177 GtkWidget *toplevel;
178 GtkFileFilter *ff; 178 GtkFileFilter *ff;
179 GtkFileChooser *fc;
179 180
180 builder = 181 builder =
181 GNUNET_GTK_get_new_builder ("gnunet_gns_gtk_zone_open.glade", NULL); 182 GNUNET_GTK_get_new_builder ("gnunet_gns_gtk_zone_open.glade", NULL);
@@ -192,6 +193,14 @@ GNUNET_GNS_GTK_open_imagemenuitem_activate_cb (GtkMenuItem *menuitem,
192 193
193 ad = GTK_WIDGET (gtk_builder_get_object 194 ad = GTK_WIDGET (gtk_builder_get_object
194 (builder, "GNUNET_GNS_GTK_zone_open_filechooserdialog")); 195 (builder, "GNUNET_GNS_GTK_zone_open_filechooserdialog"));
196
197 if (GTK_IS_FILE_CHOOSER(ad))
198 {
199 fc = GTK_FILE_CHOOSER(ad);
200 if (NULL != fc)
201 gtk_file_chooser_set_current_folder(fc, zonekey_directory);
202 }
203
195 toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menuitem)); 204 toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menuitem));
196 if (GTK_IS_WINDOW (toplevel)) 205 if (GTK_IS_WINDOW (toplevel))
197 gtk_window_set_transient_for (GTK_WINDOW (ad), GTK_WINDOW (toplevel)); 206 gtk_window_set_transient_for (GTK_WINDOW (ad), GTK_WINDOW (toplevel));
@@ -236,10 +245,10 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
236 GNUNET_CRYPTO_rsa_key_free (zone_pkey); 245 GNUNET_CRYPTO_rsa_key_free (zone_pkey);
237 zone_pkey = NULL; 246 zone_pkey = NULL;
238 } 247 }
239 if (NULL != zonefile_directory) 248 if (NULL != zonekey_directory)
240 { 249 {
241 GNUNET_free (zonefile_directory); 250 GNUNET_free (zonekey_directory);
242 zonefile_directory = NULL; 251 zonekey_directory = NULL;
243 } 252 }
244} 253}
245 254
@@ -295,13 +304,13 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
295 304
296 ml = cls; 305 ml = cls;
297 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (get_configuration (), 306 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (get_configuration (),
298 "namestore", 307 "gns",
299 "ZONEFILE_DIRECTORY", 308 "ZONEKEY_DIRECTORY",
300 &zonefile_directory)) 309 &zonekey_directory))
301 { 310 {
302 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 311 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
303 _("Option `%s' missing in section `%s'\n"), 312 _("Option `%s' missing in section `%s'\n"),
304 "ZONEFILE_DIRECTORY", "namestore"); 313 "ZONEKEY_DIRECTORY", "namestore");
305 return; 314 return;
306 } 315 }
307 316