Kaydet (Commit) 9602b91e authored tarafından Enrico Tröger's avatar Enrico Tröger

Ignore notebook_switch_page signal handler when closing projects to speed it up…

Ignore notebook_switch_page signal handler when closing projects to speed it up a little bit with many session files.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2437 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 8d497729
......@@ -3,6 +3,9 @@
* src/dialogs.c:
Fix GTK warnings in open file dialog by using a positive response ID
for the View button.
* src/callbacks.c, src/main.h, src/project.c:
Ignore notebook_switch_page signal handler when closing projects
to speed it up a little bit with many session files.
2008-04-01 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
......
......@@ -75,9 +75,6 @@
#endif
/* represents the state while closing all tabs(used to prevent notebook switch page signals) */
static gboolean closing_all = FALSE;
/* flag to indicate the explicit change of a toggle button of the toolbar menu and so the
* toggled callback should ignore the change since it is not triggered by the user */
static gboolean ignore_toolbar_toggle = FALSE;
......@@ -263,7 +260,7 @@ on_close_all1_activate (GtkMenuItem *menuitem,
gboolean ret = TRUE;
gint i, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook));
closing_all = TRUE;
main_status.closing_all = TRUE;
for(i = 0; i < max; i++)
{
if (! document_remove(0))
......@@ -272,7 +269,7 @@ on_close_all1_activate (GtkMenuItem *menuitem,
break;
}
}
closing_all = FALSE;
main_status.closing_all = FALSE;
tm_workspace_update(TM_WORK_OBJECT(app->tm_workspace), TRUE, TRUE, FALSE);
/* if cancel is clicked, cancel the complete exit process */
return ret;
......@@ -782,7 +779,8 @@ on_notebook1_switch_page_after (GtkNotebook *notebook,
{
gint idx;
if (closing_all) return;
if (main_status.opening_session_files || main_status.closing_all)
return;
/* guint == -1 seems useless, but it isn't! */
if (page_num == (guint) -1 && page != NULL)
......@@ -790,7 +788,7 @@ on_notebook1_switch_page_after (GtkNotebook *notebook,
else
idx = document_get_n_idx(page_num);
if (idx >= 0 && main_status.opening_session_files == FALSE)
if (idx >= 0)
{
treeviews_select_openfiles_item(idx);
document_set_text_changed(idx); /* also sets window title and status bar */
......
......@@ -39,6 +39,8 @@ extern CommandLineOptions cl_options;
typedef struct GeanyStatus
{
gboolean opening_session_files; /* state at startup while opening session files */
gboolean closing_all; /* the state while closing all tabs
* (used to prevent notebook switch page signals) */
gboolean quitting; /* state when Geany is quitting completely */
gboolean main_window_realized;
}
......
......@@ -329,11 +329,13 @@ void project_close(gboolean open_default)
if (project_prefs.project_session)
{
/* close all existing tabs first */
main_status.closing_all = TRUE;
for (i = 0; i < max; i++)
{
if (! document_remove(0))
break;
}
main_status.closing_all = FALSE;
/* after closing all tabs let's open the tabs found in the default config */
if (open_default == TRUE && cl_options.load_session)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment