Revision: 1226 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1226&view=re... Author: dimitrov-adrian Date: 2010-04-10 16:41:30 +0000 (Sat, 10 Apr 2010)
Log Message: ----------- Treebrowser, added option to close document if it is deleted from treebrowser
Modified Paths: -------------- trunk/geany-plugins/treebrowser/ChangeLog trunk/geany-plugins/treebrowser/src/treebrowser.c
Modified: trunk/geany-plugins/treebrowser/ChangeLog =================================================================== --- trunk/geany-plugins/treebrowser/ChangeLog 2010-04-10 16:28:08 UTC (rev 1225) +++ trunk/geany-plugins/treebrowser/ChangeLog 2010-04-10 16:41:30 UTC (rev 1226) @@ -25,6 +25,7 @@ * src/treebrowser.c fixed wrong root refresh on delete and create when objects are in toplevel some string changed in prefs dialog + added option to close document if it is deleted from treebrowser
31-03-2010 Adrian Dimitrov dimitrov.adrian@gmail.com
Modified: trunk/geany-plugins/treebrowser/src/treebrowser.c =================================================================== --- trunk/geany-plugins/treebrowser/src/treebrowser.c 2010-04-10 16:28:08 UTC (rev 1225) +++ trunk/geany-plugins/treebrowser/src/treebrowser.c 2010-04-10 16:41:30 UTC (rev 1226) @@ -49,6 +49,7 @@ static gboolean CONFIG_CHROOT_ON_DCLICK = FALSE; static gboolean CONFIG_FOLLOW_CURRENT_DOC = TRUE; static gboolean CONFIG_ON_EXPAND_REFRESH = FALSE; +static gboolean CONFIG_ON_DELETE_CLOSE_FILE = TRUE;
/* ------------------ @@ -555,6 +556,9 @@
if (dialogs_show_question(_("Do you really want to delete '%s' ?"), uri)) { + if (CONFIG_ON_DELETE_CLOSE_FILE && ! g_file_test(uri, G_FILE_TEST_IS_DIR)) + document_close(document_find_by_filename(uri)); + fs_remove(uri, TRUE); path_parent = gtk_tree_model_get_path(GTK_TREE_MODEL(treestore), &iter);
@@ -950,7 +954,6 @@ ui_widget_set_tooltip_text(addressbar, _("Addressbar (/projects/my-project"));
- gtk_box_pack_start(GTK_BOX(sidebar_vbox), scrollwin, TRUE, TRUE, 1); gtk_box_pack_start(GTK_BOX(sidebar_vbox), sidebar_vbox_bars, FALSE, TRUE, 1);
@@ -1014,6 +1017,7 @@ GtkWidget *CHROOT_ON_DCLICK; GtkWidget *FOLLOW_CURRENT_DOC; GtkWidget *ON_EXPAND_REFRESH; + GtkWidget *ON_DELETE_CLOSE_FILE;
} configure_widgets;
@@ -1033,6 +1037,7 @@ CONFIG_CHROOT_ON_DCLICK = utils_get_setting_boolean(config, "treebrowser", "chroot_on_dclick", CONFIG_CHROOT_ON_DCLICK); CONFIG_FOLLOW_CURRENT_DOC = utils_get_setting_boolean(config, "treebrowser", "follow_current_doc", CONFIG_FOLLOW_CURRENT_DOC); CONFIG_ON_EXPAND_REFRESH = utils_get_setting_boolean(config, "treebrowser", "on_expand_refresh", CONFIG_ON_EXPAND_REFRESH); + CONFIG_ON_DELETE_CLOSE_FILE = utils_get_setting_boolean(config, "treebrowser", "on_delete_close_file", CONFIG_ON_DELETE_CLOSE_FILE);
g_key_file_free(config); } @@ -1057,6 +1062,7 @@ g_key_file_set_boolean(config, "treebrowser", "chroot_on_dclick", CONFIG_CHROOT_ON_DCLICK); g_key_file_set_boolean(config, "treebrowser", "follow_current_doc", CONFIG_FOLLOW_CURRENT_DOC); g_key_file_set_boolean(config, "treebrowser", "on_expand_refresh", CONFIG_ON_EXPAND_REFRESH); + g_key_file_set_boolean(config, "treebrowser", "on_delete_close_file", CONFIG_ON_DELETE_CLOSE_FILE);
data = g_key_file_to_data(config, NULL, NULL); utils_write_file(CONFIG_FILE, data); @@ -1080,6 +1086,7 @@ CONFIG_CHROOT_ON_DCLICK = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(configure_widgets.CHROOT_ON_DCLICK)); CONFIG_FOLLOW_CURRENT_DOC = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(configure_widgets.FOLLOW_CURRENT_DOC)); CONFIG_ON_EXPAND_REFRESH = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(configure_widgets.ON_EXPAND_REFRESH)); + CONFIG_ON_DELETE_CLOSE_FILE = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(configure_widgets.ON_DELETE_CLOSE_FILE));
if (save_settings() == TRUE) treebrowser_chroot(addressbar_last_address); @@ -1152,6 +1159,11 @@ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(configure_widgets.ON_EXPAND_REFRESH), CONFIG_ON_EXPAND_REFRESH); gtk_box_pack_start(GTK_BOX(vbox), configure_widgets.ON_EXPAND_REFRESH, FALSE, FALSE, 0);
+ configure_widgets.ON_DELETE_CLOSE_FILE = gtk_check_button_new_with_label(_("On delete file, close if it is opened")); + gtk_button_set_focus_on_click(GTK_BUTTON(configure_widgets.ON_DELETE_CLOSE_FILE), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(configure_widgets.ON_DELETE_CLOSE_FILE), CONFIG_ON_DELETE_CLOSE_FILE); + gtk_box_pack_start(GTK_BOX(vbox), configure_widgets.ON_DELETE_CLOSE_FILE, FALSE, FALSE, 0); + gtk_widget_show_all(vbox);
g_signal_connect(dialog, "response", G_CALLBACK(on_configure_response), NULL);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.