aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-02 17:04:50 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-02 17:04:50 +0000
commitff070fb2159ee72f9bebe341a8c4f4124ce287fb (patch)
treef164ad213559de5276cf09eb7bc1ffc20ecaec79
parentfa1365c558f0a8de99073eae5a81aecf34603870 (diff)
downloadgnunet-gtk-ff070fb2159ee72f9bebe341a8c4f4124ce287fb.tar.gz
gnunet-gtk-ff070fb2159ee72f9bebe341a8c4f4124ce287fb.zip
-renaming and cleaning up pseudonym-creation code
-rw-r--r--src/fs/Makefile.am2
-rw-r--r--src/fs/gnunet-fs-gtk_create-pseudonym.c (renamed from src/fs/gnunet-fs-gtk-main_window_create_pseudonym.c)41
2 files changed, 24 insertions, 19 deletions
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am
index d216ebce..4b975471 100644
--- a/src/fs/Makefile.am
+++ b/src/fs/Makefile.am
@@ -14,6 +14,7 @@ gnunet_fs_gtk_SOURCES = \
14 gnunet-fs-gtk_about.c \ 14 gnunet-fs-gtk_about.c \
15 gnunet-fs-gtk_anonymity-widgets.c gnunet-fs-gtk_anonymity-widgets.h \ 15 gnunet-fs-gtk_anonymity-widgets.c gnunet-fs-gtk_anonymity-widgets.h \
16 gnunet-fs-gtk_common.c gnunet-fs-gtk_common.h \ 16 gnunet-fs-gtk_common.c gnunet-fs-gtk_common.h \
17 gnunet-fs-gtk_create-pseudonym.c \
17 gnunet-fs-gtk_download-save-as.c gnunet-fs-gtk_download-save-as.h \ 18 gnunet-fs-gtk_download-save-as.c gnunet-fs-gtk_download-save-as.h \
18 gnunet-fs-gtk_event-handler.c gnunet-fs-gtk_event-handler.h \ 19 gnunet-fs-gtk_event-handler.c gnunet-fs-gtk_event-handler.h \
19 gnunet-fs-gtk_main-window-search.c \ 20 gnunet-fs-gtk_main-window-search.c \
@@ -22,7 +23,6 @@ gnunet_fs_gtk_SOURCES = \
22 gnunet-fs-gtk_publish-edit-dialog.c gnunet-fs-gtk_publish-edit-dialog.h \ 23 gnunet-fs-gtk_publish-edit-dialog.c gnunet-fs-gtk_publish-edit-dialog.h \
23 gnunet-fs-gtk-main_window_meta_data_context_menu.c \ 24 gnunet-fs-gtk-main_window_meta_data_context_menu.c \
24 gnunet-fs-gtk-main_window_adv_pseudonym.c \ 25 gnunet-fs-gtk-main_window_adv_pseudonym.c \
25 gnunet-fs-gtk-main_window_create_pseudonym.c \
26 gnunet-fs-gtk-main_window_file_download.c \ 26 gnunet-fs-gtk-main_window_file_download.c \
27 gnunet-fs-gtk-main_window_namespace.c \ 27 gnunet-fs-gtk-main_window_namespace.c \
28 gnunet-fs-gtk-main_window_open_directory.c 28 gnunet-fs-gtk-main_window_open_directory.c
diff --git a/src/fs/gnunet-fs-gtk-main_window_create_pseudonym.c b/src/fs/gnunet-fs-gtk_create-pseudonym.c
index 9232e775..650017ee 100644
--- a/src/fs/gnunet-fs-gtk-main_window_create_pseudonym.c
+++ b/src/fs/gnunet-fs-gtk_create-pseudonym.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 (C) 2005, 2006, 2010 Christian Grothoff (and other contributing authors) 3 (C) 2005, 2006, 2010, 2012 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -19,38 +19,41 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file src/fs/gnunet-fs-gtk-main_window_create_pseudonym.c 22 * @file src/fs/gnunet-fs-gtk_create-pseudonym.c
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 * 24 * @brief code to handle the main menu action to create a pseudonym
25 */ 25 */
26#include "gnunet-fs-gtk_common.h" 26#include "gnunet-fs-gtk_common.h"
27#include "gnunet-fs-gtk.h" 27#include "gnunet-fs-gtk.h"
28 28
29
30/**
31 * User completed the 'create pseudonym' dialog. Run the desired action.
32 *
33 * @param dialog the dialog
34 * @param response_id '-5' on "OK"
35 * @param user_data the builder of the dialog
36 */
29void 37void
30GNUNET_GTK_create_namespace_dialog_response_cb (GtkDialog * dialog, 38GNUNET_GTK_create_namespace_dialog_response_cb (GtkDialog * dialog,
31 gint response_id, 39 gint response_id,
32 gpointer user_data) 40 gpointer user_data)
33{ 41{
42 GtkBuilder *builder = GTK_BUILDER (user_data);
34 const char *name; 43 const char *name;
35 struct GNUNET_FS_Namespace *ns; 44 struct GNUNET_FS_Namespace *ns;
36 GtkWidget *ad; 45 GtkWidget *ad;
37 GtkBuilder *builder;
38 46
39 builder = GTK_BUILDER (user_data);
40 ad = GTK_WIDGET (gtk_builder_get_object 47 ad = GTK_WIDGET (gtk_builder_get_object
41 (builder, "GNUNET_GTK_create_namespace_dialog")); 48 (builder, "GNUNET_GTK_create_namespace_dialog"));
42
43 if (response_id != -5) 49 if (response_id != -5)
44 { 50 {
45 gtk_widget_destroy (ad); 51 gtk_widget_destroy (ad);
46 g_object_unref (G_OBJECT (builder)); 52 g_object_unref (G_OBJECT (builder));
47 return; 53 return;
48 } 54 }
49 name = 55 name = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder,
50 gtk_entry_get_text (GTK_ENTRY 56 "GNUNET_GTK_create_namespace_name_entry")));
51 (gtk_builder_get_object
52 (builder,
53 "GNUNET_GTK_create_namespace_name_entry")));
54 /* FIXME: show busy dialog while doing key creation */ 57 /* FIXME: show busy dialog while doing key creation */
55 if (NULL != name) 58 if (NULL != name)
56 { 59 {
@@ -61,27 +64,29 @@ GNUNET_GTK_create_namespace_dialog_response_cb (GtkDialog * dialog,
61 g_object_unref (G_OBJECT (builder)); 64 g_object_unref (G_OBJECT (builder));
62} 65}
63 66
67
64/** 68/**
69 * User selected "create pseudonym" in the menu of the main window.
70 *
71 * @param dummy the menu entry
72 * @param user_data the main dialog builder, unused
65 */ 73 */
66void 74void
67GNUNET_GTK_main_menu_create_pseudonym_activate_cb (GtkWidget * dummy, 75GNUNET_GTK_main_menu_create_pseudonym_activate_cb (GtkWidget * dummy,
68 gpointer data) 76 gpointer user_data)
69{ 77{
70 GtkWidget *ad; 78 GtkWidget *ad;
71 GtkWidget *toplevel; 79 GtkWidget *toplevel;
72 GtkBuilder *builder; 80 GtkBuilder *builder;
73 81
74 builder = 82 builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_create_namespace_dialog.glade", NULL);
75 GNUNET_GTK_get_new_builder 83 if (NULL == builder)
76 ("gnunet_fs_gtk_create_namespace_dialog.glade", NULL);
77 if (builder == NULL)
78 { 84 {
79 GNUNET_break (0); 85 GNUNET_break (0);
80 return; 86 return;
81 } 87 }
82 ad = GTK_WIDGET (gtk_builder_get_object 88 ad = GTK_WIDGET (gtk_builder_get_object
83 (builder, "GNUNET_GTK_create_namespace_dialog")); 89 (builder, "GNUNET_GTK_create_namespace_dialog"));
84
85 toplevel = gtk_widget_get_toplevel (dummy); 90 toplevel = gtk_widget_get_toplevel (dummy);
86 if (GTK_IS_WINDOW (toplevel)) 91 if (GTK_IS_WINDOW (toplevel))
87 gtk_window_set_transient_for (GTK_WINDOW (ad), GTK_WINDOW (toplevel)); 92 gtk_window_set_transient_for (GTK_WINDOW (ad), GTK_WINDOW (toplevel));
@@ -89,4 +94,4 @@ GNUNET_GTK_main_menu_create_pseudonym_activate_cb (GtkWidget * dummy,
89} 94}
90 95
91 96
92/* end of gnunet-fs-gtk-main_window_create_pseudonym.c */ 97/* end of gnunet-fs-gtk_create-pseudonym.c */