[vte] Revert "vteapp: Three-state bell option"



commit a4ef99acfb62d19398da14ed315df545b0570d43
Author: Egmont Koblinger <egmont gmail com>
Date:   Fri Sep 12 00:10:27 2014 +0200

    Revert "vteapp: Three-state bell option"
    
    This reverts commit 983b3840454267205ce789498f8d0941b41c8d60.

 src/app.vala |   12 ++++++------
 src/vteapp.c |   21 +++++++++++----------
 2 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 1588656..8922af0 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -114,7 +114,7 @@ class Window : Gtk.ApplicationWindow
       }
     }
 
-    terminal.set_audible_bell(App.Options.bell_string == "audible");
+    terminal.set_audible_bell(App.Options.audible);
     terminal.set_cjk_ambiguous_width(App.Options.get_cjk_ambiguous_width());
     terminal.set_cursor_blink_mode(App.Options.get_cursor_blink_mode());
     terminal.set_cursor_shape(App.Options.get_cursor_shape());
@@ -123,7 +123,7 @@ class Window : Gtk.ApplicationWindow
     terminal.set_scroll_on_output(false);
     terminal.set_scroll_on_keystroke(true);
     terminal.set_scrollback_lines(App.Options.scrollback_lines);
-    terminal.set_visible_bell(App.Options.bell_string == "visual");
+    terminal.set_visible_bell(!App.Options.audible);
 
     /* Style */
     if (App.Options.font_string != null) {
@@ -537,7 +537,7 @@ class App : Gtk.Application
 
   public struct Options
   {
-    public static string? bell_string = null;
+    public static bool audible = false;
     public static string? command = null;
     private static string? cjk_ambiguous_width_string = null;
     private static string? cursor_blink_mode_string = null;
@@ -700,8 +700,8 @@ class App : Gtk.Application
     }
                
     public static const OptionEntry[] entries = {
-      { "bell", 0, 0, OptionArg.STRING, ref bell_string,
-        "Set bell mode (none|audible|visual)", "MODE" },
+      { "audible-bell", 'a', 0, OptionArg.NONE, ref audible,
+        "Use audible terminal bell", null },
       { "command", 'c', 0, OptionArg.STRING, ref command,
         "Execute a command in the terminal", null },
       { "cjk-width", 0, 0, OptionArg.STRING, ref cjk_ambiguous_width_string,
@@ -711,7 +711,7 @@ class App : Gtk.Application
       { "cursor-color", 0, 0, OptionArg.STRING, ref cursor_color_string,
         "Enable a colored cursor", null },
       { "cursor-shape", 0, 0, OptionArg.STRING, ref cursor_shape_string,
-        "Set cursor shape (block|underline|ibeam)", "SHAPE" },
+        "Set cursor shape (block|underline|ibeam)", null },
       { "dingu", 'D', 0, OptionArg.STRING_ARRAY, ref dingus,
         "Add regex highlight", null },
       { "debug", 'd', 0,OptionArg.NONE, ref debug,
diff --git a/src/vteapp.c b/src/vteapp.c
index a4fe9d7..d598a61 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -563,7 +563,8 @@ main(int argc, char **argv)
         char *transparent = NULL;
         char *encoding = NULL;
         char *cjk_ambiguous_width = NULL;
-       gboolean debug = FALSE, no_builtin_dingus = FALSE, dbuffer = TRUE,
+       gboolean audible = TRUE,
+                debug = FALSE, no_builtin_dingus = FALSE, dbuffer = TRUE,
                 console = FALSE, keep = FALSE,
                 icon_title = FALSE, shell = TRUE,
                 reverse = FALSE, use_geometry_hints = TRUE,
@@ -577,7 +578,6 @@ main(int argc, char **argv)
        const char *working_directory = NULL;
        const char *output_file = NULL;
        char *pty_flags_string = NULL;
-       char *bell_string = NULL;
        char *cursor_blink_mode_string = NULL;
        char *cursor_shape_string = NULL;
        char *scrollbar_policy_string = NULL;
@@ -624,6 +624,12 @@ main(int argc, char **argv)
                        "Disable double-buffering", NULL
                },
                {
+                       "audible", 'a', G_OPTION_FLAG_REVERSE,
+                       G_OPTION_ARG_NONE, &audible,
+                       "Use visible, instead of audible, terminal bell",
+                       NULL
+               },
+               {
                        "command", 'c', 0,
                        G_OPTION_ARG_STRING, &command,
                        "Execute a command in the terminal", NULL
@@ -669,11 +675,6 @@ main(int argc, char **argv)
                        "Specify the number of scrollback-lines", NULL
                },
                {
-                       "bell", 0, 0,
-                       G_OPTION_ARG_STRING, &bell_string,
-                       "Set bell mode (none|audible|visual)", "MODE"
-               },
-               {
                        "cursor-blink", 0, 0,
                        G_OPTION_ARG_STRING, &cursor_blink_mode_string,
                        "Cursor blink mode (system|on|off)", "MODE"
@@ -686,7 +687,7 @@ main(int argc, char **argv)
                {
                        "cursor-shape", 0, 0,
                        G_OPTION_ARG_STRING, &cursor_shape_string,
-                       "Set cursor shape (block|underline|ibeam)", "SHAPE"
+                       "Set cursor shape (block|underline|ibeam)", NULL
                },
                {
                        "encoding", 0, 0,
@@ -908,8 +909,8 @@ main(int argc, char **argv)
        }
 
        /* Set some defaults. */
-       vte_terminal_set_audible_bell(terminal, g_strcmp0(bell_string, "audible") == 0);
-       vte_terminal_set_visible_bell(terminal, g_strcmp0(bell_string, "visual") == 0);
+       vte_terminal_set_audible_bell(terminal, audible);
+       vte_terminal_set_visible_bell(terminal, !audible);
        vte_terminal_set_cursor_blink_mode(terminal, cursor_blink_mode);
        vte_terminal_set_scroll_on_output(terminal, FALSE);
        vte_terminal_set_scroll_on_keystroke(terminal, TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]