Kaydet (Commit) 8ecce6ed authored tarafından Enrico Tröger's avatar Enrico Tröger

added new option "Beep on errors" to disable beeping


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@100 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 59a7979f
......@@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
*/
......@@ -456,7 +457,7 @@ void build_exit_cb (GPid child_pid, gint status, gpointer user_data)
}
#endif
gdk_beep();
if (app->beep_on_errors) gdk_beep();
gtk_widget_set_sensitive(app->compile_button, TRUE);
g_spawn_close_pid(child_pid);
}
......
......@@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
*/
......
......@@ -310,7 +310,7 @@ void
on_close1_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
gint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook));
guint cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->notebook));
document_remove(cur_page);
}
......@@ -1550,7 +1550,7 @@ on_goto_tag_activate (GtkMenuItem *menuitem,
TM_TAG(tags->pdata[i])->atts.entry.file->work_object.file_name,
TM_TAG(tags->pdata[i])->atts.entry.line))
{
gdk_beep();
if (app->beep_on_errors) gdk_beep();
msgwin_status_add(_("Declaration or definition of \"%s()\" not found"), current_word);
}
return;
......@@ -1559,7 +1559,7 @@ on_goto_tag_activate (GtkMenuItem *menuitem,
}
}
// if we are here, there was no match and we are beeping ;-)
gdk_beep();
if (app->beep_on_errors) gdk_beep();
msgwin_status_add(_("Declaration or definition of \"%s()\" not found"), current_word);
}
......@@ -2090,7 +2090,7 @@ on_goto_line_dialog_response (GtkDialog *dialog,
}
else
{
gdk_beep();
if (app->beep_on_errors) gdk_beep();
}
}
......
......@@ -120,6 +120,7 @@ typedef struct MyApp
gboolean show_line_endings;
gboolean show_markers_margin;
gboolean fullscreen;
gboolean beep_on_errors;
gboolean switch_msgwin_pages;
gboolean auto_close_xml_tags;
gboolean auto_complete_constructs;
......
......@@ -1873,6 +1873,7 @@ create_prefs_dialog (void)
GtkWidget *spin_mru;
GtkWidget *check_load_session;
GtkWidget *check_save_win_pos;
GtkWidget *check_beep;
GtkWidget *check_switch_pages;
GtkWidget *check_ask_for_quit;
GtkWidget *label18;
......@@ -2065,6 +2066,12 @@ create_prefs_dialog (void)
gtk_tooltips_set_tip (tooltips, check_save_win_pos, _("Saves the window position and geometry and restores it at the start"), NULL);
gtk_button_set_focus_on_click (GTK_BUTTON (check_save_win_pos), FALSE);
check_beep = gtk_check_button_new_with_mnemonic (_("Beep on errors or when compilation has finished"));
gtk_widget_show (check_beep);
gtk_box_pack_start (GTK_BOX (vbox4), check_beep, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, check_beep, _("Whether to beep if an error occured or when the compilation process has finished."), NULL);
gtk_button_set_focus_on_click (GTK_BUTTON (check_beep), FALSE);
check_switch_pages = gtk_check_button_new_with_mnemonic (_("Switch to status message list at new message"));
gtk_widget_show (check_switch_pages);
gtk_box_pack_start (GTK_BOX (vbox4), check_switch_pages, FALSE, FALSE, 0);
......@@ -2817,6 +2824,7 @@ create_prefs_dialog (void)
GLADE_HOOKUP_OBJECT (prefs_dialog, spin_mru, "spin_mru");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_load_session, "check_load_session");
GLADE_HOOKUP_OBJECT (prefs_dialog, check_save_win_pos, "check_save_win_pos");
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_ask_for_quit, "check_ask_for_quit");
GLADE_HOOKUP_OBJECT (prefs_dialog, label18, "label18");
......
......@@ -79,6 +79,7 @@ void configuration_save(void)
g_key_file_set_integer(config, PACKAGE, "mru_length", app->mru_length);
g_key_file_set_integer(config, PACKAGE, "long_line_column", app->long_line_column);
g_key_file_set_string(config, PACKAGE, "long_line_color", app->long_line_color);
g_key_file_set_boolean(config, PACKAGE, "beep_on_errors", app->beep_on_errors);
g_key_file_set_boolean(config, PACKAGE, "treeview_symbol_visible", app->treeview_symbol_visible);
g_key_file_set_boolean(config, PACKAGE, "treeview_openfiles_visible", app->treeview_openfiles_visible);
g_key_file_set_boolean(config, PACKAGE, "msgwindow_visible", app->msgwindow_visible);
......@@ -191,6 +192,7 @@ gboolean configuration_load(void)
config_exists = g_key_file_load_from_file(config, configfile, G_KEY_FILE_KEEP_COMMENTS, NULL);
app->toolbar_visible = utils_get_setting_boolean(config, PACKAGE, "toolbar_visible", TRUE);
app->beep_on_errors = utils_get_setting_boolean(config, PACKAGE, "beep_on_errors", TRUE);
app->mru_length = utils_get_setting_integer(config, PACKAGE, "mru_length", 10);
app->toolbar_icon_style = utils_get_setting_integer(config, PACKAGE, "toolbar_icon_style", GTK_TOOLBAR_ICONS);
app->toolbar_icon_size = utils_get_setting_integer(config, PACKAGE, "toolbar_icon_size", 2);
......
......@@ -53,6 +53,9 @@ void prefs_init_dialog(void)
widget = lookup_widget(app->prefs_dialog, "check_save_win_pos");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_save_winpos);
widget = lookup_widget(app->prefs_dialog, "check_beep");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->beep_on_errors);
widget = lookup_widget(app->prefs_dialog, "check_switch_pages");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->switch_msgwin_pages);
......@@ -201,6 +204,9 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
widget = lookup_widget(app->prefs_dialog, "check_save_win_pos");
app->pref_main_save_winpos = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_beep");
app->beep_on_errors = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "check_ask_for_quit");
app->pref_main_confirm_exit = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
......
......@@ -65,7 +65,7 @@ on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user
}
case SCN_MODIFYATTEMPTRO:
{
gdk_beep();
if (app->beep_on_errors) gdk_beep();
break;
}
case SCN_MARGINCLICK:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment