[totem] main: Remove "Toggle controls" feature



commit 5c5edd48478a71645bad874bc1cda87c28ab7a19
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Feb 22 16:01:08 2013 +0100

    main: Remove "Toggle controls" feature
    
    It doesn't fit with the upcoming designs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694456

 README                            |    2 -
 data/totem.1                      |    5 ---
 data/totem.ui                     |   11 ------
 docs/reference/totem-sections.txt |    1 -
 src/totem-menu.c                  |   17 ----------
 src/totem-object.c                |   62 +------------------------------------
 src/totem-options.c               |    9 -----
 src/totem-private.h               |    1 -
 src/totem.h                       |    3 --
 9 files changed, 1 insertions(+), 110 deletions(-)
---
diff --git a/README b/README
index c262716..5fd7855 100644
--- a/README
+++ b/README
@@ -29,8 +29,6 @@ gromit 20041213, for the Telestrator mode:
 Controls
 ========
 
-Ctrl+H:
-       Hide/Show controls in windowed mode
 P, Ctrl+Space:
        Play/Pause
 Escape (in full screen mode):
diff --git a/data/totem.1 b/data/totem.1
index 86e3153..d5284d7 100644
--- a/data/totem.1
+++ b/data/totem.1
@@ -111,11 +111,6 @@ Tell an already-running instance of
 .B Totem
 to toggle fullscreen mode.
 .TP
-.B --toggle-controls
-Tell an already-running instance of
-.B Totem
-to toggle showing the controls.
-.TP
 .B --quit
 Tell an already-running instance of
 .B Totem
diff --git a/data/totem.ui b/data/totem.ui
index 01337dc..e3dcbed 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -262,15 +262,6 @@
          </child>
 
          <child>
-            <object class="GtkToggleAction" id="show-controls">
-               <property name="label" translatable="yes">Show _Controls</property>
-               <property name="tooltip" translatable="yes">Show controls</property>
-               <property name="active">TRUE</property>
-               <signal name="activate" handler="show_controls_action_callback"/>
-            </object>
-            <accelerator key="H" modifiers="GDK_CONTROL_MASK"/>
-         </child>
-         <child>
                <object class="GtkToggleAction" id="sidebar">
                <property name="label" translatable="yes">S_idebar</property>
                <property name="tooltip" translatable="yes">Show or hide the sidebar</property>
@@ -417,7 +408,6 @@
                <menuitem name="aspect-ratio-dvb" action="aspect-ratio-dvb"/>
             </menu>
             <menuitem name="next-angle" action="next-angle"/>
-           <menuitem name="show-controls" action="show-controls"/>
             <separator/>
             <menu name="subtitles" action="subtitles-menu">
                <menuitem name="select-subtitle" action="select-subtitle"/>
@@ -460,7 +450,6 @@
          <menuitem name="previous-chapter" action="previous-chapter"/>
          <menuitem name="skip-forward" action="skip-forward"/>
          <menuitem name="skip-backwards" action="skip-backwards"/>
-         <menuitem name="show-controls" action="show-controls"/>
          <menuitem name="select-subtitle" action="select-subtitle"/>
          <separator/>
          <placeholder name="save-placeholder"/>
diff --git a/docs/reference/totem-sections.txt b/docs/reference/totem-sections.txt
index 5930466..cfde337 100644
--- a/docs/reference/totem-sections.txt
+++ b/docs/reference/totem-sections.txt
@@ -33,7 +33,6 @@ totem_action_volume_toggle_mute
 totem_action_toggle_aspect_ratio
 totem_action_get_aspect_ratio
 totem_action_set_aspect_ratio
-totem_action_toggle_controls
 totem_action_set_scale_ratio
 totem_action_set_playlist_index
 totem_object_action_remote
