Open a new, empty file when closing a project and no session files are available or when opening a project without stored session files.
Close all open files when opening projects. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2200 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
667126d7f6
commit
b858a3e3e1
@ -1,3 +1,11 @@
|
||||
2008-01-31 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
|
||||
* src/project.c:
|
||||
Open a new, empty file when closing a project and no session files
|
||||
are available or when opening a project without stored session files.
|
||||
Close all open files when opening projects.
|
||||
|
||||
|
||||
2008-01-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
||||
* src/search.c:
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
#include "build.h"
|
||||
#include "document.h"
|
||||
#include "geanyobject.h"
|
||||
#include "callbacks.h"
|
||||
|
||||
|
||||
ProjectPrefs project_prefs = { NULL, 0 };
|
||||
@ -213,7 +214,13 @@ static void run_open_dialog(GtkDialog *dialog)
|
||||
}
|
||||
g_free(filename);
|
||||
if (project_prefs.project_session)
|
||||
{
|
||||
configuration_open_files();
|
||||
// open a new file if no other file was opened
|
||||
/// TODO refactor the following into a function to be used here and in main()
|
||||
if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) == 0)
|
||||
document_new_file(NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -241,7 +248,12 @@ void project_open()
|
||||
SHOW_ERR1(_("Project file \"%s\" could not be loaded."), file);
|
||||
}
|
||||
if (project_prefs.project_session)
|
||||
{
|
||||
configuration_open_files();
|
||||
// open a new file if no other file was opened
|
||||
if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) == 0)
|
||||
document_new_file(NULL, NULL, NULL);
|
||||
}
|
||||
g_free(file);
|
||||
}
|
||||
#else
|
||||
@ -328,6 +340,9 @@ void project_close(gboolean open_default)
|
||||
{
|
||||
configuration_reload_default_session();
|
||||
configuration_open_files();
|
||||
// open a new file if no other file was opened
|
||||
if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) == 0)
|
||||
document_new_file(NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -893,6 +908,10 @@ static gboolean load_config(const gchar *filename)
|
||||
{
|
||||
// save current (non-project) session (it could has been changed since program startup)
|
||||
configuration_save_default_session();
|
||||
// now close all open files
|
||||
/// TODO make this a general, non-callback function, use it also in project_close()
|
||||
/// and remove include of callbacks.h
|
||||
on_close_all1_activate(NULL, NULL);
|
||||
// read session files so they can be opened with configuration_open_files()
|
||||
configuration_load_session_files(config);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user