From 58243ee3021010512427bfc6ddf4be0ec23692e3 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Wed, 24 Oct 2007 11:15:00 +0000 Subject: [PATCH] Add 'Show hidden files' checkbox in the popup menu. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1973 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 2 ++ plugins/filebrowser.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index e72a4127..d02ab9ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ Use the current directory when there are no documents open. Add popup menu with Open command. Separate toolbar code from init(). + * plugins/filebrowser.c: + Add 'Show hidden files' checkbox in the popup menu. 2007-10-23 Nick Treleaven diff --git a/plugins/filebrowser.c b/plugins/filebrowser.c index 1e7d6181..61220330 100644 --- a/plugins/filebrowser.c +++ b/plugins/filebrowser.c @@ -271,6 +271,13 @@ static void open_selected_files() } +static void on_hidden_files_clicked(GtkCheckMenuItem *item) +{ + show_hidden_files = gtk_check_menu_item_get_active(item); + refresh(); +} + + static GtkWidget *create_popup_menu() { GtkWidget *item, *menu; @@ -287,6 +294,16 @@ static GtkWidget *create_popup_menu() gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); + item = gtk_check_menu_item_new_with_mnemonic(_("Show _hidden files")); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(menu), item); + g_signal_connect((gpointer) item, "activate", + G_CALLBACK(on_hidden_files_clicked), NULL); + + item = gtk_separator_menu_item_new(); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(menu), item); + item = gtk_image_menu_item_new_with_mnemonic(_("H_ide sidebar")); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), gtk_image_new_from_stock("gtk-close", GTK_ICON_SIZE_MENU));