diff --git a/src/totem-menu.c b/src/totem-menu.c
index b1f29d7..9e82ffe 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -66,7 +66,6 @@ G_MODULE_EXPORT void volume_down_action_callback (GtkAction *action, Totem *tote
 G_MODULE_EXPORT void contents_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void about_action_callback (GtkAction *action, Totem *totem);
 G_MODULE_EXPORT void plugins_action_callback (GtkAction *action, Totem *totem);
-G_MODULE_EXPORT void show_controls_action_callback (GtkToggleAction *action, Totem *totem);
 G_MODULE_EXPORT void show_sidebar_action_callback (GtkToggleAction *action, Totem *totem);
 G_MODULE_EXPORT void aspect_ratio_changed_callback (GtkRadioAction *action, GtkRadioAction *current, Totem 
*totem);
 G_MODULE_EXPORT void select_subtitle_action_callback (GtkAction *action, Totem *totem);
@@ -853,22 +852,6 @@ plugins_action_callback (GtkAction *action, Totem *totem)
 }
 
 void
-show_controls_action_callback (GtkToggleAction *action, Totem *totem)
-{
-       gboolean show;
-
-       show = gtk_toggle_action_get_active (action);
-
-       /* Let's update our controls visibility */
-       if (show)
-               totem->controls_visibility = TOTEM_CONTROLS_VISIBLE;
-       else
-               totem->controls_visibility = TOTEM_CONTROLS_HIDDEN;
-
-       show_controls (totem, FALSE);
-}
-
-void
 show_sidebar_action_callback (GtkToggleAction *action, Totem *totem)
 {
        if (totem_is_fullscreen (totem))
diff --git a/src/totem-object.c b/src/totem-object.c
index 2a02543..aff3026 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -912,7 +912,6 @@ totem_remote_command_get_type (void)
                        ENUM_ENTRY (TOTEM_REMOTE_COMMAND_ENQUEUE, "enqueue"),
                        ENUM_ENTRY (TOTEM_REMOTE_COMMAND_REPLACE, "replace"),
                        ENUM_ENTRY (TOTEM_REMOTE_COMMAND_SHOW, "show"),
-                       ENUM_ENTRY (TOTEM_REMOTE_COMMAND_TOGGLE_CONTROLS, "toggle-controls"),
                        ENUM_ENTRY (TOTEM_REMOTE_COMMAND_UP, "up"),
                        ENUM_ENTRY (TOTEM_REMOTE_COMMAND_DOWN, "down"),
                        ENUM_ENTRY (TOTEM_REMOTE_COMMAND_LEFT, "left"),
@@ -1455,14 +1454,7 @@ window_state_event_cb (GtkWidget *window, GdkEventWindowState *event,
 
                totem_fullscreen_set_fullscreen (totem->fs, FALSE);
 
-               action = gtk_action_group_get_action (totem->main_action_group,
-                               "show-controls");
-
-               if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
-                       totem->controls_visibility = TOTEM_CONTROLS_VISIBLE;
-               else
-                       totem->controls_visibility = TOTEM_CONTROLS_HIDDEN;
-
+               totem->controls_visibility = TOTEM_CONTROLS_VISIBLE;
                show_controls (totem, TRUE);
        }
 
@@ -2810,7 +2802,6 @@ totem_action_open_files_list (TotemObject *totem, GSList *list)
 void
 show_controls (TotemObject *totem, gboolean was_fullscreen)
 {
-       GtkAction *action;
        GtkWidget *menubar, *controlbar, *statusbar, *bvw_box, *widget;
        GtkAllocation allocation;
        int width = 0, height = 0;
@@ -2824,8 +2815,6 @@ show_controls (TotemObject *totem, gboolean was_fullscreen)
        bvw_box = GTK_WIDGET (gtk_builder_get_object (totem->xml, "tmw_bvw_box"));
        widget = GTK_WIDGET (totem->bvw);
 
-       action = gtk_action_group_get_action (totem->main_action_group, "show-controls");
-       gtk_action_set_sensitive (action, !totem_is_fullscreen (totem));
        gtk_widget_get_allocation (widget, &allocation);
 
        if (totem->controls_visibility == TOTEM_CONTROLS_VISIBLE) {
@@ -2878,11 +2867,6 @@ show_controls (TotemObject *totem, gboolean was_fullscreen)
                                        width, height);
                }
        } else {
-               if (totem->controls_visibility == TOTEM_CONTROLS_HIDDEN) {
-                       width = allocation.width;
-                       height = allocation.height;
-               }
-
                /* Hide and make the menubar unsensitive */
                gtk_widget_set_sensitive (menubar, FALSE);
                gtk_widget_hide (menubar);
@@ -2893,37 +2877,10 @@ show_controls (TotemObject *totem, gboolean was_fullscreen)
 
                 /* We won't show controls in fullscreen */
                gtk_container_set_border_width (GTK_CONTAINER (bvw_box), 0);
-
-               if (totem->controls_visibility == TOTEM_CONTROLS_HIDDEN) {
-                       gtk_window_resize (GTK_WINDOW(totem->win),
-                                       width, height);
-               }
        }
 }
 
 /**
- * totem_action_toggle_controls:
- * @totem: a #TotemObject
- *
- * If Totem's not fullscreened, this toggles the state of the "Show Controls"
- * menu entry, and consequently shows or hides the controls in the UI.
- **/
-void
-totem_action_toggle_controls (TotemObject *totem)
-{
-       GtkAction *action;
-       gboolean state;
-
-       if (totem_is_fullscreen (totem) != FALSE)
-               return;
-
-       action = gtk_action_group_get_action (totem->main_action_group,
-               "show-controls");
-       state = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
-       gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), !state);
-}
-
-/**
  * totem_action_next_angle:
  * @totem: a #TotemObject
  *
@@ -3076,19 +3033,6 @@ totem_object_action_remote (TotemObject *totem, TotemRemoteCommand cmd, const ch
        case TOTEM_REMOTE_COMMAND_SHOW:
                gtk_window_present_with_time (GTK_WINDOW (totem->win), GDK_CURRENT_TIME);
                break;
-       case TOTEM_REMOTE_COMMAND_TOGGLE_CONTROLS:
-               if (totem->controls_visibility != TOTEM_CONTROLS_FULLSCREEN)
-               {
-                       GtkToggleAction *action;
-                       gboolean state;
-
-                       action = GTK_TOGGLE_ACTION (gtk_action_group_get_action
-                                       (totem->main_action_group,
-                                        "show-controls"));
-                       state = gtk_toggle_action_get_active (action);
-                       gtk_toggle_action_set_active (action, !state);
-               }
-               break;
        case TOTEM_REMOTE_COMMAND_UP:
                bacon_video_widget_dvd_event (totem->bvw,
                                BVW_DVD_ROOT_MENU_UP);
@@ -3502,10 +3446,6 @@ totem_action_handle_key_press (TotemObject *totem, GdkEventKey *event)
        case GDK_KEY_G:
                totem_action_next_angle (totem);
                break;
-       case GDK_KEY_h:
-       case GDK_KEY_H:
-               totem_action_toggle_controls (totem);
-               break;
        case GDK_KEY_M:
        case GDK_KEY_m:
                bacon_video_widget_dvd_event (totem->bvw, BVW_DVD_ROOT_MENU);
diff --git a/src/totem-options.c b/src/totem-options.c
index 1c6ae68..119d1a7 100644
--- a/src/totem-options.c
+++ b/src/totem-options.c
@@ -58,7 +58,6 @@ const GOptionEntry all_options[] = {
        {"volume-down", '\0', 0, G_OPTION_ARG_NONE, &optionstate.volumedown, N_("Volume Down"), NULL},
        {"mute", '\0', 0, G_OPTION_ARG_NONE, &optionstate.mute, N_("Mute sound"), NULL},
        {"fullscreen", '\0', 0, G_OPTION_ARG_NONE, &optionstate.fullscreen, N_("Toggle Fullscreen"), NULL},
-       {"toggle-controls", '\0', 0, G_OPTION_ARG_NONE, &optionstate.togglecontrols, N_("Show/Hide 
Controls"), NULL},
        {"quit", '\0', 0, G_OPTION_ARG_NONE, &optionstate.quit, N_("Quit"), NULL},
        {"enqueue", '\0', 0, G_OPTION_ARG_NONE, &optionstate.enqueue, N_("Enqueue"), NULL},
        {"replace", '\0', 0, G_OPTION_ARG_NONE, &optionstate.replace, N_("Replace"), NULL},
@@ -98,9 +97,6 @@ totem_options_get_context (void)
 void
 totem_options_process_late (Totem *totem, const TotemCmdLineOptions *options)
 {
-       if (options->togglecontrols)
-               totem_action_toggle_controls (totem);
-
        /* Handle --playlist-idx */
        totem->index = options->playlistidx;
 
