Branch: refs/heads/master
Author: Nick Treleaven <nick.treleaven(a)btinternet.com>
Committer: Nick Treleaven <nick.treleaven(a)btinternet.com>
Date: Wed, 27 Aug 2014 15:10:57 UTC
Commit: 5964d2e086d60005fd677e9c107729a78ecd37bf
https://github.com/geany/geany/commit/5964d2e086d60005fd677e9c107729a78ecd3…
Log Message:
-----------
Properly close abandoned new project that couldn't be written
Also rewrite the default session in case it was cleared.
Modified Paths:
--------------
src/project.c
Modified: src/project.c
22 lines changed, 18 insertions(+), 4 deletions(-)
===================================================================
@@ -89,6 +89,7 @@ static void on_entries_changed(GtkEditable *editable, PropertyDialogElements *e)
static void on_radio_long_line_custom_toggled(GtkToggleButton *radio, GtkWidget *spin_long_line);
static void apply_editor_prefs(void);
static void init_stash_prefs(void);
+static void destroy_project(gboolean open_default);
#define SHOW_ERR(args) dialogs_show_msgbox(GTK_MESSAGE_ERROR, args)
@@ -229,20 +230,26 @@ void project_new(void)
{
if (gtk_dialog_run(GTK_DIALOG(e.dialog)) != GTK_RESPONSE_OK)
{
- // reload any documents that were closed
- if (!app->project && !have_session_docs())
+ // any open docs were meant to be moved into the project
+ // rewrite default session because it was cleared
+ if (have_session_docs())
+ configuration_save_default_session();
+ else
{
+ // reload any documents that were closed
configuration_reload_default_session();
configuration_open_files();
}
break;
}
+ // dialog confirmed
if (update_config(&e, TRUE))
{
// app->project is now set
if (!write_config(TRUE))
{
SHOW_ERR(_("Project file could not be written"));
+ destroy_project(FALSE);
}
else
{
@@ -393,8 +400,6 @@ static void remove_foreach_project_filetype(gpointer data, gpointer user_data)
/* open_default will make function reload default session files on close */
void project_close(gboolean open_default)
{
- GSList *node;
-
g_return_if_fail(app->project != NULL);
/* save project session files, etc */
@@ -408,6 +413,15 @@ void project_close(gboolean open_default)
return;
}
ui_set_statusbar(TRUE, _("Project \"%s\" closed."), app->project->name);
+ destroy_project(open_default);
+}
+
+
+static void destroy_project(gboolean open_default)
+{
+ GSList *node;
+
+ g_return_if_fail(app->project != NULL);
/* remove project filetypes build entries */
if (app->project->priv->build_filetypes_list != NULL)
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Frank Lanitz <frank(a)frank.uvena.de>
Committer: Frank Lanitz <frank(a)frank.uvena.de>
Date: Mon, 25 Aug 2014 11:31:12 UTC
Commit: 132b93c591f79907f16360e133a43886f7bba1c2
https://github.com/geany/geany/commit/132b93c591f79907f16360e133a43886f7bba…
Log Message:
-----------
SQL: Adding print to list of keywords
e.g. used to 'print' debug output to log on e.g. Sybase ASA
Modified Paths:
--------------
data/filetypes.sql
Modified: data/filetypes.sql
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -22,7 +22,7 @@ quotedidentifier=identifier_2
[keywords]
# all items must be in one line
-keywords=absolute action add admin after aggregate alias all allocate alter and any are array as asc assertion at authorization auto_increment before begin bfile bigint binary bit blob bool boolean both breadth by call cascade cascaded case cast catalog char charset character check class client clob close cluster collate collation column comment commit completion connect connection constraint constraints constructor continue corresponding create cross cube current current_date current_path current_role current_time current_timestamp current_user cursor cycle data date day deallocate dec decimal declare default deferrable deferred delete depth deref desc describe descriptor destroy destructor deterministic diagnostics dictionary dimension disconnect diskgroup distinct domain double drop dynamic each else elsif end end-exec engine equals escape every except exception exec execute exists explain external false fetch first fixed flashback float for foreign found from free full function general get global go goto grant group grouping having hold host hour identity if ignore immediate in index indextype indicator initialize initially inner inout input insert int integer intersect interval into is isolation iterate join key language large last lateral leading left less level like limit local localtime localtimestamp locator log long loop map match materialized mediumblob mediumint mediumtext merge message middleint minus minute modifies modify module month names national natural nchar nclob new next no noaudit none not null numeric nvarchar2 object of off old on only open operation option or order ordinality out outer output owner package pad parameter parameters partial path postfix precision prefix preorder prepare preserve primary prior privileges procedure profile public purge raise read reads real recursive ref references referencing regexp regexp_like relative rename replace restrict result return returning returns revoke right role rollback rollup routine row rows savepoint schema scroll scope search second section select sequence session session_user serial set sets size smallint some space specific specifictype sql sqlexception sqlstate sqlwarning start state statement static structure synonym system_user table tablespace temporary terminate text than then time timestamp timezone_hour timezone_minute tinyint to trailing transaction translation treat trigger true truncate type under union unique uniqueidentifier unknown unnest unsigned update usage user using value values varchar varchar2 variable varying view when whenever where while with without work write year zone
+keywords=absolute action add admin after aggregate alias all allocate alter and any are array as asc assertion at authorization auto_increment before begin bfile bigint binary bit blob bool boolean both breadth by call cascade cascaded case cast catalog char charset character check class client clob close cluster collate collation column comment commit completion connect connection constraint constraints constructor continue corresponding create cross cube current current_date current_path current_role current_time current_timestamp current_user cursor cycle data date day deallocate dec decimal declare default deferrable deferred delete depth deref desc describe descriptor destroy destructor deterministic diagnostics dictionary dimension disconnect diskgroup distinct domain double drop dynamic each else elsif end end-exec engine equals escape every except exception exec execute exists explain external false fetch first fixed flashback float for foreign found from free full function general get global go goto grant group grouping having hold host hour identity if ignore immediate in index indextype indicator initialize initially inner inout input insert int integer intersect interval into is isolation iterate join key language large last lateral leading left less level like limit local localtime localtimestamp locator log long loop map match materialized mediumblob mediumint mediumtext merge message middleint minus minute modifies modify module month names national natural nchar nclob new next no noaudit none not null numeric nvarchar2 object of off old on only open operation option or order ordinality out outer output owner package pad parameter parameters partial path postfix precision prefix preorder prepare preserve primary print prior privileges procedure profile public purge raise read reads real recursive ref references referencing regexp regexp_like relative rename replace restrict result return returning returns revoke right role rollback rollup routine row rows savepoint schema scroll scope search second section select sequence session session_user serial set sets size smallint some space specific specifictype sql sqlexception sqlstate sqlwarning start state statement static structure synonym system_user table tablespace temporary terminate text than then time timestamp timezone_hour timezone_minute tinyint to trailing transaction translation treat trigger true truncate type under union unique uniqueidentifier unknown unnest unsigned update usage user using value values varchar varchar2 variable varying view when whenever where while with without work write year zone
[settings]
# default extension used when saving files
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Sat, 23 Aug 2014 16:22:52 UTC
Commit: 32bda2e6cb1d6c0ecafebd70c12f3e09d1aae269
https://github.com/geany/geany/commit/32bda2e6cb1d6c0ecafebd70c12f3e09d1aae…
Log Message:
-----------
Don't clean HTML manual if we didn't build it
Clean the HTML manual upon 'maintainer-clean' rather than 'clean' in
case it was not built by Make but rather part of the distribution.
This is fine even then, as configure will properly require what is
needed to build it again if it is missing.
Modified Paths:
--------------
doc/Makefile.am
Modified: doc/Makefile.am
6 lines changed, 5 insertions(+), 1 deletions(-)
===================================================================
@@ -58,7 +58,11 @@ hacking.html: $(srcdir)/geany.css $(top_srcdir)/HACKING
all-local: geany.html hacking.html
-clean-local: clean-html-local
+# clean on 'maintainer-clean' rather than 'clean' in case it was not
+# built by Make but rather part of the distribution. This is fine even
+# then, as configure will properly require what is needed to build it
+# again if it is missing.
+maintainer-clean-local: clean-html-local
clean-html-local:
-rm -f hacking.html
-rm -f geany.html
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Sat, 23 Aug 2014 15:56:14 UTC
Commit: 288b4f29d8a62a5cc2baa6f0ddefa6a3fe201ade
https://github.com/geany/geany/commit/288b4f29d8a62a5cc2baa6f0ddefa6a3fe201…
Log Message:
-----------
Enable HTML manual building by default but for distribution tarballs
Enable building of the HTML manual by default unless not building from
Git and with an existing local copy (which is included in distribution
tarballs).
This makes sure we can install the HTML manual without having it
checked in VCS, yet not require rst2html for tarball builds.
Modified Paths:
--------------
m4/geany-docutils.m4
Modified: m4/geany-docutils.m4
14 lines changed, 12 insertions(+), 2 deletions(-)
===================================================================
@@ -12,11 +12,19 @@ dnl For HTML documentation generation
dnl
AC_DEFUN([GEANY_CHECK_DOCUTILS_HTML],
[
+ AC_REQUIRE([GEANY_CHECK_REVISION])
+
+ dnl we require rst2html by default unless we don't build from Git
+ dnl and already have the HTML manual built in-tree
+ html_docs_default=yes
+ AS_IF([test "$REVISION" = "-1" && test -f "$srcdir/doc/geany.html"],
+ [html_docs_default=auto])
+
AC_ARG_ENABLE([html-docs],
[AS_HELP_STRING([--enable-html-docs],
[generate HTML documentation using rst2html [default=auto]])],
[geany_enable_html_docs="$enableval"],
- [geany_enable_html_docs="auto"])
+ [geany_enable_html_docs="$html_docs_default"])
AC_ARG_VAR([RST2HTML], [Path to Docutils rst2html executable])
AS_IF([test "x$geany_enable_html_docs" != "xno"],
[
@@ -26,7 +34,9 @@ dnl TODO: try rst2html.py first
AS_IF([test "x$RST2HTML" != "xno"],
[geany_enable_html_docs="yes"],
[test "x$geany_enable_html_docs" = "xyes"],
- [AC_MSG_ERROR([Documentation enabled but rst2html not found])],
+ [AC_MSG_ERROR([Documentation enabled but rst2html not found.
+You can explicitly disable building of the HTML manual with --disable-html-docs,
+but you then may not have a local copy of the HTML manual.])],
[geany_enable_html_docs="no"])
])
AM_CONDITIONAL([WITH_RST2HTML], [test "x$geany_enable_html_docs" != "xno"])
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Nick Treleaven <nick.treleaven(a)btinternet.com>
Committer: Nick Treleaven <nick.treleaven(a)btinternet.com>
Date: Thu, 21 Aug 2014 15:45:15 UTC
Commit: c990cd9dca40ac67a7404ed2ba36b3c6e134e13b
https://github.com/geany/geany/commit/c990cd9dca40ac67a7404ed2ba36b3c6e134e…
Log Message:
-----------
Properly handle existing session when creating new project
Ask whether to adopt the existing session documents.
Also fixes the existing bug of not reloading the default session when
an existing project is open and a new project is cancelled.
Modified Paths:
--------------
src/keyfile.c
src/keyfile.h
src/project.c
Modified: src/keyfile.c
56 lines changed, 38 insertions(+), 18 deletions(-)
===================================================================
@@ -329,10 +329,23 @@ static gchar *get_session_file_string(GeanyDocument *doc)
}
+static void remove_session_files(GKeyFile *config)
+{
+ gchar **ptr;
+ gchar **keys = g_key_file_get_keys(config, "files", NULL, NULL);
+
+ foreach_strv(ptr, keys)
+ {
+ if (g_str_has_prefix(*ptr, "FILE_NAME_"))
+ g_key_file_remove_key(config, "files", *ptr, NULL);
+ }
+ g_strfreev(keys);
+}
+
+
void configuration_save_session_files(GKeyFile *config)
{
gint npage;
- gchar *tmp;
gchar entry[16];
guint i = 0, j = 0, max;
GeanyDocument *doc;
@@ -340,6 +353,9 @@ void configuration_save_session_files(GKeyFile *config)
npage = gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.notebook));
g_key_file_set_integer(config, "files", "current_page", npage);
+ // clear existing entries first as they might not all be overwritten
+ remove_session_files(config);
+
/* store the filenames in the notebook tab order to reopen them the next time */
max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook));
for (i = 0; i < max; i++)
@@ -356,23 +372,6 @@ void configuration_save_session_files(GKeyFile *config)
j++;
}
}
- /* if open filenames less than saved session files, delete existing entries in the list */
- i = j;
- while (TRUE)
- {
- g_snprintf(entry, sizeof(entry), "FILE_NAME_%d", i);
- tmp = g_key_file_get_string(config, "files", entry, NULL);
- if (G_UNLIKELY(tmp == NULL))
- {
- break;
- }
- else
- {
- g_key_file_remove_key(config, "files", entry, NULL);
- g_free(tmp);
- i++;
- }
- }
#ifdef HAVE_VTE
if (vte_info.have_vte)
@@ -1047,6 +1046,27 @@ void configuration_save_default_session(void)
}
+void configuration_clear_default_session(void)
+{
+ gchar *configfile = g_build_filename(app->configdir, "geany.conf", NULL);
+ gchar *data;
+ GKeyFile *config = g_key_file_new();
+
+ g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL);
+
+ if (cl_options.load_session)
+ remove_session_files(config);
+
+ /* write the file */
+ data = g_key_file_to_data(config, NULL, NULL);
+ utils_write_file(configfile, data);
+ g_free(data);
+
+ g_key_file_free(config);
+ g_free(configfile);
+}
+
+
/*
* Only reload the session part of the default configuration
*/
Modified: src/keyfile.h
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -50,6 +50,8 @@ void configuration_reload_default_session(void);
void configuration_save_default_session(void);
+void configuration_clear_default_session(void);
+
void configuration_load_session_files(GKeyFile *config, gboolean read_recent_files);
void configuration_save_session_files(GKeyFile *config);
Modified: src/project.c
56 lines changed, 51 insertions(+), 5 deletions(-)
===================================================================
@@ -99,6 +99,16 @@ static void init_stash_prefs(void);
#define PROJECT_DIR _("projects")
+// returns whether we have working documents open
+static gboolean have_session_docs(void)
+{
+ gint npages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook));
+ GeanyDocument *doc = document_get_current();
+
+ return npages > 1 || (npages == 1 && (doc->file_name || doc->changed));
+}
+
+
/* TODO: this should be ported to Glade like the project preferences dialog,
* then we can get rid of the PropertyDialogElements struct altogether as
* widgets pointers can be accessed through ui_lookup_widget(). */
@@ -113,6 +123,27 @@ void project_new(void)
gchar *tooltip;
PropertyDialogElements e = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, FALSE };
+ if (!app->project && project_prefs.project_session)
+ {
+ /* save session in case the dialog is cancelled */
+ configuration_save_default_session();
+ /* don't ask if the only doc is an unmodified new doc */
+ if (have_session_docs())
+ {
+ if (dialogs_show_question(
+ _("Move the current documents into the new project's session?")))
+ {
+ // don't reload session on closing project
+ configuration_clear_default_session();
+ }
+ else
+ {
+ if (!document_close_all())
+ return;
+ }
+ }
+ }
+
if (! project_ask_close())
return;
@@ -194,22 +225,36 @@ void project_new(void)
gtk_widget_show_all(e.dialog);
- while (gtk_dialog_run(GTK_DIALOG(e.dialog)) == GTK_RESPONSE_OK)
+ while (1)
{
+ if (gtk_dialog_run(GTK_DIALOG(e.dialog)) != GTK_RESPONSE_OK)
+ {
+ // reload any documents that were closed
+ if (!app->project && !have_session_docs())
+ {
+ configuration_reload_default_session();
+ configuration_open_files();
+ }
+ break;
+ }
if (update_config(&e, TRUE))
{
+ // app->project is now set
if (!write_config(TRUE))
+ {
SHOW_ERR(_("Project file could not be written"));
+ }
else
{
ui_set_statusbar(TRUE, _("Project \"%s\" created."), app->project->name);
-
ui_add_recent_project_file(app->project->file_name);
break;
}
}
}
gtk_widget_destroy(e.dialog);
+ document_new_file_if_non_open();
+ ui_focus_current_document();
}
@@ -220,7 +265,6 @@ gboolean project_load_file_with_session(const gchar *locale_file_name)
if (project_prefs.project_session)
{
configuration_open_files();
- /* open a new file if no other file was opened */
document_new_file_if_non_open();
ui_focus_current_document();
}
@@ -328,6 +372,7 @@ static void update_ui(void)
ui_set_window_title(NULL);
build_menu_update(NULL);
+ // update project name
sidebar_openfiles_update_all();
}
@@ -398,7 +443,6 @@ void project_close(gboolean open_default)
{
configuration_reload_default_session();
configuration_open_files();
- /* open a new file if no other file was opened */
document_new_file_if_non_open();
ui_focus_current_document();
}
@@ -633,6 +677,7 @@ static GeanyProject *create_project(void)
/* Verifies data for New & Properties dialogs.
+ * Creates app->project if NULL.
* Returns: FALSE if the user needs to change any data. */
static gboolean update_config(const PropertyDialogElements *e, gboolean new_project)
{
@@ -1009,12 +1054,13 @@ static gboolean load_config(const gchar *filename)
build_load_menu(config, GEANY_BCS_PROJ, (gpointer)p);
if (project_prefs.project_session)
{
- /* save current (non-project) session (it could has been changed since program startup) */
+ /* save current (non-project) session (it could have been changed since program startup) */
configuration_save_default_session();
/* now close all open files */
document_close_all();
/* read session files so they can be opened with configuration_open_files() */
configuration_load_session_files(config, FALSE);
+ document_new_file_if_non_open();
ui_focus_current_document();
}
g_signal_emit_by_name(geany_object, "project-open", config);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 20 Aug 2014 13:44:07 UTC
Commit: 80c648e7f3731a36ef7213be7e4a42cfb4d470ab
https://github.com/geany/geany/commit/80c648e7f3731a36ef7213be7e4a42cfb4d47…
Log Message:
-----------
Remove generated HTML documentation from version control
As it is generated by the build system it doesn't have to be checked
in, and having it in became a whole lot more annoying since it started
being generated automatically on `make all` instead of specific (and
weird) `make doc`, as it means whenever the documentation changes the
HTML is re-generated on any make run. This is particularly problematic
if using a different Docutils version than the one used to generate the
checked-in version as it would create local noise that should not be
committed, yet keep being annoying.
This situation probably leads to most people disabling (or at least,
not enabling) the documentation generation on normal builds, itself
leading to more hassle updating of the documentation.
Modified Paths:
--------------
.gitignore
doc/geany.html
Modified: .gitignore
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -99,6 +99,7 @@ Makefile.in
/doc/Doxyfile
/doc/Doxyfile.stamp
/doc/geany.1
+/doc/geany.html
/doc/hacking.html
/doc/*.pdf
/doc/*.aux
Modified: doc/geany.html
6970 lines changed, 0 insertions(+), 6970 deletions(-)
===================================================================
No diff available, check online
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).