Blame SOURCES/0027-cheese-Get-rid-of-special-set_startup_foo-functions.patch

ecdf9b
From 6fc5ec37186612c38d1a94c1b1eb4b1b5b5078cf Mon Sep 17 00:00:00 2001
ecdf9b
From: Hans de Goede <hdegoede@redhat.com>
ecdf9b
Date: Wed, 12 Jun 2013 17:59:13 +0200
ecdf9b
Subject: [PATCH 27/50] cheese: Get rid of special set_startup_foo() functions
ecdf9b
ecdf9b
So that cheese-main can toggle / activate the related actions when parsing
ecdf9b
the cmdline and thus have the action state properly reflects the actual state,
ecdf9b
avoiding ie the need to press F11 twice to leave fullscreen after starting
ecdf9b
cheese with -f.
ecdf9b
ecdf9b
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ecdf9b
---
ecdf9b
 src/cheese-main.vala   |  7 +++++--
ecdf9b
 src/cheese-window.vala | 31 ++-----------------------------
ecdf9b
 2 files changed, 7 insertions(+), 31 deletions(-)
ecdf9b
ecdf9b
diff --git a/src/cheese-main.vala b/src/cheese-main.vala
ecdf9b
index 5905597..e4f2460 100644
ecdf9b
--- a/src/cheese-main.vala
ecdf9b
+++ b/src/cheese-main.vala
ecdf9b
@@ -126,9 +126,12 @@ public class Cheese.Main : Gtk.Application
ecdf9b
       main_window.start_thumbview_monitors ();
ecdf9b
 
ecdf9b
       if (wide)
ecdf9b
-        main_window.set_startup_wide_mode ();
ecdf9b
+        main_window.set_wide_mode (true);
ecdf9b
       if (fullscreen)
ecdf9b
-        main_window.set_startup_fullscreen_mode ();
ecdf9b
+        main_window.set_fullscreen (true);
ecdf9b
+
ecdf9b
+      /* Tell the main window to save any changes from here on to GSettings */
ecdf9b
+      main_window.is_command_line_startup = false;
ecdf9b
 
ecdf9b
       /* Shoot when the webcam capture button is pressed. */
ecdf9b
       main_window.add_events (Gdk.EventMask.KEY_PRESS_MASK
ecdf9b
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
ecdf9b
index 35e4850..8916e95 100644
ecdf9b
--- a/src/cheese-window.vala
ecdf9b
+++ b/src/cheese-window.vala
ecdf9b
@@ -92,7 +92,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
   private bool is_effects_selector_active;
ecdf9b
   private bool is_camera_actions_sensitive;
ecdf9b
   private bool action_cancelled;
ecdf9b
-  private bool is_command_line_startup;
ecdf9b
+  public  bool is_command_line_startup;
ecdf9b
 
ecdf9b
   private Gtk.Button[] buttons;
ecdf9b
 
ecdf9b
@@ -121,6 +121,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
     public MainWindow (Gtk.Application application)
ecdf9b
     {
ecdf9b
         GLib.Object (application: application);
ecdf9b
+        is_command_line_startup = true;
ecdf9b
     }
ecdf9b
 
ecdf9b
   /**
ecdf9b
@@ -1336,34 +1337,6 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
     }
ecdf9b
 
ecdf9b
   /**
ecdf9b
-   * Set wide mode active when started from the command line (and do not change
ecdf9b
-   * the GSetting).
ecdf9b
-   */
ecdf9b
-  public void set_startup_wide_mode ()
ecdf9b
-  {
ecdf9b
-    if (is_wide_mode)
ecdf9b
-    {
ecdf9b
-      /* Cheese was already in wide mode, avoid setting it again. */
ecdf9b
-      return;
ecdf9b
-    }
ecdf9b
-
ecdf9b
-    is_command_line_startup = true;
ecdf9b
-    set_wide_mode (true);
ecdf9b
-    is_command_line_startup = false;
ecdf9b
-  }
ecdf9b
-
ecdf9b
-  /**
ecdf9b
-   * Set fullscreen mode active when started from the command line (and do not
ecdf9b
-   * change the GSetting).
ecdf9b
-   */
ecdf9b
-  public void set_startup_fullscreen_mode ()
ecdf9b
-  {
ecdf9b
-    is_command_line_startup = true;
ecdf9b
-    set_fullscreen (true);
ecdf9b
-    is_command_line_startup = false;
ecdf9b
-  }
ecdf9b
-
ecdf9b
-  /**
ecdf9b
    * Load the UI from the GtkBuilder description.
ecdf9b
    */
ecdf9b
   public void setup_ui ()
ecdf9b
-- 
ecdf9b
1.8.2.1
ecdf9b