Revision: 1002 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1002&view=re... Author: ntrel Date: 2009-10-13 17:32:58 +0000 (Tue, 13 Oct 2009)
Log Message: ----------- Use ui_menu_add_document_items().
Modified Paths: -------------- trunk/geany-plugins/addons/ChangeLog trunk/geany-plugins/addons/src/addons.c trunk/geany-plugins/addons/src/ao_doclist.c
Modified: trunk/geany-plugins/addons/ChangeLog =================================================================== --- trunk/geany-plugins/addons/ChangeLog 2009-10-12 21:25:59 UTC (rev 1001) +++ trunk/geany-plugins/addons/ChangeLog 2009-10-13 17:32:58 UTC (rev 1002) @@ -1,3 +1,9 @@ +2009-10-13 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/ao_doclist.c, src/addons.c: + Use ui_menu_add_document_items(). + + 2009-07-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/tasks.c:
Modified: trunk/geany-plugins/addons/src/addons.c =================================================================== --- trunk/geany-plugins/addons/src/addons.c 2009-10-12 21:25:59 UTC (rev 1001) +++ trunk/geany-plugins/addons/src/addons.c 2009-10-13 17:32:58 UTC (rev 1002) @@ -36,7 +36,7 @@ GeanyFunctions *geany_functions;
-PLUGIN_VERSION_CHECK(147) +PLUGIN_VERSION_CHECK(160) PLUGIN_SET_INFO(_("Addons"), _("Various small addons for Geany."), VERSION, "Enrico Tröger, Bert Vermeulen")
Modified: trunk/geany-plugins/addons/src/ao_doclist.c =================================================================== --- trunk/geany-plugins/addons/src/ao_doclist.c 2009-10-12 21:25:59 UTC (rev 1001) +++ trunk/geany-plugins/addons/src/ao_doclist.c 2009-10-13 17:32:58 UTC (rev 1002) @@ -167,11 +167,6 @@ { static GtkWidget *menu = NULL; GtkWidget *menu_item; - GtkWidget *menu_item_label; - guint i; - gchar *base_name; - const GdkColor *color; - GeanyDocument *doc; GeanyDocument *current_doc = document_get_current();
if (menu != NULL) @@ -179,29 +174,9 @@
menu = gtk_menu_new();
- for (i = 0; i < geany->documents_array->len; i++) - { - doc = document_index(i); - if (! DOC_VALID(doc)) - continue; + ui_menu_add_document_items(GTK_MENU(menu), current_doc, + G_CALLBACK(ao_doclist_menu_item_activate_cb));
- base_name = g_path_get_basename(DOC_FILENAME(doc)); - menu_item = gtk_menu_item_new_with_label(base_name); - gtk_widget_show(menu_item); - gtk_container_add(GTK_CONTAINER(menu), menu_item); - g_signal_connect(menu_item, "activate", G_CALLBACK(ao_doclist_menu_item_activate_cb), doc); - - color = document_get_status_color(doc); - menu_item_label = gtk_bin_get_child(GTK_BIN(menu_item)); - gtk_widget_modify_fg(menu_item_label, GTK_STATE_NORMAL, color); - gtk_widget_modify_fg(menu_item_label, GTK_STATE_ACTIVE, color); - if (doc == current_doc) - { - setptr(base_name, g_strconcat("<b>", base_name, "</b>", NULL)); - gtk_label_set_markup(GTK_LABEL(menu_item_label), base_name); - } - g_free(base_name); - } menu_item = gtk_separator_menu_item_new(); gtk_widget_show(menu_item); gtk_container_add(GTK_CONTAINER(menu), menu_item);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.