diff options
author | Christian Grothoff <christian@grothoff.org> | 2008-06-07 21:49:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2008-06-07 21:49:33 +0000 |
commit | 04323bcef87404f18bb05a55060d9479d6a4a5b0 (patch) | |
tree | 059d5413af30e43bdc91f91781da56a56738493e | |
parent | 741ad9a963b5d390d6336d4a5bc09fa12de50cbd (diff) | |
download | gnunet-gtk-04323bcef87404f18bb05a55060d9479d6a4a5b0.tar.gz gnunet-gtk-04323bcef87404f18bb05a55060d9479d6a4a5b0.zip |
cleanup
-rw-r--r-- | src/common/helper.c | 16 | ||||
-rw-r--r-- | src/include/gnunetgtk_common.h | 7 | ||||
-rw-r--r-- | src/plugins/chat/chat.c | 17 | ||||
-rw-r--r-- | src/plugins/fs/meta.c | 14 | ||||
-rw-r--r-- | src/plugins/fs/meta.h | 4 | ||||
-rw-r--r-- | src/plugins/fs/namespace.c | 2 | ||||
-rw-r--r-- | src/plugins/fs/search.c | 4 |
7 files changed, 27 insertions, 37 deletions
diff --git a/src/common/helper.c b/src/common/helper.c index 01a26825..c9f218e8 100644 --- a/src/common/helper.c +++ b/src/common/helper.c | |||
@@ -698,4 +698,20 @@ GNUNET_GTK_run_gnunet_setup (gchar * conffile, gboolean run_wizard) | |||
698 | return TRUE; | 698 | return TRUE; |
699 | } | 699 | } |
700 | 700 | ||
701 | GtkWidget *GNUNET_GTK_extract_main_widget_from_window (GladeXML * xml, | ||
702 | const char *windowName) | ||
703 | { | ||
704 | GtkContainer *window; | ||
705 | GtkWidget *ret; | ||
706 | |||
707 | window = GTK_CONTAINER (glade_xml_get_widget (xml, windowName)); | ||
708 | ret = gtk_bin_get_child (GTK_BIN (window)); | ||
709 | gtk_widget_ref (ret); | ||
710 | gtk_container_remove (window, ret); | ||
711 | gtk_widget_destroy (GTK_WIDGET (window)); | ||
712 | return ret; | ||
713 | } | ||
714 | |||
715 | |||
716 | |||
701 | /* end of helper.c */ | 717 | /* end of helper.c */ |
diff --git a/src/include/gnunetgtk_common.h b/src/include/gnunetgtk_common.h index d70009f6..b0cce179 100644 --- a/src/include/gnunetgtk_common.h +++ b/src/include/gnunetgtk_common.h | |||
@@ -173,4 +173,11 @@ void GNUNET_GTK_tree_model_foreach (GtkTreeModel * model, | |||
173 | 173 | ||
174 | struct GNUNET_CronManager *GNUNET_GTK_get_cron_manager (void); | 174 | struct GNUNET_CronManager *GNUNET_GTK_get_cron_manager (void); |
175 | 175 | ||
176 | |||
177 | GtkWidget *GNUNET_GTK_extract_main_widget_from_window (GladeXML * xml, | ||
178 | const char *windowName); | ||
179 | |||
180 | |||
181 | |||
182 | |||
176 | #endif | 183 | #endif |
diff --git a/src/plugins/chat/chat.c b/src/plugins/chat/chat.c index a7e8c038..6db7bbfa 100644 --- a/src/plugins/chat/chat.c +++ b/src/plugins/chat/chat.c | |||
@@ -242,21 +242,6 @@ on_chat_frame_send_button_click_event_chat (GtkWidget * widget, gpointer data) | |||
242 | GNUNET_mutex_unlock (lock); | 242 | GNUNET_mutex_unlock (lock); |
243 | } | 243 | } |
244 | 244 | ||
245 | /** FIXME: move to gtkcommon! */ | ||
246 | static GtkWidget * | ||
247 | extractMainWidgetFromWindow (GladeXML * xml, const char *windowName) | ||
248 | { | ||
249 | GtkContainer *window; | ||
250 | GtkWidget *ret; | ||
251 | |||
252 | window = GTK_CONTAINER (glade_xml_get_widget (xml, windowName)); | ||
253 | ret = gtk_bin_get_child (GTK_BIN (window)); | ||
254 | gtk_widget_ref (ret); | ||
255 | gtk_container_remove (window, ret); | ||
256 | gtk_widget_destroy (GTK_WIDGET (window)); | ||
257 | return ret; | ||
258 | } | ||
259 | |||
260 | static void | 245 | static void |
261 | create_chat_room_tab (const char *room_name, const char *nick) | 246 | create_chat_room_tab (const char *room_name, const char *nick) |
262 | { | 247 | { |
@@ -277,7 +262,7 @@ create_chat_room_tab (const char *room_name, const char *nick) | |||
277 | glade_xml_new (GNUNET_GTK_get_glade_filename (), | 262 | glade_xml_new (GNUNET_GTK_get_glade_filename (), |
278 | "chatFrame", PACKAGE_NAME); | 263 | "chatFrame", PACKAGE_NAME); |
279 | GNUNET_GTK_connect_glade_with_plugins (client->chatXML); | 264 | GNUNET_GTK_connect_glade_with_plugins (client->chatXML); |
280 | client->chatFrame = extractMainWidgetFromWindow (client->chatXML, | 265 | client->chatFrame = GNUNET_GTK_extract_main_widget_from_window (client->chatXML, |
281 | "chatFrame"); | 266 | "chatFrame"); |
282 | chatLabel = gtk_label_new (room_name); | 267 | chatLabel = gtk_label_new (room_name); |
283 | gtk_notebook_append_page (GTK_NOTEBOOK (chatnotebook), | 268 | gtk_notebook_append_page (GTK_NOTEBOOK (chatnotebook), |
diff --git a/src/plugins/fs/meta.c b/src/plugins/fs/meta.c index 11ec6449..ee4bfdd9 100644 --- a/src/plugins/fs/meta.c +++ b/src/plugins/fs/meta.c | |||
@@ -505,20 +505,6 @@ getThumbnailFromMetaData (const struct GNUNET_MetaData * meta) | |||
505 | return pixbuf; | 505 | return pixbuf; |
506 | } | 506 | } |
507 | 507 | ||
508 | GtkWidget * | ||
509 | extractMainWidgetFromWindow (GladeXML * xml, const char *windowName) | ||
510 | { | ||
511 | GtkContainer *window; | ||
512 | GtkWidget *ret; | ||
513 | |||
514 | window = GTK_CONTAINER (glade_xml_get_widget (xml, windowName)); | ||
515 | ret = gtk_bin_get_child (GTK_BIN (window)); | ||
516 | gtk_widget_ref (ret); | ||
517 | gtk_container_remove (window, ret); | ||
518 | gtk_widget_destroy (GTK_WIDGET (window)); | ||
519 | return ret; | ||
520 | } | ||
521 | |||
522 | int | 508 | int |
523 | getToggleButtonValue (GladeXML * xml, const char *widgetName) | 509 | getToggleButtonValue (GladeXML * xml, const char *widgetName) |
524 | { | 510 | { |
diff --git a/src/plugins/fs/meta.h b/src/plugins/fs/meta.h index d9ab6293..756d1667 100644 --- a/src/plugins/fs/meta.h +++ b/src/plugins/fs/meta.h | |||
@@ -81,9 +81,5 @@ const char *getEntryLineValue (GladeXML * xml, const char *widgetName); | |||
81 | 81 | ||
82 | GdkPixbuf *getThumbnailFromMetaData (const struct GNUNET_MetaData *meta); | 82 | GdkPixbuf *getThumbnailFromMetaData (const struct GNUNET_MetaData *meta); |
83 | 83 | ||
84 | GtkWidget *extractMainWidgetFromWindow (GladeXML * xml, | ||
85 | const char *windowName); | ||
86 | |||
87 | |||
88 | /* end of meta.h */ | 84 | /* end of meta.h */ |
89 | #endif | 85 | #endif |
diff --git a/src/plugins/fs/namespace.c b/src/plugins/fs/namespace.c index 9aec5622..987d0264 100644 --- a/src/plugins/fs/namespace.c +++ b/src/plugins/fs/namespace.c | |||
@@ -120,7 +120,7 @@ makeNamespaceFrame (NamespaceList * entry) | |||
120 | = glade_xml_new (GNUNET_GTK_get_glade_filename (), | 120 | = glade_xml_new (GNUNET_GTK_get_glade_filename (), |
121 | "namespaceContentFrame", PACKAGE_NAME); | 121 | "namespaceContentFrame", PACKAGE_NAME); |
122 | GNUNET_GTK_connect_glade_with_plugins (namespaceXML); | 122 | GNUNET_GTK_connect_glade_with_plugins (namespaceXML); |
123 | child = extractMainWidgetFromWindow (namespaceXML, "namespaceContentFrame"); | 123 | child = GNUNET_GTK_extract_main_widget_from_window (namespaceXML, "namespaceContentFrame"); |
124 | resultList = glade_xml_get_widget (namespaceXML, | 124 | resultList = glade_xml_get_widget (namespaceXML, |
125 | "namespaceContentFrameTreeView"); | 125 | "namespaceContentFrameTreeView"); |
126 | entry->addButton = glade_xml_get_widget (namespaceXML, "addButton"); | 126 | entry->addButton = glade_xml_get_widget (namespaceXML, "addButton"); |
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c index 92329cb9..aaabb079 100644 --- a/src/plugins/fs/search.c +++ b/src/plugins/fs/search.c | |||
@@ -711,7 +711,7 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
711 | PACKAGE_NAME); | 711 | PACKAGE_NAME); |
712 | GNUNET_GTK_connect_glade_with_plugins (list->searchXML); | 712 | GNUNET_GTK_connect_glade_with_plugins (list->searchXML); |
713 | list->searchpage | 713 | list->searchpage |
714 | = extractMainWidgetFromWindow (list->searchXML, "searchResultsFrame"); | 714 | = GNUNET_GTK_extract_main_widget_from_window (list->searchXML, "searchResultsFrame"); |
715 | /* setup tree view and renderers */ | 715 | /* setup tree view and renderers */ |
716 | list->treeview = GTK_TREE_VIEW (glade_xml_get_widget (list->searchXML, | 716 | list->treeview = GTK_TREE_VIEW (glade_xml_get_widget (list->searchXML, |
717 | "searchResults")); | 717 | "searchResults")); |
@@ -935,7 +935,7 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
935 | "searchTabLabelWindow", PACKAGE_NAME); | 935 | "searchTabLabelWindow", PACKAGE_NAME); |
936 | GNUNET_GTK_connect_glade_with_plugins (list->labelXML); | 936 | GNUNET_GTK_connect_glade_with_plugins (list->labelXML); |
937 | list->tab_label | 937 | list->tab_label |
938 | = extractMainWidgetFromWindow (list->labelXML, "searchTabLabelWindow"); | 938 | = GNUNET_GTK_extract_main_widget_from_window (list->labelXML, "searchTabLabelWindow"); |
939 | /* process existing results */ | 939 | /* process existing results */ |
940 | for (i = 0; i < resultCount; i++) | 940 | for (i = 0; i < resultCount; i++) |
941 | fs_search_result_received (list, &results[i], uri); | 941 | fs_search_result_received (list, &results[i], uri); |