diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | contrib/gnunet_gtk.glade | 98 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk.c | 2 | ||||
-rw-r--r-- | src/identity/gnunet-identity-gtk.c | 2 | ||||
-rw-r--r-- | src/include/gnunet_gtk.h | 12 | ||||
-rw-r--r-- | src/lib/eventloop.c | 43 | ||||
-rw-r--r-- | src/main/gnunet-gtk.c | 23 | ||||
-rw-r--r-- | src/namestore/gnunet-namestore-gtk.c | 16 | ||||
-rw-r--r-- | src/peerinfo/gnunet-peerinfo-gtk.c | 2 | ||||
-rw-r--r-- | src/setup/gnunet-setup.c | 2 | ||||
-rw-r--r-- | src/statistics/gnunet-statistics-gtk.c | 23 |
11 files changed, 182 insertions, 43 deletions
diff --git a/configure.ac b/configure.ac index c9b250ef..ad9c6d7d 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -474,6 +474,8 @@ AC_CHECK_LIB(gladeui-1,glade_xml_node_new, [], | |||
474 | ) | 474 | ) |
475 | LIBS=$SAVELIBS | 475 | LIBS=$SAVELIBS |
476 | 476 | ||
477 | AC_CHECK_HEADERS([gtk/gtkx.h]) | ||
478 | |||
477 | AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read-only architecture-independent data]) | 479 | AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing read-only architecture-independent data]) |
478 | 480 | ||
479 | # Set PACKAGE_SOURCE_DIR in gnunet_gtk_config.h. | 481 | # Set PACKAGE_SOURCE_DIR in gnunet_gtk_config.h. |
diff --git a/contrib/gnunet_gtk.glade b/contrib/gnunet_gtk.glade index 9ebb4894..841fb224 100644 --- a/contrib/gnunet_gtk.glade +++ b/contrib/gnunet_gtk.glade | |||
@@ -8,12 +8,12 @@ | |||
8 | <property name="title" translatable="yes">gnunet-gtk</property> | 8 | <property name="title" translatable="yes">gnunet-gtk</property> |
9 | <signal name="delete-event" handler="gnunet_gtk_quit_cb" swapped="no"/> | 9 | <signal name="delete-event" handler="gnunet_gtk_quit_cb" swapped="no"/> |
10 | <child> | 10 | <child> |
11 | <object class="GtkNotebook" id="notebook1"> | 11 | <object class="GtkNotebook" id="gnunt_gtk_notebook"> |
12 | <property name="visible">True</property> | 12 | <property name="visible">True</property> |
13 | <property name="can_focus">True</property> | 13 | <property name="can_focus">True</property> |
14 | <property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK</property> | 14 | <property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK</property> |
15 | <child> | 15 | <child> |
16 | <object class="GtkHBox" id="hbox1"> | 16 | <object class="GtkHBox" id="gnunet_statistics_hbox"> |
17 | <property name="visible">True</property> | 17 | <property name="visible">True</property> |
18 | <property name="can_focus">False</property> | 18 | <property name="can_focus">False</property> |
19 | <property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK</property> | 19 | <property name="events">GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK | GDK_PROXIMITY_IN_MASK | GDK_PROXIMITY_OUT_MASK | GDK_SUBSTRUCTURE_MASK | GDK_SCROLL_MASK</property> |
@@ -23,30 +23,32 @@ | |||
23 | </object> | 23 | </object> |
24 | </child> | 24 | </child> |
25 | <child type="tab"> | 25 | <child type="tab"> |
26 | <object class="GtkLabel" id="label1"> | 26 | <object class="GtkLabel" id="gnunet_statistics_label"> |
27 | <property name="visible">True</property> | 27 | <property name="visible">True</property> |
28 | <property name="can_focus">False</property> | 28 | <property name="can_focus">False</property> |
29 | <property name="label" translatable="yes">page 1</property> | 29 | <property name="label" translatable="yes">Statistics</property> |
30 | </object> | 30 | </object> |
31 | <packing> | 31 | <packing> |
32 | <property name="tab_fill">False</property> | 32 | <property name="tab_fill">False</property> |
33 | </packing> | 33 | </packing> |
34 | </child> | 34 | </child> |
35 | <child> | 35 | <child> |
36 | <object class="GtkFontButton" id="fontbutton1"> | 36 | <object class="GtkHBox" id="gnunet_peerinfo_hbox"> |
37 | <property name="visible">True</property> | 37 | <property name="visible">True</property> |
38 | <property name="can_focus">True</property> | 38 | <property name="can_focus">False</property> |
39 | <property name="receives_default">True</property> | 39 | <child> |
40 | <placeholder/> | ||
41 | </child> | ||
40 | </object> | 42 | </object> |
41 | <packing> | 43 | <packing> |
42 | <property name="position">1</property> | 44 | <property name="position">1</property> |
43 | </packing> | 45 | </packing> |
44 | </child> | 46 | </child> |
45 | <child type="tab"> | 47 | <child type="tab"> |
46 | <object class="GtkLabel" id="label2"> | 48 | <object class="GtkLabel" id="gnunet_peerinfo_label"> |
47 | <property name="visible">True</property> | 49 | <property name="visible">True</property> |
48 | <property name="can_focus">False</property> | 50 | <property name="can_focus">False</property> |
49 | <property name="label" translatable="yes">page 2</property> | 51 | <property name="label" translatable="yes">Peers</property> |
50 | </object> | 52 | </object> |
51 | <packing> | 53 | <packing> |
52 | <property name="position">1</property> | 54 | <property name="position">1</property> |
@@ -54,26 +56,96 @@ | |||
54 | </packing> | 56 | </packing> |
55 | </child> | 57 | </child> |
56 | <child> | 58 | <child> |
57 | <object class="GtkImage" id="image1"> | 59 | <object class="GtkHBox" id="gnunet_namestore_hbox"> |
58 | <property name="visible">True</property> | 60 | <property name="visible">True</property> |
59 | <property name="can_focus">False</property> | 61 | <property name="can_focus">False</property> |
60 | <property name="stock">gtk-missing-image</property> | 62 | <child> |
63 | <placeholder/> | ||
64 | </child> | ||
61 | </object> | 65 | </object> |
62 | <packing> | 66 | <packing> |
63 | <property name="position">2</property> | 67 | <property name="position">2</property> |
64 | </packing> | 68 | </packing> |
65 | </child> | 69 | </child> |
66 | <child type="tab"> | 70 | <child type="tab"> |
67 | <object class="GtkLabel" id="label3"> | 71 | <object class="GtkLabel" id="gnunet_namestore_label"> |
68 | <property name="visible">True</property> | 72 | <property name="visible">True</property> |
69 | <property name="can_focus">False</property> | 73 | <property name="can_focus">False</property> |
70 | <property name="label" translatable="yes">page 3</property> | 74 | <property name="label" translatable="yes">Zone Editor</property> |
71 | </object> | 75 | </object> |
72 | <packing> | 76 | <packing> |
73 | <property name="position">2</property> | 77 | <property name="position">2</property> |
74 | <property name="tab_fill">False</property> | 78 | <property name="tab_fill">False</property> |
75 | </packing> | 79 | </packing> |
76 | </child> | 80 | </child> |
81 | <child> | ||
82 | <object class="GtkHBox" id="gnunet_fs_hbox"> | ||
83 | <property name="visible">True</property> | ||
84 | <property name="can_focus">False</property> | ||
85 | <child> | ||
86 | <placeholder/> | ||
87 | </child> | ||
88 | </object> | ||
89 | <packing> | ||
90 | <property name="position">3</property> | ||
91 | </packing> | ||
92 | </child> | ||
93 | <child type="tab"> | ||
94 | <object class="GtkLabel" id="gnunet_fs_label"> | ||
95 | <property name="visible">True</property> | ||
96 | <property name="can_focus">False</property> | ||
97 | <property name="label" translatable="yes">File Sharing</property> | ||
98 | </object> | ||
99 | <packing> | ||
100 | <property name="position">3</property> | ||
101 | <property name="tab_fill">False</property> | ||
102 | </packing> | ||
103 | </child> | ||
104 | <child> | ||
105 | <object class="GtkHBox" id="gnunet_identity_hbox"> | ||
106 | <property name="visible">True</property> | ||
107 | <property name="can_focus">False</property> | ||
108 | <child> | ||
109 | <placeholder/> | ||
110 | </child> | ||
111 | </object> | ||
112 | <packing> | ||
113 | <property name="position">4</property> | ||
114 | </packing> | ||
115 | </child> | ||
116 | <child type="tab"> | ||
117 | <object class="GtkLabel" id="gnunet_identity_label"> | ||
118 | <property name="visible">True</property> | ||
119 | <property name="can_focus">False</property> | ||
120 | <property name="label" translatable="yes">Egos</property> | ||
121 | </object> | ||
122 | <packing> | ||
123 | <property name="position">4</property> | ||
124 | <property name="tab_fill">False</property> | ||
125 | </packing> | ||
126 | </child> | ||
127 | <child> | ||
128 | <object class="GtkHBox" id="gnunet_setup_hbox"> | ||
129 | <property name="can_focus">False</property> | ||
130 | <child> | ||
131 | <placeholder/> | ||
132 | </child> | ||
133 | </object> | ||
134 | <packing> | ||
135 | <property name="position">5</property> | ||
136 | </packing> | ||
137 | </child> | ||
138 | <child type="tab"> | ||
139 | <object class="GtkLabel" id="gnunet_setup_label"> | ||
140 | <property name="visible">True</property> | ||
141 | <property name="can_focus">False</property> | ||
142 | <property name="label" translatable="yes">Setup</property> | ||
143 | </object> | ||
144 | <packing> | ||
145 | <property name="position">5</property> | ||
146 | <property name="tab_fill">False</property> | ||
147 | </packing> | ||
148 | </child> | ||
77 | </object> | 149 | </object> |
78 | </child> | 150 | </child> |
79 | </object> | 151 | </object> |
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c index 425e1e4d..5f9c4bbc 100644 --- a/src/fs/gnunet-fs-gtk.c +++ b/src/fs/gnunet-fs-gtk.c | |||
@@ -681,6 +681,8 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
681 | main_context.cfg = GNUNET_GTK_main_loop_get_configuration (ml); | 681 | main_context.cfg = GNUNET_GTK_main_loop_get_configuration (ml); |
682 | main_context.search_ns_treestore = GTK_TREE_STORE (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_treestore")); | 682 | main_context.search_ns_treestore = GTK_TREE_STORE (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_treestore")); |
683 | main_context.main_window = GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_main_window")); | 683 | main_context.main_window = GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_main_window")); |
684 | main_context.main_window = GNUNET_GTK_plug_me ("GNUNET_FS_GTK_PLUG", | ||
685 | main_context.main_window); | ||
684 | main_context.ns_selector_treeview = GTK_TREE_VIEW (GNUNET_FS_GTK_get_main_window_object ("namespace_selector_treeview")); | 686 | main_context.ns_selector_treeview = GTK_TREE_VIEW (GNUNET_FS_GTK_get_main_window_object ("namespace_selector_treeview")); |
685 | main_context.ns_selector_window = GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object ("namespace_selector_window")); | 687 | main_context.ns_selector_window = GTK_WIDGET (GNUNET_FS_GTK_get_main_window_object ("namespace_selector_window")); |
686 | main_context.ns_dropdown_button = GTK_TOGGLE_BUTTON (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_dropdown_button")); | 688 | main_context.ns_dropdown_button = GTK_TOGGLE_BUTTON (GNUNET_FS_GTK_get_main_window_object ("main_window_search_namespace_dropdown_button")); |
diff --git a/src/identity/gnunet-identity-gtk.c b/src/identity/gnunet-identity-gtk.c index 3c262784..a5607a71 100644 --- a/src/identity/gnunet-identity-gtk.c +++ b/src/identity/gnunet-identity-gtk.c | |||
@@ -511,6 +511,8 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
511 | GNUNET_GTK_setup_nls (); | 511 | GNUNET_GTK_setup_nls (); |
512 | /* setup main window */ | 512 | /* setup main window */ |
513 | main_window = GTK_WIDGET (get_object ("GNUNET_GTK_identity_window")); | 513 | main_window = GTK_WIDGET (get_object ("GNUNET_GTK_identity_window")); |
514 | main_window = GNUNET_GTK_plug_me ("GNUNET_IDENTITY_GTK_PLUG", | ||
515 | main_window); | ||
514 | ls = GTK_LIST_STORE (get_object ("GNUNET_GTK_identity_liststore")); | 516 | ls = GTK_LIST_STORE (get_object ("GNUNET_GTK_identity_liststore")); |
515 | GNUNET_assert (NULL != ls); | 517 | GNUNET_assert (NULL != ls); |
516 | gtk_list_store_insert_with_values (ls, | 518 | gtk_list_store_insert_with_values (ls, |
diff --git a/src/include/gnunet_gtk.h b/src/include/gnunet_gtk.h index 730aacd0..523524d6 100644 --- a/src/include/gnunet_gtk.h +++ b/src/include/gnunet_gtk.h | |||
@@ -57,6 +57,18 @@ struct GNUNET_GTK_MainLoop; | |||
57 | /* ****************** Initialization *************** */ | 57 | /* ****************** Initialization *************** */ |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * If desired, enable plugging of this main window in the meta window. | ||
61 | * | ||
62 | * @param env_name environment variable to check | ||
63 | * @param main_window main window to plug | ||
64 | * @return new main window to initialize | ||
65 | */ | ||
66 | GtkWidget * | ||
67 | GNUNET_GTK_plug_me (const char *env_name, | ||
68 | GtkWidget *main_window); | ||
69 | |||
70 | |||
71 | /** | ||
60 | * Initialize natural language support. | 72 | * Initialize natural language support. |
61 | */ | 73 | */ |
62 | void | 74 | void |
diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c index b7d5869e..aabcfa63 100644 --- a/src/lib/eventloop.c +++ b/src/lib/eventloop.c | |||
@@ -24,7 +24,9 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "gnunet_gtk.h" | 26 | #include "gnunet_gtk.h" |
27 | 27 | #if HAVE_GTK_GTKX_H | |
28 | #include <gtk/gtkx.h> | ||
29 | #endif | ||
28 | 30 | ||
29 | /** | 31 | /** |
30 | * Initial size of our poll array cache. | 32 | * Initial size of our poll array cache. |
@@ -168,6 +170,45 @@ struct GNUNET_GTK_MainLoop | |||
168 | }; | 170 | }; |
169 | 171 | ||
170 | 172 | ||
173 | /** | ||
174 | * If desired, enable plugging of this main window in the meta window. | ||
175 | * | ||
176 | * @param env_name environment variable to check | ||
177 | * @param main_window main window to plug | ||
178 | * @return new main window to initialize | ||
179 | */ | ||
180 | GtkWidget * | ||
181 | GNUNET_GTK_plug_me (const char *env_name, | ||
182 | GtkWidget *main_window) | ||
183 | { | ||
184 | #if HAVE_GTK_GTKX_H | ||
185 | const char *plugid; | ||
186 | GtkWidget *plug; | ||
187 | GtkWidget *child; | ||
188 | unsigned long long id; | ||
189 | |||
190 | if (NULL == (plugid = getenv (env_name))) | ||
191 | return main_window; /* no plugging */ | ||
192 | if (1 != sscanf (plugid, | ||
193 | "%llu", | ||
194 | &id)) | ||
195 | { | ||
196 | fprintf (stderr, | ||
197 | _("Invalid plug name `%s'\n"), | ||
198 | plugid); | ||
199 | return main_window; | ||
200 | } | ||
201 | plug = gtk_plug_new ((Window) id); | ||
202 | child = gtk_bin_get_child (GTK_BIN (main_window)); | ||
203 | gtk_widget_reparent (child, | ||
204 | plug); | ||
205 | gtk_widget_destroy (main_window); | ||
206 | return plug; | ||
207 | #else | ||
208 | return main_window; | ||
209 | #endif | ||
210 | } | ||
211 | |||
171 | 212 | ||
172 | /** | 213 | /** |
173 | * Get the configuration. | 214 | * Get the configuration. |
diff --git a/src/main/gnunet-gtk.c b/src/main/gnunet-gtk.c index af4e092c..04df096f 100644 --- a/src/main/gnunet-gtk.c +++ b/src/main/gnunet-gtk.c | |||
@@ -24,7 +24,9 @@ | |||
24 | * @brief Gtk user interface for GNUnet | 24 | * @brief Gtk user interface for GNUnet |
25 | */ | 25 | */ |
26 | #include "gnunet_gtk.h" | 26 | #include "gnunet_gtk.h" |
27 | #if HAVE_GTK_GTKX_H | ||
27 | #include <gtk/gtkx.h> | 28 | #include <gtk/gtkx.h> |
29 | #endif | ||
28 | 30 | ||
29 | /** | 31 | /** |
30 | * Main loop handle. | 32 | * Main loop handle. |
@@ -87,6 +89,7 @@ gnunet_gtk_quit_cb (GObject * object, | |||
87 | } | 89 | } |
88 | 90 | ||
89 | 91 | ||
92 | #if HAVE_GTK_GTKX_H | ||
90 | /** | 93 | /** |
91 | * Handle for a plugged in process. | 94 | * Handle for a plugged in process. |
92 | */ | 95 | */ |
@@ -218,6 +221,7 @@ plug (const char *container, | |||
218 | start_process (p); | 221 | start_process (p); |
219 | gtk_widget_show (p->s); | 222 | gtk_widget_show (p->s); |
220 | } | 223 | } |
224 | #endif | ||
221 | 225 | ||
222 | 226 | ||
223 | /** | 227 | /** |
@@ -239,9 +243,26 @@ run (void *cls, | |||
239 | main_window = GTK_WIDGET (get_object ("gnunet_gtk_window")); | 243 | main_window = GTK_WIDGET (get_object ("gnunet_gtk_window")); |
240 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 244 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
241 | &cleanup_task, NULL); | 245 | &cleanup_task, NULL); |
242 | plug ("hbox1", | 246 | #if HAVE_GTK_GTKX_H |
247 | plug ("gnunet_statistics_hbox", | ||
243 | "gnunet-statistics-gtk", | 248 | "gnunet-statistics-gtk", |
244 | "GNUNET_STATISTICS_GTK_PLUG"); | 249 | "GNUNET_STATISTICS_GTK_PLUG"); |
250 | plug ("gnunet_peerinfo_hbox", | ||
251 | "gnunet-peerinfo-gtk", | ||
252 | "GNUNET_PEERINFO_GTK_PLUG"); | ||
253 | plug ("gnunet_namestore_hbox", | ||
254 | "gnunet-namestore-gtk", | ||
255 | "GNUNET_NAMESTORE_GTK_PLUG"); | ||
256 | plug ("gnunet_fs_hbox", | ||
257 | "gnunet-fs-gtk", | ||
258 | "GNUNET_FS_GTK_PLUG"); | ||
259 | plug ("gnunet_identity_hbox", | ||
260 | "gnunet-identity-gtk", | ||
261 | "GNUNET_IDENTITY_GTK_PLUG"); | ||
262 | plug ("gnunet_setup_hbox", | ||
263 | "gnunet-setup", | ||
264 | "GNUNET_SETUP_PLUG"); | ||
265 | #endif | ||
245 | gtk_widget_show (main_window); | 266 | gtk_widget_show (main_window); |
246 | gtk_window_present (GTK_WINDOW (main_window)); | 267 | gtk_window_present (GTK_WINDOW (main_window)); |
247 | } | 268 | } |
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c index fe03b6b7..84c0f10e 100644 --- a/src/namestore/gnunet-namestore-gtk.c +++ b/src/namestore/gnunet-namestore-gtk.c | |||
@@ -375,6 +375,11 @@ static struct GNUNET_IDENTITY_Handle *identity; | |||
375 | static struct GNUNET_GTK_MainLoop *ml; | 375 | static struct GNUNET_GTK_MainLoop *ml; |
376 | 376 | ||
377 | /** | 377 | /** |
378 | * Main window. | ||
379 | */ | ||
380 | static GtkWidget *main_window; | ||
381 | |||
382 | /** | ||
378 | * Our configuration. | 383 | * Our configuration. |
379 | */ | 384 | */ |
380 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 385 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
@@ -670,7 +675,6 @@ operation_done_cont (void *cls, | |||
670 | { | 675 | { |
671 | struct OperationContext *oc = cls; | 676 | struct OperationContext *oc = cls; |
672 | GtkWidget *dialog; | 677 | GtkWidget *dialog; |
673 | GtkWindow *main_window; | ||
674 | 678 | ||
675 | oc->qe = NULL; | 679 | oc->qe = NULL; |
676 | GNUNET_CONTAINER_DLL_remove (oc_head, | 680 | GNUNET_CONTAINER_DLL_remove (oc_head, |
@@ -678,9 +682,8 @@ operation_done_cont (void *cls, | |||
678 | oc); | 682 | oc); |
679 | if (GNUNET_SYSERR == success) | 683 | if (GNUNET_SYSERR == success) |
680 | { | 684 | { |
681 | main_window = GTK_WINDOW (get_object ("gnunet_namestore_gtk_dialog")); | ||
682 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Operation failed: `%s'\n"), emsg); | 685 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Operation failed: `%s'\n"), emsg); |
683 | dialog = gtk_message_dialog_new (main_window, | 686 | dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), |
684 | GTK_DIALOG_DESTROY_WITH_PARENT, | 687 | GTK_DIALOG_DESTROY_WITH_PARENT, |
685 | GTK_MESSAGE_ERROR, | 688 | GTK_MESSAGE_ERROR, |
686 | GTK_BUTTONS_CLOSE, | 689 | GTK_BUTTONS_CLOSE, |
@@ -758,12 +761,10 @@ static void | |||
758 | show_error_message (const char *title, | 761 | show_error_message (const char *title, |
759 | const char *emsg) | 762 | const char *emsg) |
760 | { | 763 | { |
761 | GtkWindow *main_window; | ||
762 | GtkDialog *dialog; | 764 | GtkDialog *dialog; |
763 | 765 | ||
764 | /* TODO: consider replacing with widget in the main window */ | 766 | /* TODO: consider replacing with widget in the main window */ |
765 | main_window = GTK_WINDOW (get_object ("gnunet_namestore_gtk_dialog")); | 767 | dialog = GTK_DIALOG(gtk_message_dialog_new (GTK_WINDOW (main_window), |
766 | dialog = GTK_DIALOG(gtk_message_dialog_new (main_window, | ||
767 | GTK_DIALOG_DESTROY_WITH_PARENT, | 768 | GTK_DIALOG_DESTROY_WITH_PARENT, |
768 | GTK_MESSAGE_ERROR, | 769 | GTK_MESSAGE_ERROR, |
769 | GTK_BUTTONS_CLOSE, | 770 | GTK_BUTTONS_CLOSE, |
@@ -2225,7 +2226,6 @@ static void | |||
2225 | run (void *cls, | 2226 | run (void *cls, |
2226 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 2227 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
2227 | { | 2228 | { |
2228 | GtkWidget *main_window; | ||
2229 | gchar *label; | 2229 | gchar *label; |
2230 | GtkLabel *status_label; | 2230 | GtkLabel *status_label; |
2231 | 2231 | ||
@@ -2235,6 +2235,8 @@ run (void *cls, | |||
2235 | return; | 2235 | return; |
2236 | 2236 | ||
2237 | main_window = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog")); | 2237 | main_window = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog")); |
2238 | main_window = GNUNET_GTK_plug_me ("GNUNET_NAMESTORE_GTK_PLUG", | ||
2239 | main_window); | ||
2238 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 2240 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
2239 | &cleanup_task, NULL); | 2241 | &cleanup_task, NULL); |
2240 | 2242 | ||
diff --git a/src/peerinfo/gnunet-peerinfo-gtk.c b/src/peerinfo/gnunet-peerinfo-gtk.c index 3971bee9..9683c123 100644 --- a/src/peerinfo/gnunet-peerinfo-gtk.c +++ b/src/peerinfo/gnunet-peerinfo-gtk.c | |||
@@ -664,6 +664,8 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
664 | ats = GNUNET_ATS_performance_init (get_configuration (), &status_cb, NULL); | 664 | ats = GNUNET_ATS_performance_init (get_configuration (), &status_cb, NULL); |
665 | /* setup main window */ | 665 | /* setup main window */ |
666 | main_window = GTK_WIDGET (get_object ("GNUNET_PEERINFO_GTK_main_window")); | 666 | main_window = GTK_WIDGET (get_object ("GNUNET_PEERINFO_GTK_main_window")); |
667 | main_window = GNUNET_GTK_plug_me ("GNUNET_PEERINFO_GTK_PLUG", | ||
668 | main_window); | ||
667 | ls = GTK_LIST_STORE (get_object ("GNUNET_PEERINFO_GTK_list_store")); | 669 | ls = GTK_LIST_STORE (get_object ("GNUNET_PEERINFO_GTK_list_store")); |
668 | GNUNET_assert (NULL != ls); | 670 | GNUNET_assert (NULL != ls); |
669 | gtk_window_maximize (GTK_WINDOW (main_window)); | 671 | gtk_window_maximize (GTK_WINDOW (main_window)); |
diff --git a/src/setup/gnunet-setup.c b/src/setup/gnunet-setup.c index a7a306d8..ba82800e 100644 --- a/src/setup/gnunet-setup.c +++ b/src/setup/gnunet-setup.c | |||
@@ -641,6 +641,8 @@ run (void *cls, | |||
641 | (void) GNUNET_CONFIGURATION_load (cfg, cfgName); | 641 | (void) GNUNET_CONFIGURATION_load (cfg, cfgName); |
642 | } | 642 | } |
643 | main_window = GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_dialog")); | 643 | main_window = GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_dialog")); |
644 | main_window = GNUNET_GTK_plug_me ("GNUNET_FS_GTK_PLUG", | ||
645 | main_window); | ||
644 | GNUNET_CLIENT_service_test ("resolver", | 646 | GNUNET_CLIENT_service_test ("resolver", |
645 | cfg, | 647 | cfg, |
646 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, | 648 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, |
diff --git a/src/statistics/gnunet-statistics-gtk.c b/src/statistics/gnunet-statistics-gtk.c index cac4452f..4c9426a6 100644 --- a/src/statistics/gnunet-statistics-gtk.c +++ b/src/statistics/gnunet-statistics-gtk.c | |||
@@ -30,8 +30,6 @@ | |||
30 | #include <cairo.h> | 30 | #include <cairo.h> |
31 | #include "gtk_statistics.h" | 31 | #include "gtk_statistics.h" |
32 | 32 | ||
33 | #include <gtk/gtkx.h> | ||
34 | |||
35 | #define MAX_HISTORY 1280 | 33 | #define MAX_HISTORY 1280 |
36 | 34 | ||
37 | 35 | ||
@@ -241,7 +239,6 @@ static void | |||
241 | run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 239 | run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
242 | { | 240 | { |
243 | GtkWidget *main_window; | 241 | GtkWidget *main_window; |
244 | char *plugid; | ||
245 | 242 | ||
246 | ml = cls; | 243 | ml = cls; |
247 | 244 | ||
@@ -264,24 +261,8 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
264 | 261 | ||
265 | /* setup main window */ | 262 | /* setup main window */ |
266 | main_window = GTK_WIDGET (get_object ("GNUNET_STATISTICS_GTK_main_window")); | 263 | main_window = GTK_WIDGET (get_object ("GNUNET_STATISTICS_GTK_main_window")); |
267 | if (NULL != (plugid = getenv ("GNUNET_STATISTICS_GTK_PLUG"))) | 264 | main_window = GNUNET_GTK_plug_me ("GNUNET_STATISTICS_GTK_PLUG", |
268 | { | 265 | main_window); |
269 | GtkWidget *plug; | ||
270 | GtkWidget *child; | ||
271 | unsigned long long id; | ||
272 | |||
273 | if (1 == sscanf (plugid, | ||
274 | "%llu", | ||
275 | &id)) | ||
276 | { | ||
277 | plug = gtk_plug_new ((Window) id); | ||
278 | child = gtk_bin_get_child (GTK_BIN (main_window)); | ||
279 | gtk_widget_reparent (child, | ||
280 | plug); | ||
281 | gtk_widget_destroy (main_window); | ||
282 | main_window = plug; | ||
283 | } | ||
284 | } | ||
285 | gtk_window_maximize (GTK_WINDOW (main_window)); | 266 | gtk_window_maximize (GTK_WINDOW (main_window)); |
286 | GNUNET_GTK_tray_icon_create (ml, | 267 | GNUNET_GTK_tray_icon_create (ml, |
287 | GTK_WINDOW (main_window), | 268 | GTK_WINDOW (main_window), |