Blame SOURCES/0025-cheese-Remove-last-remnants-of-the-old-menu-code.patch

ecdf9b
From 29a1bab965e67b39eb0eef44038a1400d6de6029 Mon Sep 17 00:00:00 2001
ecdf9b
From: Hans de Goede <hdegoede@redhat.com>
ecdf9b
Date: Wed, 12 Jun 2013 17:26:25 +0200
ecdf9b
Subject: [PATCH 25/35] cheese: Remove last remnants of the old menu code
ecdf9b
ecdf9b
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ecdf9b
---
ecdf9b
 data/cheese-actions.ui | 18 -----------
ecdf9b
 src/cheese-window.vala | 85 +++++++++++++++++---------------------------------
ecdf9b
 2 files changed, 29 insertions(+), 74 deletions(-)
ecdf9b
ecdf9b
diff --git a/data/cheese-actions.ui b/data/cheese-actions.ui
ecdf9b
index 2374c36..8657c08 100644
ecdf9b
--- a/data/cheese-actions.ui
ecdf9b
+++ b/data/cheese-actions.ui
ecdf9b
@@ -46,24 +46,6 @@
ecdf9b
           </object>
ecdf9b
           <accelerator key="Delete" modifiers="GDK_SHIFT_MASK"/>
ecdf9b
         </child>
ecdf9b
-        <child>
ecdf9b
-          <object class="GtkAction" id="move_all_to_trash">
ecdf9b
-            <property name="name">RemoveAll</property>
ecdf9b
-            <property name="label" translatable="yes">Move _All to Trash</property>
ecdf9b
-            <signal name="activate" handler="cheese_main_window_on_file_move_to_trash_all"/>
ecdf9b
-          </object>
ecdf9b
-        </child>
ecdf9b
-      </object>
ecdf9b
-    </child>
ecdf9b
-    <child>
ecdf9b
-      <object class="GtkActionGroup" id="layout_actions">
ecdf9b
-        <child>
ecdf9b
-          <object class="GtkToggleAction" id="wide_mode">
ecdf9b
-            <property name="name">WideMode</property>
ecdf9b
-            <property name="label" translatable="yes">_Wide Mode</property>
ecdf9b
-            <signal name="toggled" handler="cheese_main_window_on_layout_wide_mode"/>
ecdf9b
-          </object>
ecdf9b
-        </child>
ecdf9b
       </object>
ecdf9b
     </child>
ecdf9b
     <child>
ecdf9b
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
ecdf9b
index e8ccb47..6425a7f 100644
ecdf9b
--- a/src/cheese-window.vala
ecdf9b
+++ b/src/cheese-window.vala
ecdf9b
@@ -79,7 +79,6 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
   private List<Clutter.Box> effects_grids;
ecdf9b
 
ecdf9b
   private HashTable<string, bool> action_sensitivities;
ecdf9b
-  private Gtk.ToggleAction wide_mode_action;
ecdf9b
   private Gtk.Action       countdown_action;
ecdf9b
   private Gtk.Action       effects_page_prev_action;
ecdf9b
   private Gtk.Action       effects_page_next_action;
ecdf9b
@@ -494,41 +493,6 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
   }
ecdf9b
 
ecdf9b
   /**
ecdf9b
-   * Toggle wide mode and save the preference to GSettings.
ecdf9b
-   *
ecdf9b
-   * @param action the action that emitted the signal
ecdf9b
-   */
ecdf9b
-  [CCode (instance_pos = -1)]
ecdf9b
-  public void on_layout_wide_mode (ToggleAction action)
ecdf9b
-  {
ecdf9b
-    if (!is_command_line_startup)
ecdf9b
-    {
ecdf9b
-     /* Don't save to settings when using -w mode from command-line, so
ecdf9b
-      * command-line options change the mode for one run only. */
ecdf9b
-      settings.set_boolean ("wide-mode", action.active);
ecdf9b
-    }
ecdf9b
-    set_wide_mode (action.active);
ecdf9b
-  }
ecdf9b
-
ecdf9b
-    /**
ecdf9b
-     * Toggle fullscreen mode and save the preference to GSettings.
ecdf9b
-     *
ecdf9b
-     * @param fullscreen whether the window should be fullscreean
ecdf9b
-     */
ecdf9b
-    [CCode (instance_pos = -1)]
ecdf9b
-    public void set_fullscreen (bool fullscreen)
ecdf9b
-    {
ecdf9b
-        if (!is_command_line_startup)
ecdf9b
-        {
ecdf9b
-            /* Don't save to settings when using -f mode from command-line, so
ecdf9b
-             * command-line options change the mode for one run only. */
ecdf9b
-            settings.set_boolean ("fullscreen", fullscreen);
ecdf9b
-        }
ecdf9b
-
ecdf9b
-        set_fullscreen_mode (fullscreen);
ecdf9b
-    }
ecdf9b
-
ecdf9b
-  /**
ecdf9b
    * Make the media capture mode actions sensitive.
ecdf9b
    */
ecdf9b
   private void enable_mode_change ()
ecdf9b
@@ -657,19 +621,28 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
   }
ecdf9b
 
ecdf9b
   /**
ecdf9b
-   * Enable or disable fullscreen mode to the requested state.
ecdf9b
+   * Enable or disable fullscreen mode
ecdf9b
    *
ecdf9b
-   * @param fullscreen_mode whether to enable or disable fullscreen mode
ecdf9b
+   * @param fullscreen whether the window should be fullscreean
ecdf9b
    */
