Add option to suppress messages in the status bar.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1771 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2007-08-05 11:03:44 +00:00
parent 1f2aa9d983
commit 64f13d4104
8 changed files with 52 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2007-08-05 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* geany.glade, src/geany.h, src/interface.c, src/keyfile.c,
src/msgwindow.c, src/prefs.c, src/ui_utils.c:
Add option to suppress messages in the status bar.
2007-08-04 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2007-08-04 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* configure.in: Fix error in "make install" caused by old automake * configure.in: Fix error in "make install" caused by old automake

View File

@ -3252,6 +3252,26 @@
</packing> </packing>
</child> </child>
<child>
<widget class="GtkCheckButton" id="check_suppress_status_msgs">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Removes all messages from the status bar. The messages are still displayed in the status messages window.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Suppress status messages in the status bar</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">False</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child> <child>
<widget class="GtkCheckButton" id="check_auto_focus"> <widget class="GtkCheckButton" id="check_auto_focus">
<property name="visible">True</property> <property name="visible">True</property>

View File

@ -109,6 +109,7 @@ typedef struct MyApp
gboolean pref_main_save_winpos; gboolean pref_main_save_winpos;
gboolean pref_main_confirm_exit; gboolean pref_main_confirm_exit;
gboolean pref_main_suppress_search_dialogs; gboolean pref_main_suppress_search_dialogs;
gboolean pref_main_suppress_status_messages;
gboolean pref_toolbar_show_search; gboolean pref_toolbar_show_search;
gboolean pref_toolbar_show_goto; gboolean pref_toolbar_show_goto;
gboolean pref_toolbar_show_undo; gboolean pref_toolbar_show_undo;

View File

@ -2410,6 +2410,7 @@ create_prefs_dialog (void)
GtkWidget *vbox21; GtkWidget *vbox21;
GtkWidget *check_beep; GtkWidget *check_beep;
GtkWidget *check_switch_pages; GtkWidget *check_switch_pages;
GtkWidget *check_suppress_status_msgs;
GtkWidget *check_auto_focus; GtkWidget *check_auto_focus;
GtkWidget *check_ask_suppress_search_dialogs; GtkWidget *check_ask_suppress_search_dialogs;
GtkWidget *label178; GtkWidget *label178;
@ -2747,6 +2748,12 @@ create_prefs_dialog (void)
gtk_tooltips_set_tip (tooltips, check_switch_pages, _("Switch to the status message tab (in the notebook window at the bottom) if a new status message arrives."), NULL); gtk_tooltips_set_tip (tooltips, check_switch_pages, _("Switch to the status message tab (in the notebook window at the bottom) if a new status message arrives."), NULL);
gtk_button_set_focus_on_click (GTK_BUTTON (check_switch_pages), FALSE); gtk_button_set_focus_on_click (GTK_BUTTON (check_switch_pages), FALSE);
check_suppress_status_msgs = gtk_check_button_new_with_mnemonic (_("Suppress status messages in the status bar"));
gtk_widget_show (check_suppress_status_msgs);
gtk_box_pack_start (GTK_BOX (vbox21), check_suppress_status_msgs, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, check_suppress_status_msgs, _("Removes all messages from the status bar. The messages are still displayed in the status messages window."), NULL);
gtk_button_set_focus_on_click (GTK_BUTTON (check_suppress_status_msgs), FALSE);
check_auto_focus = gtk_check_button_new_with_mnemonic (_("Auto focus widgets (focus follows mouse)")); check_auto_focus = gtk_check_button_new_with_mnemonic (_("Auto focus widgets (focus follows mouse)"));
gtk_widget_show (check_auto_focus); gtk_widget_show (check_auto_focus);
gtk_box_pack_start (GTK_BOX (vbox21), check_auto_focus, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox21), check_auto_focus, FALSE, FALSE, 0);
@ -4133,6 +4140,7 @@ create_prefs_dialog (void)
GLADE_HOOKUP_OBJECT (prefs_dialog, vbox21, "vbox21"); GLADE_HOOKUP_OBJECT (prefs_dialog, vbox21, "vbox21");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_beep, "check_beep"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_beep, "check_beep");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_switch_pages, "check_switch_pages"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_switch_pages, "check_switch_pages");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_suppress_status_msgs, "check_suppress_status_msgs");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_auto_focus, "check_auto_focus"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_auto_focus, "check_auto_focus");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_ask_suppress_search_dialogs, "check_ask_suppress_search_dialogs"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_ask_suppress_search_dialogs, "check_ask_suppress_search_dialogs");
GLADE_HOOKUP_OBJECT (prefs_dialog, label178, "label178"); GLADE_HOOKUP_OBJECT (prefs_dialog, label178, "label178");

View File

