[empathy] Save the video preview position in gsettings



commit 44f6461a975b9b2e309fae4ff052eb12df99704a
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Tue Aug 30 09:00:06 2011 +0100

    Save the video preview position in gsettings
    
    And place it in the last used position when starting a new call.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656889

 data/org.gnome.Empathy.gschema.xml.in |   13 +++++++++++++
 src/empathy-call-window.c             |    7 +++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/data/org.gnome.Empathy.gschema.xml.in b/data/org.gnome.Empathy.gschema.xml.in
index f51b51b..6f8f146 100644
--- a/data/org.gnome.Empathy.gschema.xml.in
+++ b/data/org.gnome.Empathy.gschema.xml.in
@@ -1,4 +1,12 @@
 <schemalist>
+
+  <enum id="position">
+    <value nick="top-left" value="1"/>
+    <value nick="top-right" value="2"/>
+    <value nick="bottom-left" value="3"/>
+    <value nick="bottom-right" value="4"/>
+  </enum>
+
   <schema id="org.gnome.Empathy" path="/org/gnome/empathy/">
     <key name="use-conn" type="b">
       <default>true</default>
@@ -236,6 +244,11 @@ present them to the user immediately.</_description>
       <_summary>Camera device</_summary>
       <_description>Default camera device to use in video calls, e.g. /dev/video0.</_description>
     </key>
+    <key name="camera-position" enum="position">
+      <default>'bottom-left'</default>
+      <_summary>Camera position</_summary>
+      <_description>Position the camera preview should be during a call.</_description>
+    </key>
     <key name="echo-cancellation" type="b">
       <default>true</default>
       <_summary>Echo cancellation support</_summary>
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index c1cf561..0fd81ee 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -810,6 +810,8 @@ empathy_call_window_move_video_preview (EmpathyCallWindow *self,
       default:
         g_warn_if_reached ();
     }
+
+  g_settings_set_enum (self->priv->settings, "camera-position", pos);
 }
 
 static void
@@ -985,9 +987,12 @@ create_video_preview (EmpathyCallWindow *self)
   ClutterActor *b;
   ClutterAction *action;
   GtkWidget *button;
+  PreviewPosition pos;
 
   g_assert (priv->video_preview == NULL);
 
+  pos = g_settings_get_enum (priv->settings, "camera-position");
+
   preview = empathy_rounded_texture_new ();
   clutter_actor_set_size (preview,
       SELF_VIDEO_SECTION_WIDTH, SELF_VIDEO_SECTION_HEIGHT);
@@ -1072,6 +1077,8 @@ create_video_preview (EmpathyCallWindow *self)
       CLUTTER_BIN_ALIGNMENT_START,
       CLUTTER_BIN_ALIGNMENT_END);
 
+  empathy_call_window_move_video_preview (self, pos);
+
   action = clutter_drag_action_new ();
   g_signal_connect (action, "drag-begin",
       G_CALLBACK (empathy_call_window_preview_on_drag_begin_cb), self);



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