Revision: 370 Author: eht16 Date: 2006-05-28 15:14:17 -0700 (Sun, 28 May 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=370&view=rev
Log Message: ----------- made recent files menu item insensitive when the list is empty
Modified Paths: -------------- trunk/ChangeLog trunk/src/dialogs.c trunk/src/utils.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-05-26 17:27:25 UTC (rev 369) +++ trunk/ChangeLog 2006-05-28 22:14:17 UTC (rev 370) @@ -1,3 +1,11 @@ +2006-05-28 Enrico Troeger enrico.troeger@uvena.de + + * configure.in, po/po.po: added Polish translation contributed by + Jacek Wolszczak + * src/dialogs.c, src/utils.c: made recent files menu item insensitive + when the list is empty + + 2006-05-26 Nick Treleaven nick.treleaven@btinternet.com
* src/interface.c, src/callbacks.c, src/callbacks.h, geany.glade:
Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2006-05-26 17:27:25 UTC (rev 369) +++ trunk/src/dialogs.c 2006-05-28 22:14:17 UTC (rev 370) @@ -726,6 +726,12 @@ gint i; gchar *filename;
+ if (g_queue_get_length(app->recent_queue) == 0) + { + gtk_widget_set_sensitive(lookup_widget(app->window, "recent_files1"), FALSE); + return; + } + for (i = (MIN(app->mru_length, g_queue_get_length(app->recent_queue)) - 1); i >= 0; i--) { filename = g_queue_peek_nth(app->recent_queue, i);
Modified: trunk/src/utils.c =================================================================== --- trunk/src/utils.c 2006-05-26 17:27:25 UTC (rev 369) +++ trunk/src/utils.c 2006-05-28 22:14:17 UTC (rev 370) @@ -1856,10 +1856,21 @@ void utils_update_recent_menu(void) { GtkWidget *recent_menu = lookup_widget(app->window, "recent_files1_menu"); + GtkWidget *recent_files_item = lookup_widget(app->window, "recent_files1"); GtkWidget *tmp; gchar *filename; GList *children = gtk_container_get_children(GTK_CONTAINER(recent_menu));
+ if (g_queue_get_length(app->recent_queue) == 0) + { + gtk_widget_set_sensitive(recent_files_item, FALSE); + return; + } + else if (! GTK_WIDGET_SENSITIVE(recent_files_item)) + { + gtk_widget_set_sensitive(recent_files_item, TRUE); + } + // clean the MRU list if (g_list_length(children) > app->mru_length) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.