ecdf9b
-  private void set_fullscreen_mode (bool fullscreen_mode)
ecdf9b
+  [CCode (instance_pos = -1)]
ecdf9b
+  public void set_fullscreen (bool fullscreen)
ecdf9b
   {
ecdf9b
     /* After the first time the window has been shown using this.show_all (),
ecdf9b
      * the value of leave_fullscreen_button_container.no_show_all should be set to false
ecdf9b
      * So that the next time leave_fullscreen_button_container.show_all () is called, the button is actually shown
ecdf9b
      * FIXME: If this code can be made cleaner/clearer, please do */
ecdf9b
 
ecdf9b
-    is_fullscreen = fullscreen_mode;
ecdf9b
-    if (fullscreen_mode)
ecdf9b
+    is_fullscreen = fullscreen;
ecdf9b
+
ecdf9b
+    if (!is_command_line_startup)
ecdf9b
+    {
ecdf9b
+      /* Don't save to settings when using -f mode from command-line, so
ecdf9b
+       * command-line options change the mode for one run only. */
ecdf9b
+      settings.set_boolean ("fullscreen", is_fullscreen);
ecdf9b
+    }
ecdf9b
+
ecdf9b
+    if (is_fullscreen)
ecdf9b
     {
ecdf9b
       if (is_wide_mode)
ecdf9b
       {
ecdf9b
@@ -722,14 +695,23 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
   }
ecdf9b
 
ecdf9b
   /**
ecdf9b
-   * Enable or disable wide mode to the requested state.
ecdf9b
+   * Enable or disable wide mode to the requested state and save the
ecdf9b
+   * preference to GSettings.
ecdf9b
    *
ecdf9b
    * @param wide_mode whether to enable or disable wide mode
ecdf9b
    */
ecdf9b
-  private void set_wide_mode (bool wide_mode)
ecdf9b
+  [CCode (instance_pos = -1)]
ecdf9b
+  public void set_wide_mode (bool wide_mode)
ecdf9b
   {
ecdf9b
     is_wide_mode = wide_mode;
ecdf9b
 
ecdf9b
+    if (!is_command_line_startup)
ecdf9b
+    {
ecdf9b
+     /* Don't save to settings when using -w mode from command-line, so
ecdf9b
+      * command-line options change the mode for one run only. */
ecdf9b
+      settings.set_boolean ("wide-mode", is_wide_mode);
ecdf9b
+    }
ecdf9b
+
ecdf9b
     /* keep the viewport to its current size while rearranging the ui,
ecdf9b
      * so that thumbview moves from right to bottom and viceversa
ecdf9b
      * while the rest of the window stays unchanged */
ecdf9b
@@ -1298,13 +1280,12 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
 
ecdf9b
           /* Keep only these actions sensitive. */
ecdf9b
           string [] active_actions = { "quit",
ecdf9b
-                                       "help_contents",
ecdf9b
+                                       "help",
ecdf9b
                                        "about",
ecdf9b
                                        "open",
ecdf9b
                                        "save_as",
ecdf9b
                                        "move_to_trash",
ecdf9b
-                                       "delete",
ecdf9b
-                                       "move_all_to_trash"};
ecdf9b
+                                       "delete"};
ecdf9b
 
ecdf9b
           /* Gross hack because Vala's `in` operator doesn't really work */
ecdf9b
           bool flag;
ecdf9b
@@ -1358,7 +1339,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
     }
ecdf9b
 
ecdf9b
     is_command_line_startup = true;
ecdf9b
-    wide_mode_action.set_active (true);
ecdf9b
+    set_wide_mode (true);
ecdf9b
     is_command_line_startup = false;
ecdf9b
   }
ecdf9b
 
ecdf9b
@@ -1414,7 +1395,6 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
     thumbnail_popup                   = gtk_builder.get_object ("thumbnail_popup") as Gtk.Menu;
ecdf9b
 
ecdf9b
     countdown_action         = gtk_builder.get_object ("countdown") as Gtk.Action;
ecdf9b
-    wide_mode_action         = gtk_builder.get_object ("wide_mode") as Gtk.ToggleAction;
ecdf9b
     effects_page_next_action = gtk_builder.get_object ("effects_page_next") as Gtk.Action;
ecdf9b
     effects_page_prev_action = gtk_builder.get_object ("effects_page_prev") as Gtk.Action;
ecdf9b
     share_action             = gtk_builder.get_object ("share") as Gtk.Action;
ecdf9b
@@ -1477,14 +1457,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
      * if the widget is not realized */
ecdf9b
     viewport_widget.realize ();
ecdf9b
 
ecdf9b
-    /* call set_active instead of our set_wide_mode so that the toggle
ecdf9b
-     * action state is updated */
ecdf9b
-    wide_mode_action.set_active (settings.get_boolean ("wide-mode"));
ecdf9b
-
ecdf9b
-    /* apparently set_active doesn't emit toggled nothing has
ecdf9b
-     * changed, do it manually */
ecdf9b
-    if (!settings.get_boolean ("wide-mode"))
ecdf9b
-      wide_mode_action.toggled ();
ecdf9b
+    set_wide_mode (settings.get_boolean ("wide-mode"));
ecdf9b
 
ecdf9b
     set_mode (MediaMode.PHOTO);
ecdf9b
     setup_effects_selector ();
ecdf9b
-- 
ecdf9b
1.8.2.1
ecdf9b