Branch: refs/heads/master
Author: Nick Treleaven <nick.treleaven(a)btinternet.com>
Committer: Nick Treleaven <nick.treleaven(a)btinternet.com>
Date: Wed, 24 Sep 2014 11:08:24 UTC
Commit: 9a02525d1c27bd3a5256162940916ccebb5e619a
https://github.com/geany/geany/commit/9a02525d1c27bd3a5256162940916ccebb5e6…
Log Message:
-----------
Don't set document text as changed when file on disk is newer
Setting the document text as changed makes it too easy to accidentally
overwrite the file - e.g. when closing you're reminded to save it.
It also makes it slower to close documents you no longer want open.
Setting text as changed is still done if the user cancels the warning.
Modified Paths:
--------------
src/document.c
Modified: src/document.c
5 lines changed, 3 insertions(+), 2 deletions(-)
===================================================================
@@ -3269,7 +3269,9 @@ static void on_monitor_reload_file_response(GtkWidget *bar, gint response_id, Ge
if (response_id == RESPONSE_DOCUMENT_RELOAD)
document_reload_file(doc, doc->encoding);
else if (response_id == RESPONSE_DOCUMENT_SAVE)
- document_save_file(doc, FALSE);
+ document_save_file(doc, TRUE);
+ else if (response_id == GTK_RESPONSE_CANCEL)
+ document_set_text_changed(doc, TRUE);
}
@@ -3327,7 +3329,6 @@ static void monitor_reload_file(GeanyDocument *doc)
_("The file '%s' on the disk is more recent than the current buffer."),
base_name);
- document_set_text_changed(doc, TRUE);
protect_document(doc);
doc->priv->info_bars[MSG_TYPE_RELOAD] = bar;
enable_key_intercept(doc, bar);
--------------
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: Tue, 23 Sep 2014 13:43:49 UTC
Commit: 7450a992b51f239ce2a3c10d375ebe9dcec2301e
https://github.com/geany/geany/commit/7450a992b51f239ce2a3c10d375ebe9dcec23…
Log Message:
-----------
Use 'Overwrite' rather than Save for clarity in reload infobar
Modified Paths:
--------------
src/document.c
Modified: src/document.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -3279,7 +3279,7 @@ static void monitor_reload_file(GeanyDocument *doc)
bar = document_show_message(doc, GTK_MESSAGE_QUESTION, on_monitor_reload_file_response,
_("_Reload"), RESPONSE_DOCUMENT_RELOAD,
- GTK_STOCK_SAVE, RESPONSE_DOCUMENT_SAVE,
+ _("_Overwrite"), RESPONSE_DOCUMENT_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("Do you want to reload it?"),
_("The file '%s' on the disk is more recent than the current buffer."),
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).