@ -250,6 +250,7 @@ void configuration_save()
g_key_file_set_boolean(config, PACKAGE, "pref_editor_use_tabs", editor_prefs.use_tabs); g_key_file_set_boolean(config, PACKAGE, "pref_editor_use_tabs", editor_prefs.use_tabs);
g_key_file_set_boolean(config, PACKAGE, "pref_main_confirm_exit", app->pref_main_confirm_exit); g_key_file_set_boolean(config, PACKAGE, "pref_main_confirm_exit", app->pref_main_confirm_exit);
g_key_file_set_boolean(config, PACKAGE, "pref_main_suppress_search_dialogs", app->pref_main_suppress_search_dialogs); g_key_file_set_boolean(config, PACKAGE, "pref_main_suppress_search_dialogs", app->pref_main_suppress_search_dialogs);
g_key_file_set_boolean(config, PACKAGE, "pref_main_suppress_status_messages", app->pref_main_suppress_status_messages);
g_key_file_set_boolean(config, PACKAGE, "pref_main_load_session", app->pref_main_load_session); g_key_file_set_boolean(config, PACKAGE, "pref_main_load_session", app->pref_main_load_session);
g_key_file_set_boolean(config, PACKAGE, "pref_main_save_winpos", app->pref_main_save_winpos); g_key_file_set_boolean(config, PACKAGE, "pref_main_save_winpos", app->pref_main_save_winpos);
g_key_file_set_boolean(config, PACKAGE, "pref_toolbar_show", app->toolbar_visible); g_key_file_set_boolean(config, PACKAGE, "pref_toolbar_show", app->toolbar_visible);
@ -475,6 +476,7 @@ gboolean configuration_load()
} }
app->pref_main_confirm_exit = utils_get_setting_boolean(config, PACKAGE, "pref_main_confirm_exit", FALSE); app->pref_main_confirm_exit = utils_get_setting_boolean(config, PACKAGE, "pref_main_confirm_exit", FALSE);
app->pref_main_suppress_search_dialogs = utils_get_setting_boolean(config, PACKAGE, "pref_main_suppress_search_dialogs", FALSE); app->pref_main_suppress_search_dialogs = utils_get_setting_boolean(config, PACKAGE, "pref_main_suppress_search_dialogs", FALSE);
app->pref_main_suppress_status_messages = utils_get_setting_boolean(config, PACKAGE, "pref_main_suppress_status_messages", FALSE);
app->pref_main_load_session = utils_get_setting_boolean(config, PACKAGE, "pref_main_load_session", TRUE); app->pref_main_load_session = utils_get_setting_boolean(config, PACKAGE, "pref_main_load_session", TRUE);
app->pref_main_save_winpos = utils_get_setting_boolean(config, PACKAGE, "pref_main_save_winpos", TRUE); app->pref_main_save_winpos = utils_get_setting_boolean(config, PACKAGE, "pref_main_save_winpos", TRUE);
app->pref_toolbar_show_search = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_search", TRUE); app->pref_toolbar_show_search = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_search", TRUE);

View File

@ -291,6 +291,7 @@ void msgwin_status_add(const gchar *format, ...)
va_end(args); va_end(args);
// display status message in status bar // display status message in status bar
if (! app->pref_main_suppress_status_messages)
ui_set_statusbar("%s", string); ui_set_statusbar("%s", string);
// add a timestamp to status messages // add a timestamp to status messages

View File

@ -96,6 +96,9 @@ void prefs_init_dialog(void)
widget = lookup_widget(app->prefs_dialog, "check_switch_pages"); widget = lookup_widget(app->prefs_dialog, "check_switch_pages");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->switch_msgwin_pages); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->switch_msgwin_pages);
widget = lookup_widget(app->prefs_dialog, "check_suppress_status_msgs");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_suppress_status_messages);
widget = lookup_widget(app->prefs_dialog, "check_auto_focus"); widget = lookup_widget(app->prefs_dialog, "check_auto_focus");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->auto_focus); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->auto_focus);
@ -479,6 +482,9 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
widget = lookup_widget(app->prefs_dialog, "check_switch_pages"); widget = lookup_widget(app->prefs_dialog, "check_switch_pages");
app->switch_msgwin_pages = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); app->switch_msgwin_pages = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_suppress_status_msgs");
app->pref_main_suppress_status_messages = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_auto_focus"); widget = lookup_widget(app->prefs_dialog, "check_auto_focus");
app->auto_focus = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); app->auto_focus = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));

View File

@ -86,7 +86,8 @@ static void set_statusbar(const gchar *text, gboolean allow_override)
} }
// Display text on the statusbar (without logging it to the Status window). /* Display text on the statusbar or log it to the Status window if
* app->pref_main_suppress_status_messages is set */
void ui_set_statusbar(const gchar *format, ...) void ui_set_statusbar(const gchar *format, ...)
{ {
gchar string[512]; gchar string[512];
@ -99,6 +100,9 @@ void ui_set_statusbar(const gchar *format, ...)
g_vsnprintf(string, 512, format, args); g_vsnprintf(string, 512, format, args);
va_end(args); va_end(args);
if (app->pref_main_suppress_status_messages)
msgwin_status_add("%s", string);
else
set_statusbar(string, FALSE); set_statusbar(string, FALSE);
} }