@@ -220,11 +216,6 @@ totem_options_process_for_server (Totem                     *totem,
                                          (TOTEM_REMOTE_COMMAND_FULLSCREEN));
        }
 
-       if (options->togglecontrols) {
-               commands = g_list_append (commands, GINT_TO_POINTER
-                                         (TOTEM_REMOTE_COMMAND_TOGGLE_CONTROLS));
-       }
-
        /* No commands, no files, show ourselves */
        if (commands == NULL && options->filenames == NULL) {
                totem_action_remote (totem, TOTEM_REMOTE_COMMAND_SHOW, NULL);
diff --git a/src/totem-private.h b/src/totem-private.h
index 2034f82..c48b44d 100644
--- a/src/totem-private.h
+++ b/src/totem-private.h
@@ -58,7 +58,6 @@
 typedef enum {
        TOTEM_CONTROLS_UNDEFINED,
        TOTEM_CONTROLS_VISIBLE,
-       TOTEM_CONTROLS_HIDDEN,
        TOTEM_CONTROLS_FULLSCREEN
 } ControlsVisibility;
 
diff --git a/src/totem.h b/src/totem.h
index 60056ed..3904cae 100644
--- a/src/totem.h
+++ b/src/totem.h
@@ -58,7 +58,6 @@ G_BEGIN_DECLS
  * @TOTEM_REMOTE_COMMAND_ENQUEUE: enqueue a new playlist item
  * @TOTEM_REMOTE_COMMAND_REPLACE: replace an item in the playlist
  * @TOTEM_REMOTE_COMMAND_SHOW: show the Totem instance
- * @TOTEM_REMOTE_COMMAND_TOGGLE_CONTROLS: toggle the control visibility
  * @TOTEM_REMOTE_COMMAND_UP: go up (DVD controls)
  * @TOTEM_REMOTE_COMMAND_DOWN: go down (DVD controls)
  * @TOTEM_REMOTE_COMMAND_LEFT: go left (DVD controls)
@@ -91,7 +90,6 @@ typedef enum {
        TOTEM_REMOTE_COMMAND_ENQUEUE,
        TOTEM_REMOTE_COMMAND_REPLACE,
        TOTEM_REMOTE_COMMAND_SHOW,
-       TOTEM_REMOTE_COMMAND_TOGGLE_CONTROLS,
        TOTEM_REMOTE_COMMAND_UP,
        TOTEM_REMOTE_COMMAND_DOWN,
        TOTEM_REMOTE_COMMAND_LEFT,
@@ -219,7 +217,6 @@ gboolean totem_action_set_mrl_with_warning  (TotemObject *totem,
 void   totem_action_toggle_aspect_ratio        (TotemObject *totem);
 void   totem_action_set_aspect_ratio           (TotemObject *totem, int ratio);
 int    totem_action_get_aspect_ratio           (TotemObject *totem);
-void   totem_action_toggle_controls            (TotemObject *totem);
 void   totem_action_next_angle                 (TotemObject *totem);
 
 void   totem_action_set_scale_ratio            (TotemObject *totem, gfloat ratio);


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