Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: Frank Lanitz frank@frank.uvena.de Date: Sun, 18 Aug 2013 17:18:45 UTC Commit: b9f7bb1229927adee470b7a1d050fa2c009008b7 https://github.com/geany/geany-plugins/commit/b9f7bb1229927adee470b7a1d050fa...
Log Message: ----------- Treeviewer: Adding a way to open new created files
Modified Paths: -------------- treebrowser/src/treebrowser.c
Modified: treebrowser/src/treebrowser.c 13 files changed, 12 insertions(+), 1 deletions(-) =================================================================== @@ -76,6 +76,7 @@ static gboolean CONFIG_SHOW_TREE_LINES = TRUE; static gboolean CONFIG_SHOW_BOOKMARKS = FALSE; static gint CONFIG_SHOW_ICONS = 2; +static gboolean CONFIG_OPEN_NEW_FILES = TRUE;
/* ------------------ * TREEVIEW STRUCT @@ -1066,6 +1067,8 @@ enum treebrowser_browse(uri, refresh_root ? NULL : &iter); if (treebrowser_search(uri_new, NULL)) treebrowser_rename_current(); + if (utils_str_equal(type, "file") && CONFIG_OPEN_NEW_FILES == TRUE) + document_open_file(uri_new,FALSE, NULL,NULL); } } g_free(uri_new); @@ -1784,7 +1787,7 @@ enum GtkWidget *SHOW_TREE_LINES; GtkWidget *SHOW_BOOKMARKS; GtkWidget *SHOW_ICONS; - + GtkWidget *OPEN_NEW_FILES; } configure_widgets;
static void @@ -1806,6 +1809,7 @@ enum CONFIG_SHOW_TREE_LINES = utils_get_setting_boolean(config, "treebrowser", "show_tree_lines", CONFIG_SHOW_TREE_LINES); CONFIG_SHOW_BOOKMARKS = utils_get_setting_boolean(config, "treebrowser", "show_bookmarks", CONFIG_SHOW_BOOKMARKS); CONFIG_SHOW_ICONS = utils_get_setting_integer(config, "treebrowser", "show_icons", CONFIG_SHOW_ICONS); + CONFIG_OPEN_NEW_FILES = utils_get_setting_boolean(config, "treebrowser", "open_new_files", CONFIG_OPEN_NEW_FILES);
g_key_file_free(config); } @@ -1837,6 +1841,7 @@ enum g_key_file_set_boolean(config, "treebrowser", "show_tree_lines", CONFIG_SHOW_TREE_LINES); g_key_file_set_boolean(config, "treebrowser", "show_bookmarks", CONFIG_SHOW_BOOKMARKS); g_key_file_set_integer(config, "treebrowser", "show_icons", CONFIG_SHOW_ICONS); + g_key_file_set_boolean(config, "treebrowser", "open_new_file", CONFIG_OPEN_NEW_FILES);
data = g_key_file_to_data(config, NULL, NULL); utils_write_file(CONFIG_FILE, data); @@ -1867,6 +1872,7 @@ enum CONFIG_SHOW_TREE_LINES = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(configure_widgets.SHOW_TREE_LINES)); CONFIG_SHOW_BOOKMARKS = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(configure_widgets.SHOW_BOOKMARKS)); CONFIG_SHOW_ICONS = gtk_combo_box_get_active(GTK_COMBO_BOX(configure_widgets.SHOW_ICONS)); + CONFIG_OPEN_NEW_FILES = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(configure_widgets.OPEN_NEW_FILES));
if (save_settings() == TRUE) { @@ -1978,6 +1984,11 @@ enum gtk_button_set_focus_on_click(GTK_BUTTON(configure_widgets.SHOW_BOOKMARKS), FALSE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(configure_widgets.SHOW_BOOKMARKS), CONFIG_SHOW_BOOKMARKS); gtk_box_pack_start(GTK_BOX(vbox), configure_widgets.SHOW_BOOKMARKS, FALSE, FALSE, 0); + + configure_widgets.OPEN_NEW_FILES = gtk_check_button_new_with_label(_("Open new files")); + gtk_button_set_focus_on_click(GTK_BUTTON(configure_widgets.OPEN_NEW_FILES ), FALSE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(configure_widgets.OPEN_NEW_FILES ), CONFIG_OPEN_NEW_FILES); + gtk_box_pack_start(GTK_BOX(vbox), configure_widgets.OPEN_NEW_FILES , FALSE, FALSE, 0);
gtk_widget_show_all(vbox);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).