diff --git a/data/geany.glade b/data/geany.glade index 3864a0ad17..adc4b77ffd 100644 --- a/data/geany.glade +++ b/data/geany.glade @@ -2811,18 +2811,52 @@ True False - - Line wrapping + True - True - False - Wrap the line at the window border and continue it on the next line. Note: line wrapping has a high performance cost for large documents so should be disabled on slow machines. - True - True + False + These preferences can be overridden by project properties. +Click the info icon to force editing when disabled. + 6 + + + Line wrapping + True + True + False + Wrap the line at the window border and continue it on the next line. Note: line wrapping has a high performance cost for large documents so should be disabled on slow machines. + True + True + + + False + False + 0 + + + + + True + False + + + + True + False + gtk-info + 2 + + + + + False + True + 1 + + - False - False + True + True 0 @@ -2925,31 +2959,65 @@ True False - 12 + These preferences can be overridden by project properties. +Click the info icon to force editing when disabled. + 6 - + True False - Line breaking column: - spin_line_break + 12 + + + True + False + Line breaking column: + spin_line_break + + + False + False + 0 + + + + + True + True + False + False + True + True + adjustment1 + 1 + True + + + False + True + 1 + + False - False + True 0 - + True - True - False - False - True - True - adjustment1 - 1 - True + False + + + + True + False + gtk-info + 2 + + False @@ -3317,11 +3385,45 @@ - + True False - <b>Indentation</b> - True + These preferences can be overridden by project properties. +Click the info icon to force editing when disabled. + 6 + + + True + False + <b>Indentation</b> + True + + + True + True + 0 + + + + + True + False + + + + True + False + gtk-info + 2 + + + + + True + True + 1 + + @@ -3401,14 +3503,48 @@ - - Automatic continuation of multi-line comments + True - True - False - Continue automatically multi-line comments in languages like C, C++ and Java when a new line is entered inside such a comment - True - True + False + These preferences can be overridden by project properties. +Click the info icon to force editing when disabled. + 6 + + + Automatic continuation of multi-line comments + True + True + False + Continue automatically multi-line comments in languages like C, C++ and Java when a new line is entered inside such a comment + True + True + + + False + True + 0 + + + + + True + False + + + + True + False + gtk-info + 2 + + + + + False + True + 1 + + False @@ -4135,11 +4271,45 @@ - + True False - <b>Long line marker</b> - True + These preferences can be overridden by project properties. +Click the info icon to force editing when disabled. + 6 + + + True + False + <b>Long line marker</b> + True + + + False + True + 0 + + + + + True + False + + + + True + False + gtk-info + 2 + + + + + False + True + 1 + + @@ -4606,11 +4776,45 @@ - + True False - <b>Saving files</b> - True + These preferences can be overridden by project properties. +Click the info icon to force editing when disabled. + 6 + + + True + False + <b>Saving files</b> + True + + + True + True + 0 + + + + + True + False + + + + True + False + gtk-info + 2 + + + + + True + True + 1 + + diff --git a/doc/geany.txt b/doc/geany.txt index e418ebe815..71525d5a43 100644 --- a/doc/geany.txt +++ b/doc/geany.txt @@ -1786,17 +1786,22 @@ that items like G_GNUC_PRINTF+ get parsed correctly. Preferences ----------- -You may adjust Geany's settings using the Edit --> Preferences +You may adjust Geany's settings using the Preferences dialog. Any changes you make there can be applied by hitting either the Apply or the OK button. These settings will persist between Geany sessions. Note that most settings here have descriptive popup bubble help -- just hover the mouse over the item in question to get help -on it. +on it. (Known as tooltips). You may also adjust some View settings (under the View menu) that persist between Geany sessions. The settings under the Document menu, however, are only for the current document and revert to defaults -when restarting Geany. +when opening a new document. + +Some preferences are overridden when a project is open, and will be +disabled. These have info icons next to them with a tooltip reminder. +Clicking the icon will enable editing of all overridden preferences +until the dialog is closed. .. note:: In the paragraphs that follow, the text describing a dialog tab diff --git a/src/prefs.c b/src/prefs.c index 5d1b5fc970..b7405172f3 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -393,6 +393,12 @@ static void kb_init(KbData *kbdata) } +// pref dialog widget names that should start off disabled when project open +const gchar *proj_overrides[] = { + "vbox6", "table13", "check_line_wrapping", "hbox14", + "check_auto_multiline", "table7" +}; + /* note: new 'simple' prefs should use Stash code in keyfile.c */ static void prefs_init_dialog(void) { @@ -803,6 +809,23 @@ static void prefs_init_dialog(void) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), vc->cursor_blinks); } #endif + for (guint i = 0; i < G_N_ELEMENTS(proj_overrides); i++) + { + GtkWidget *w = ui_lookup_widget(ui_widgets.prefs_dialog, proj_overrides[i]); + gtk_widget_set_sensitive(w, !app->project); + } +} + + +gboolean on_prefs_edit_override(GtkWidget *widget, GdkEventButton *event, gpointer data) +{ + // all overridden widgets will stay enabled until dialog is closed + for (guint i = 0; i < G_N_ELEMENTS(proj_overrides); i++) + { + GtkWidget *w = ui_lookup_widget(ui_widgets.prefs_dialog, proj_overrides[i]); + gtk_widget_set_sensitive(w, TRUE); + } + return TRUE; } diff --git a/src/prefs.h b/src/prefs.h index dcf33a5029..654460c9ee 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -21,7 +21,7 @@ #ifndef GEANY_PREFS_H #define GEANY_PREFS_H 1 -#include +#include G_BEGIN_DECLS @@ -63,6 +63,8 @@ void prefs_show_dialog(void); void prefs_kb_search_name(const gchar *search); +gboolean on_prefs_edit_override(GtkWidget *widget, GdkEventButton *event, gpointer data); + #endif /* GEANY_PRIVATE */ G_END_DECLS