Revision: 3520 http://geany.svn.sourceforge.net/geany/?rev=3520&view=rev Author: eht16 Date: 2009-01-28 17:01:32 +0000 (Wed, 28 Jan 2009)
Log Message: ----------- Add a hiden preference "allow_always_save" to make the Save buttons/menu items always sensitive and allow saving files even without changes.
Modified Paths: -------------- trunk/ChangeLog trunk/src/document.c trunk/src/keyfile.c trunk/src/ui_utils.c trunk/src/ui_utils.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-01-28 16:18:22 UTC (rev 3519) +++ trunk/ChangeLog 2009-01-28 17:01:32 UTC (rev 3520) @@ -3,6 +3,10 @@ * src/document.c: Set the documents' mtime field properly for checking disk file changes. + * src/document.c, src/keyfile.c, src/ui_utils.c, src/ui_utils.h: + Add a hiden preference "allow_always_save" to make the Save buttons/ + menu items always sensitive and allow saving files even without + changes.
2009-01-27 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2009-01-28 16:18:22 UTC (rev 3519) +++ trunk/src/document.c 2009-01-28 17:01:32 UTC (rev 3520) @@ -1688,7 +1688,7 @@ return FALSE;
/* the "changed" flag should exclude the "readonly" flag, but check it anyway for safety */ - if (! force && (! doc->changed || doc->readonly)) + if (! force && ! ui_prefs.allow_always_save && (! doc->changed || doc->readonly)) return FALSE;
if (doc->file_name == NULL)
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2009-01-28 16:18:22 UTC (rev 3519) +++ trunk/src/keyfile.c 2009-01-28 17:01:32 UTC (rev 3520) @@ -170,6 +170,8 @@ "complete_snippets_whilst_editing", FALSE); stash_group_add_boolean(group, &interface_prefs.show_symbol_list_expanders, "show_symbol_list_expanders", TRUE); + stash_group_add_boolean(group, &ui_prefs.allow_always_save, + "allow_always_save", FALSE); }
Modified: trunk/src/ui_utils.c =================================================================== --- trunk/src/ui_utils.c 2009-01-28 16:18:22 UTC (rev 3519) +++ trunk/src/ui_utils.c 2009-01-28 17:01:32 UTC (rev 3520) @@ -573,6 +573,9 @@ guint i; gboolean dirty_tabs = FALSE;
+ if (ui_prefs.allow_always_save) + return; + ui_widget_set_sensitive(widgets.save_buttons[0], enable); ui_widget_set_sensitive(widgets.save_buttons[1], enable);
@@ -609,6 +612,7 @@ add_doc_widget("close_other_documents1"); add_doc_widget("menu_change_font1"); add_doc_widget("menu_close_all1"); + add_doc_widget("menu_save1"); add_doc_widget("menu_save_all1"); add_doc_widget("menu_save_as1"); add_doc_widget("menu_count_words1"); @@ -653,8 +657,8 @@ add_doc_toolitem("Copy"); add_doc_toolitem("Paste"); add_doc_toolitem("Delete"); + add_doc_toolitem("Save"); add_doc_toolitem("SaveAll"); - add_doc_toolitem("SaveAll"); add_doc_toolitem("Compile"); add_doc_toolitem("Run"); add_doc_toolitem("Reload");
Modified: trunk/src/ui_utils.h =================================================================== --- trunk/src/ui_utils.h 2009-01-28 16:18:22 UTC (rev 3519) +++ trunk/src/ui_utils.h 2009-01-28 17:01:32 UTC (rev 3520) @@ -81,6 +81,7 @@ gboolean fullscreen; gboolean sidebar_visible; gboolean msgwindow_visible; + gboolean allow_always_save; /* if set, files can always be saved, even if unchanged */
/* Menu-item related data */ GQueue *recent_queue;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.