lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
List overview
Plugins-Commits
November 2017
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
plugins-commits@lists.geany.org
1 participants
34 discussions
Start a n
N
ew thread
[geany/geany-plugins] 9a2ae4: Remove some unused variables and initialize some
by Frank Lanitz
02 Nov '17
02 Nov '17
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: Frank Lanitz <frank(a)frank.uvena.de> Date: Thu, 02 Nov 2017 17:44:36 UTC Commit: 9a2ae4996a2958560d0d274e660676c7d4ea7703
https://github.com/geany/geany-plugins/commit/9a2ae4996a2958560d0d274e66067…
Log Message: ----------- Remove some unused variables and initialize some Modified Paths: -------------- workbench/src/utils.c Modified: workbench/src/utils.c 6 lines changed, 2 insertions(+), 4 deletions(-) =================================================================== @@ -261,9 +261,7 @@ gchar *get_any_relative_path (const gchar *base, const gchar *target) **/ void open_all_files_in_list(GPtrArray *list) { - GeanyData* geany_data = wb_globals.geany_plugin->geany_data; - gboolean is_open; - guint index, doc; + guint index; for (index = 0 ; index < list->len ; index++) { @@ -280,7 +278,7 @@ void open_all_files_in_list(GPtrArray *list) void close_all_files_in_list(GPtrArray *list) { GeanyData* geany_data = wb_globals.geany_plugin->geany_data; - guint index, doc; + guint index, doc=0; for (index = 0 ; index < list->len ; index++) { -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 1f9d0b: Merge pull request #637 from LarsGit223/wb-open-close-all
by Frank Lanitz
02 Nov '17
02 Nov '17
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: GitHub <noreply(a)github.com> Date: Thu, 02 Nov 2017 17:35:22 UTC Commit: 1f9d0b9bea1abad50d8ab2c6e36098a6ffead9af
https://github.com/geany/geany-plugins/commit/1f9d0b9bea1abad50d8ab2c6e3609…
Log Message: ----------- Merge pull request #637 from LarsGit223/wb-open-close-all workbench: Added "open/close all files" feature Modified Paths: -------------- workbench/src/popup_menu.c workbench/src/sidebar.c workbench/src/sidebar.h workbench/src/utils.c workbench/src/utils.h Modified: workbench/src/popup_menu.c 185 lines changed, 185 insertions(+), 0 deletions(-) =================================================================== @@ -31,6 +31,7 @@ #include "dialogs.h" #include "sidebar.h" #include "popup_menu.h" +#include "utils.h" static struct { @@ -40,11 +41,17 @@ static struct GtkWidget *save_project; GtkWidget *remove_project; GtkWidget *fold_unfold_project; + GtkWidget *project_open_all; + GtkWidget *project_close_all; GtkWidget *add_directory; GtkWidget *remove_directory; GtkWidget *rescan_directory; GtkWidget *directory_settings; GtkWidget *fold_unfold_directory; + GtkWidget *directory_open_all; + GtkWidget *directory_close_all; + GtkWidget *folder_open_all; + GtkWidget *folder_close_all; GtkWidget *expand_all; GtkWidget *collapse_all; GtkWidget *add_wb_bookmark; @@ -70,80 +77,134 @@ void popup_menu_show(POPUP_CONTEXT context, GdkEventButton *event) gtk_widget_set_sensitive (s_popup_menu.add_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_project, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_close_all, TRUE); gtk_widget_set_sensitive (s_popup_menu.add_directory, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.rescan_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.directory_settings, FALSE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_directory, FALSE); + gtk_widget_set_sensitive (s_popup_menu.directory_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.directory_close_all, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_wb_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_prj_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.remove_bookmark, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_close_all, FALSE); break; case POPUP_CONTEXT_DIRECTORY: + gtk_widget_set_sensitive (s_popup_menu.add_project, TRUE); + gtk_widget_set_sensitive (s_popup_menu.remove_project, TRUE); + gtk_widget_set_sensitive (s_popup_menu.fold_unfold_project, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_close_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.add_directory, TRUE); + gtk_widget_set_sensitive (s_popup_menu.remove_directory, TRUE); + gtk_widget_set_sensitive (s_popup_menu.rescan_directory, TRUE); + gtk_widget_set_sensitive (s_popup_menu.directory_settings, TRUE); + gtk_widget_set_sensitive (s_popup_menu.fold_unfold_directory, TRUE); + gtk_widget_set_sensitive (s_popup_menu.directory_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.directory_close_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.add_wb_bookmark, FALSE); + gtk_widget_set_sensitive (s_popup_menu.add_prj_bookmark, FALSE); + gtk_widget_set_sensitive (s_popup_menu.remove_bookmark, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_close_all, FALSE); + break; case POPUP_CONTEXT_FOLDER: gtk_widget_set_sensitive (s_popup_menu.add_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_project, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_close_all, TRUE); gtk_widget_set_sensitive (s_popup_menu.add_directory, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_directory, TRUE); gtk_widget_set_sensitive (s_popup_menu.rescan_directory, TRUE); gtk_widget_set_sensitive (s_popup_menu.directory_settings, TRUE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_directory, TRUE); + gtk_widget_set_sensitive (s_popup_menu.directory_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.directory_close_all, TRUE); gtk_widget_set_sensitive (s_popup_menu.add_wb_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_prj_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.remove_bookmark, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.folder_close_all, TRUE); break; case POPUP_CONTEXT_FILE: gtk_widget_set_sensitive (s_popup_menu.add_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_project, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_close_all, TRUE); gtk_widget_set_sensitive (s_popup_menu.add_directory, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_directory, TRUE); gtk_widget_set_sensitive (s_popup_menu.rescan_directory, TRUE); gtk_widget_set_sensitive (s_popup_menu.directory_settings, TRUE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_directory, TRUE); + gtk_widget_set_sensitive (s_popup_menu.directory_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.directory_close_all, TRUE); gtk_widget_set_sensitive (s_popup_menu.add_wb_bookmark, TRUE); gtk_widget_set_sensitive (s_popup_menu.add_prj_bookmark, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_bookmark, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.folder_close_all, TRUE); break; case POPUP_CONTEXT_BACKGROUND: gtk_widget_set_sensitive (s_popup_menu.add_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_project, FALSE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_project, FALSE); + gtk_widget_set_sensitive (s_popup_menu.project_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.project_close_all, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.remove_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.rescan_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.directory_settings, FALSE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_directory, FALSE); + gtk_widget_set_sensitive (s_popup_menu.directory_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.directory_close_all, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_wb_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_prj_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.remove_bookmark, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_close_all, FALSE); break; case POPUP_CONTEXT_WB_BOOKMARK: gtk_widget_set_sensitive (s_popup_menu.add_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_project, FALSE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_project, FALSE); + gtk_widget_set_sensitive (s_popup_menu.project_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.project_close_all, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.remove_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.rescan_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.directory_settings, FALSE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_directory, FALSE); + gtk_widget_set_sensitive (s_popup_menu.directory_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.directory_close_all, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_wb_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_prj_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.remove_bookmark, TRUE); + gtk_widget_set_sensitive (s_popup_menu.folder_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_close_all, FALSE); break; case POPUP_CONTEXT_PRJ_BOOKMARK: gtk_widget_set_sensitive (s_popup_menu.add_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_project, TRUE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_project, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_open_all, TRUE); + gtk_widget_set_sensitive (s_popup_menu.project_close_all, TRUE); gtk_widget_set_sensitive (s_popup_menu.add_directory, TRUE); gtk_widget_set_sensitive (s_popup_menu.remove_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.rescan_directory, FALSE); gtk_widget_set_sensitive (s_popup_menu.directory_settings, FALSE); gtk_widget_set_sensitive (s_popup_menu.fold_unfold_directory, FALSE); + gtk_widget_set_sensitive (s_popup_menu.directory_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.directory_close_all, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_wb_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.add_prj_bookmark, FALSE); gtk_widget_set_sensitive (s_popup_menu.remove_bookmark, TRUE); + gtk_widget_set_sensitive (s_popup_menu.folder_open_all, FALSE); + gtk_widget_set_sensitive (s_popup_menu.folder_close_all, FALSE); break; } gtk_menu_popup(GTK_MENU(s_popup_menu.widget), NULL, NULL, NULL, NULL, @@ -236,6 +297,34 @@ static void popup_menu_on_fold_unfold_project(G_GNUC_UNUSED GtkMenuItem *menuite } +/* Handle popup menu item "Open all files" (project) */ +static void popup_menu_on_project_open_all (G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) +{ + GPtrArray *list; + + list = sidebar_get_selected_project_filelist(); + if (list != NULL) + { + open_all_files_in_list(list); + g_ptr_array_free(list, TRUE); + } +} + + +/* Handle popup menu item "Close all files" (project) */ +static void popup_menu_on_project_close_all (G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) +{ + GPtrArray *list; + + list = sidebar_get_selected_project_filelist(); + if (list != NULL) + { + close_all_files_in_list(list); + g_ptr_array_free(list, TRUE); + } +} + + /* Handle popup menu item "Add directory" */ static void popup_menu_on_add_directory(G_GNUC_UNUSED GtkMenuItem * menuitem, G_GNUC_UNUSED gpointer user_data) { @@ -313,6 +402,34 @@ static void popup_menu_on_fold_unfold_directory(G_GNUC_UNUSED GtkMenuItem *menui } +/* Handle popup menu item "Open all files" (directory) */ +static void popup_menu_on_directory_open_all (G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) +{ + GPtrArray *list; + + list = sidebar_get_selected_directory_filelist(); + if (list != NULL) + { + open_all_files_in_list(list); + g_ptr_array_free(list, TRUE); + } +} + + +/* Handle popup menu item "Close all files" (directory) */ +static void popup_menu_on_directory_close_all (G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) +{ + GPtrArray *list; + + list = sidebar_get_selected_directory_filelist(); + if (list != NULL) + { + close_all_files_in_list(list); + g_ptr_array_free(list, TRUE); + } +} + + /* Handle popup menu item "Add to workbench bookmarks" */ static void popup_menu_on_add_to_workbench_bookmarks(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) { @@ -361,6 +478,34 @@ static void popup_menu_on_remove_from_bookmarks(G_GNUC_UNUSED GtkMenuItem *menui } +/* Handle popup menu item "Open all files" (folder) */ +static void popup_menu_on_folder_open_all (G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) +{ + GPtrArray *list; + + list = sidebar_get_selected_folder_filelist(); + if (list != NULL) + { + open_all_files_in_list(list); + g_ptr_array_free(list, TRUE); + } +} + + +/* Handle popup menu item "Close all files" (folder) */ +static void popup_menu_on_folder_close_all (G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data) +{ + GPtrArray *list; + + list = sidebar_get_selected_folder_filelist(); + if (list != NULL) + { + close_all_files_in_list(list); + g_ptr_array_free(list, TRUE); + } +} + + /** Setup/Initialize the popup menu. * **/ @@ -394,6 +539,18 @@ void popup_menu_init(void) g_signal_connect(item, "activate", G_CALLBACK(popup_menu_on_fold_unfold_project), NULL); s_popup_menu.fold_unfold_project = item; + item = gtk_menu_item_new_with_mnemonic(_("_Open all files in project")); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(s_popup_menu.widget), item); + g_signal_connect(item, "activate", G_CALLBACK(popup_menu_on_project_open_all), NULL); + s_popup_menu.project_open_all = item; + + item = gtk_menu_item_new_with_mnemonic(_("_Close all files in project")); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(s_popup_menu.widget), item); + g_signal_connect(item, "activate", G_CALLBACK(popup_menu_on_project_close_all), NULL); + s_popup_menu.project_close_all = item; + item = gtk_separator_menu_item_new(); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(s_popup_menu.widget), item); @@ -428,6 +585,34 @@ void popup_menu_init(void) g_signal_connect(item, "activate", G_CALLBACK(popup_menu_on_fold_unfold_directory), NULL); s_popup_menu.fold_unfold_directory = item; + item = gtk_menu_item_new_with_mnemonic(_("_Open all files in directory")); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(s_popup_menu.widget), item); + g_signal_connect(item, "activate", G_CALLBACK(popup_menu_on_directory_open_all), NULL); + s_popup_menu.directory_open_all = item; + + item = gtk_menu_item_new_with_mnemonic(_("_Close all files in directory")); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(s_popup_menu.widget), item); + g_signal_connect(item, "activate", G_CALLBACK(popup_menu_on_directory_close_all), NULL); + s_popup_menu.directory_close_all = item; + + item = gtk_separator_menu_item_new(); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(s_popup_menu.widget), item); + + item = gtk_menu_item_new_with_mnemonic(_("_Open all files in folder")); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(s_popup_menu.widget), item); + g_signal_connect(item, "activate", G_CALLBACK(popup_menu_on_folder_open_all), NULL); + s_popup_menu.folder_open_all = item; + + item = gtk_menu_item_new_with_mnemonic(_("_Close all files in folder")); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(s_popup_menu.widget), item); + g_signal_connect(item, "activate", G_CALLBACK(popup_menu_on_folder_close_all), NULL); + s_popup_menu.folder_close_all = item; + item = gtk_separator_menu_item_new(); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(s_popup_menu.widget), item); Modified: workbench/src/sidebar.c 117 lines changed, 117 insertions(+), 0 deletions(-) =================================================================== @@ -831,6 +831,36 @@ WB_PROJECT *sidebar_file_view_get_selected_project(GtkTreePath **path) } +/* Search upwards from the selected row and get the iter of the + closest parent with DATA_ID id. */ +static gboolean sidebar_file_view_get_selected_parent_iter(GtkTreeIter *iter, guint id) +{ + gboolean has_parent; + guint dataid; + GtkTreeSelection *treesel; + GtkTreeModel *model; + GtkTreeIter current, parent; + + treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(sidebar.file_view)); + if (gtk_tree_selection_get_selected(treesel, &model, ¤t)) + { + do + { + gtk_tree_model_get(model, ¤t, FILEVIEW_COLUMN_DATA_ID, &dataid, -1); + if (dataid == id) + { + *iter = current; + return TRUE; + } + has_parent = gtk_tree_model_iter_parent(model, + &parent, ¤t); + current = parent; + }while (has_parent); + } + return FALSE; +} + + /** Get the selected project directory and the path to it. * * Get the selected project directory and return a pointer to it. Also if @a path is not NULL then @@ -948,6 +978,93 @@ gboolean sidebar_file_view_get_selected_context(SIDEBAR_CONTEXT *context) return FALSE; } +/* Collect all filenames recursively starting from iter and add them to list */ +static void sidebar_get_filelist_for_iter(GPtrArray *list, GtkTreeIter iter) +{ + GtkTreeModel *model; + GtkTreeIter childs; + gboolean has_next; + guint dataid; + char *filename; + + model = gtk_tree_view_get_model(GTK_TREE_VIEW(sidebar.file_view)); + do + { + gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_DATA_ID, &dataid, -1); + switch (dataid) + { + case DATA_ID_FILE: + gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_ASSIGNED_DATA_POINTER, &filename, -1); + g_ptr_array_add(list, g_strdup(filename)); + break; + case DATA_ID_DIRECTORY: + case DATA_ID_FOLDER: + if (gtk_tree_model_iter_children(model, &childs, &iter) == TRUE) + { + sidebar_get_filelist_for_iter(list, childs); + } + break; + } + has_next = gtk_tree_model_iter_next(model, &iter); + } + while (has_next); +} + + +/* Get the lkist of files belonging to the current selection for + id (id = project, directory, folder) */ +static GPtrArray *sidebar_get_selected_filelist (guint id) +{ + GtkTreeModel *model; + GPtrArray *list; + GtkTreeIter iter, childs; + + if (sidebar_file_view_get_selected_parent_iter(&iter, id)) + { + list = g_ptr_array_new_full(1, g_free); + model = gtk_tree_view_get_model(GTK_TREE_VIEW(sidebar.file_view)); + if (gtk_tree_model_iter_children(model, &childs, &iter) == TRUE) + { + sidebar_get_filelist_for_iter(list, childs); + } + return list; + } + + return NULL; +} + + +/** Get the list of files corresponding to the selected project. + * + * @return GPtrArray containing file names or NULL. + * + **/ +GPtrArray *sidebar_get_selected_project_filelist (void) +{ + return sidebar_get_selected_filelist(DATA_ID_PROJECT); +} + + +/** Get the list of files corresponding to the selected directory. + * + * @return GPtrArray containing file names or NULL. + * + **/ +GPtrArray *sidebar_get_selected_directory_filelist (void) +{ + return sidebar_get_selected_filelist(DATA_ID_DIRECTORY); +} + + +/** Get the list of files corresponding to the selected folder. + * + * @return GPtrArray containing file names or NULL. + * + **/ +GPtrArray *sidebar_get_selected_folder_filelist (void) +{ + return sidebar_get_selected_filelist(DATA_ID_FOLDER); +} /** Setup the sidebar. * Modified: workbench/src/sidebar.h 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -72,4 +72,8 @@ void sidebar_toggle_selected_project_dir_expansion (void); WB_PROJECT *sidebar_file_view_get_selected_project(GtkTreePath **path); gboolean sidebar_file_view_get_selected_context(SIDEBAR_CONTEXT *context); +GPtrArray *sidebar_get_selected_project_filelist (void); +GPtrArray *sidebar_get_selected_directory_filelist (void); +GPtrArray *sidebar_get_selected_folder_filelist (void); + #endif Modified: workbench/src/utils.c 43 lines changed, 43 insertions(+), 0 deletions(-) =================================================================== @@ -26,6 +26,7 @@ #include <glib.h> #include <glib/gstdio.h> #include <geanyplugin.h> +#include "wb_globals.h" #include "utils.h" /** Get the relative path. @@ -251,3 +252,45 @@ gchar *get_any_relative_path (const gchar *base, const gchar *target) return result; } + + +/** Open all files in list. + * + * @param list GPtrArray containing file names. + * + **/ +void open_all_files_in_list(GPtrArray *list) +{ + GeanyData* geany_data = wb_globals.geany_plugin->geany_data; + gboolean is_open; + guint index, doc; + + for (index = 0 ; index < list->len ; index++) + { + document_open_file(list->pdata[index], FALSE, NULL, NULL); + } +} + + +/** Close all files in list. + * + * @param list GPtrArray containing file names. + * + **/ +void close_all_files_in_list(GPtrArray *list) +{ + GeanyData* geany_data = wb_globals.geany_plugin->geany_data; + guint index, doc; + + for (index = 0 ; index < list->len ; index++) + { + foreach_document(doc) + { + if (g_strcmp0(list->pdata[index], documents[doc]->file_name) == 0) + { + document_close(documents[doc]); + break; + } + } + } +} Modified: workbench/src/utils.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -26,5 +26,7 @@ gboolean patterns_match(GSList *patterns, const gchar *str); GSList *get_precompiled_patterns(gchar **patterns); gchar *get_combined_path(const gchar *base, const gchar *relative); gchar *get_any_relative_path (const gchar *base, const gchar *target); +void open_all_files_in_list(GPtrArray *list); +void close_all_files_in_list(GPtrArray *list); #endif -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 3b17e5: Merge pull request #639 from eht16/issue638_addons_fix_initialization
by Frank Lanitz
01 Nov '17
01 Nov '17
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: GitHub <noreply(a)github.com> Date: Wed, 01 Nov 2017 18:29:29 UTC Commit: 3b17e53f7eab4e95f816b724d9c1189e86aa35c6
https://github.com/geany/geany-plugins/commit/3b17e53f7eab4e95f816b724d9c11…
Log Message: ----------- Merge pull request #639 from eht16/issue638_addons_fix_initialization Connect button-press signal handlers on plugin activation Modified Paths: -------------- addons/src/ao_markword.c Modified: addons/src/ao_markword.c 40 lines changed, 32 insertions(+), 8 deletions(-) =================================================================== @@ -65,6 +65,7 @@ enum static void ao_mark_word_finalize (GObject *object); +static void connect_documents_button_press_signal_handler(AoMarkWord *mw); G_DEFINE_TYPE(AoMarkWord, ao_mark_word, G_TYPE_OBJECT) @@ -78,6 +79,13 @@ static void ao_mark_word_set_property(GObject *object, guint prop_id, { case PROP_ENABLE_MARKWORD: priv->enable_markword = g_value_get_boolean(value); + /* if the plugin is loaded while Geany is already running, we need to connect the + * button press signal for open documents, if Geany is just booting, + * it happens automatically */ + if (priv->enable_markword && main_is_realized()) + { + connect_documents_button_press_signal_handler(AO_MARKWORD(object)); + } break; case PROP_ENABLE_MARKWORD_SINGLE_CLICK_DESELECT: priv->enable_single_click_deselect = g_value_get_boolean(value); @@ -197,14 +205,7 @@ void ao_mark_editor_notify(AoMarkWord *mw, GeanyEditor *editor, SCNotification * } -void ao_mark_document_new(AoMarkWord *mw, GeanyDocument *document) -{ - /* there is nothing different to handling open documents, so do the same */ - ao_mark_document_open(mw, document); -} - - -void ao_mark_document_open(AoMarkWord *mw, GeanyDocument *document) +static void connect_document_button_press_signal_handler(AoMarkWord *mw, GeanyDocument *document) { g_return_if_fail(DOC_VALID(document)); @@ -218,6 +219,29 @@ void ao_mark_document_open(AoMarkWord *mw, GeanyDocument *document) } +static void connect_documents_button_press_signal_handler(AoMarkWord *mw) +{ + guint i = 0; + /* connect the button-press event for all open documents */ + foreach_document(i) + { + connect_document_button_press_signal_handler(mw, documents[i]); + } +} + + +void ao_mark_document_new(AoMarkWord *mw, GeanyDocument *document) +{ + connect_document_button_press_signal_handler(mw, document); +} + + +void ao_mark_document_open(AoMarkWord *mw, GeanyDocument *document) +{ + connect_document_button_press_signal_handler(mw, document); +} + + void ao_mark_document_close(AoMarkWord *mw, GeanyDocument *document) { g_return_if_fail(DOC_VALID(document)); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 60d40f: Merge pull request #642 from medovina/fix-create
by Frank Lanitz
01 Nov '17
01 Nov '17
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: GitHub <noreply(a)github.com> Date: Wed, 01 Nov 2017 11:58:02 UTC Commit: 60d40f941d3860077200a63bdffb3835026c6b14
https://github.com/geany/geany-plugins/commit/60d40f941d3860077200a63bdffb3…
Log Message: ----------- Merge pull request #642 from medovina/fix-create treebrowser: rename Create New File to New File Modified Paths: -------------- treebrowser/src/treebrowser.c Modified: treebrowser/src/treebrowser.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -1240,11 +1240,11 @@ create_popup_menu(const gchar *name, const gchar *uri) item = gtk_separator_menu_item_new(); gtk_container_add(GTK_CONTAINER(menu), item); - item = ui_image_menu_item_new(GTK_STOCK_ADD, _("Creat_e New Directory")); + item = ui_image_menu_item_new(GTK_STOCK_ADD, _("N_ew Folder")); gtk_container_add(GTK_CONTAINER(menu), item); g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), (gpointer)"directory"); - item = ui_image_menu_item_new(GTK_STOCK_NEW, _("Create _New File")); + item = ui_image_menu_item_new(GTK_STOCK_NEW, _("_New File")); gtk_container_add(GTK_CONTAINER(menu), item); g_signal_connect(item, "activate", G_CALLBACK(on_menu_create_new_object), (gpointer)"file"); @@ -2140,9 +2140,9 @@ plugin_init(GeanyData *data) keybindings_set_item(key_group, KB_RENAME_OBJECT, kb_activate, 0, 0, "rename_object", _("Rename Object"), NULL); keybindings_set_item(key_group, KB_CREATE_FILE, kb_activate, - 0, 0, "create_file", _("Create New File"), NULL); + 0, 0, "create_file", _("New File"), NULL); keybindings_set_item(key_group, KB_CREATE_DIR, kb_activate, - 0, 0, "create_dir", _("Create New Directory"), NULL); + 0, 0, "create_dir", _("New Folder"), NULL); keybindings_set_item(key_group, KB_REFRESH, kb_activate, 0, 0, "rename_refresh", _("Refresh"), NULL); keybindings_set_item(key_group, KB_TRACK_CURRENT, kb_activate, -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
2
3
4
Older →
Jump to page:
1
2
3
4
Results per page:
10
25
50
100
200