[ekiga/ds-gsettings2: 31/33] Rebased and fixed conflicts.



commit 7e550f0530ce1baea66145b4d64a3dc164f97bac
Author: Damien Sandras <dsandras beip be>
Date:   Sat Oct 5 11:00:21 2013 +0200

    Rebased and fixed conflicts.

 lib/Makefile.am                                    |    8 ++--
 lib/ekiga-settings.h                               |    8 ++-
 lib/engine/gui/gtk-frontend/accounts-window.cpp    |    5 +-
 lib/engine/gui/gtk-frontend/accounts-window.h      |    3 +-
 lib/engine/gui/gtk-frontend/addressbook-window.cpp |    5 +-
 lib/engine/gui/gtk-frontend/addressbook-window.h   |    4 +-
 lib/engine/gui/gtk-frontend/assistant-window.cpp   |   52 +-------------------
 lib/engine/gui/gtk-frontend/chat-window.cpp        |    4 +-
 lib/engine/gui/gtk-frontend/chat-window.h          |    3 +-
 lib/engine/gui/gtk-frontend/gtk-frontend.cpp       |   18 +++++--
 lib/engine/gui/gtk-frontend/preferences-window.cpp |   37 +++++---------
 11 files changed, 54 insertions(+), 93 deletions(-)
---
diff --git a/lib/Makefile.am b/lib/Makefile.am
index e5c539c..898e18d 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -336,7 +336,7 @@ libekiga_la_SOURCES += \
        engine/videooutput/videooutput-info.h \
        engine/videooutput/videooutput-manager.h \
        engine/videooutput/videooutput-core.h \
-       engine/videooutput/videooutput-core.cpp \
+       engine/videooutput/videooutput-core.cpp
 
 ##
 # Sources of the video input stack
@@ -346,7 +346,7 @@ libekiga_la_SOURCES += \
        engine/videoinput/videoinput-manager.h \
        engine/videoinput/videoinput-info.h \
        engine/videoinput/videoinput-core.h \
-       engine/videoinput/videoinput-core.cpp \
+       engine/videoinput/videoinput-core.cpp
 
 ##
 # Sources of the audio output stack
@@ -358,7 +358,7 @@ libekiga_la_SOURCES += \
        engine/audiooutput/audiooutput-scheduler.h \
        engine/audiooutput/audiooutput-scheduler.cpp \
        engine/audiooutput/audiooutput-core.h \
-       engine/audiooutput/audiooutput-core.cpp \
+       engine/audiooutput/audiooutput-core.cpp
 
 ##
 # Sources of the audio input stack
@@ -368,7 +368,7 @@ libekiga_la_SOURCES += \
        engine/audioinput/audioinput-manager.h  \
        engine/audioinput/audioinput-info.h     \
        engine/audioinput/audioinput-core.h     \
-       engine/audioinput/audioinput-core.cpp       \
+       engine/audioinput/audioinput-core.cpp
 
 ##
 # Sources of the hardware abstraction layer (HAL) stack
diff --git a/lib/ekiga-settings.h b/lib/ekiga-settings.h
index 628b100..a637f9e 100644
--- a/lib/ekiga-settings.h
+++ b/lib/ekiga-settings.h
@@ -39,9 +39,13 @@
 #ifndef EKIGA_SETTINGS_H_
 #define EKIGA_SETTINGS_H_
 
-#include <boost/signals.hpp>
+#include <boost/smart_ptr.hpp>
+#include <boost/signals2.hpp>
+
 #include <gio/gio.h>
 
+#include "config.h"
+
 #define USER_INTERFACE "org.gnome." PACKAGE_NAME ".general.user-interface"
 #define PROTOCOLS "org.gnome." PACKAGE_NAME ".protocols"
 
@@ -87,7 +91,7 @@ public:
       return gsettings;
     }
 
-    boost::signal1<void, std::string> changed;
+    boost::signals2::signal<void(std::string)> changed;
 
 private:
     gulong handler;
diff --git a/lib/engine/gui/gtk-frontend/accounts-window.cpp b/lib/engine/gui/gtk-frontend/accounts-window.cpp
index 336de11..a31833d 100644
--- a/lib/engine/gui/gtk-frontend/accounts-window.cpp
+++ b/lib/engine/gui/gtk-frontend/accounts-window.cpp
@@ -523,7 +523,8 @@ accounts_window_class_init (AccountsWindowClass *klass)
 /* Public API */
 GtkWidget *
 accounts_window_new (boost::shared_ptr<Ekiga::AccountCore> account_core,
-                    boost::shared_ptr<Ekiga::PersonalDetails> details)
+                    boost::shared_ptr<Ekiga::PersonalDetails> details,
+                    const char* key)
 {
   AccountsWindow *self = NULL;
 
@@ -561,7 +562,7 @@ accounts_window_new (boost::shared_ptr<Ekiga::AccountCore> account_core,
   };
 
   /* The window */
-  self = (AccountsWindow *) g_object_new (ACCOUNTS_WINDOW_TYPE, NULL);
+  self = (AccountsWindow *) g_object_new (ACCOUNTS_WINDOW_TYPE, "key", key, NULL);
 
   self->priv = new AccountsWindowPrivate;
   self->priv->details = details;
diff --git a/lib/engine/gui/gtk-frontend/accounts-window.h b/lib/engine/gui/gtk-frontend/accounts-window.h
index eba1468..13afbb7 100644
--- a/lib/engine/gui/gtk-frontend/accounts-window.h
+++ b/lib/engine/gui/gtk-frontend/accounts-window.h
@@ -88,6 +88,7 @@ GType accounts_window_get_type ();
  * PRE          : /
  */
 GtkWidget* accounts_window_new (boost::shared_ptr<Ekiga::AccountCore> account_core,
-                               boost::shared_ptr<Ekiga::PersonalDetails> details);
+                               boost::shared_ptr<Ekiga::PersonalDetails> details,
+                               const char* key);
 
 #endif
diff --git a/lib/engine/gui/gtk-frontend/addressbook-window.cpp 
b/lib/engine/gui/gtk-frontend/addressbook-window.cpp
index a60ec16..4bb31f0 100644
--- a/lib/engine/gui/gtk-frontend/addressbook-window.cpp
+++ b/lib/engine/gui/gtk-frontend/addressbook-window.cpp
@@ -600,7 +600,8 @@ addressbook_window_class_init (AddressBookWindowClass *klass)
  * Public API 
  */
 GtkWidget *
-addressbook_window_new (boost::shared_ptr<Ekiga::ContactCore> core)
+addressbook_window_new (boost::shared_ptr<Ekiga::ContactCore> core,
+                       const char* key)
 {
   AddressBookWindow *self = NULL;
 
@@ -615,7 +616,7 @@ addressbook_window_new (boost::shared_ptr<Ekiga::ContactCore> core)
   GtkTreeViewColumn *column = NULL;
   GtkTreeStore *store = NULL;
 
-  self = (AddressBookWindow *) g_object_new (ADDRESSBOOK_WINDOW_TYPE, NULL);
+  self = (AddressBookWindow *) g_object_new (ADDRESSBOOK_WINDOW_TYPE, "key", key, NULL);
   self->priv = new AddressBookWindowPrivate (core);
 
   gtk_window_set_title (GTK_WINDOW (self), _("Address Book"));
diff --git a/lib/engine/gui/gtk-frontend/addressbook-window.h 
b/lib/engine/gui/gtk-frontend/addressbook-window.h
index d14a8f3..6e81fb9 100644
--- a/lib/engine/gui/gtk-frontend/addressbook-window.h
+++ b/lib/engine/gui/gtk-frontend/addressbook-window.h
@@ -78,6 +78,6 @@ GType addressbook_window_get_type ();
 
 
 /* public api */
-GtkWidget* addressbook_window_new (boost::shared_ptr<Ekiga::ContactCore> core);
-
+GtkWidget* addressbook_window_new (boost::shared_ptr<Ekiga::ContactCore> core,
+                                  const char* key);
 #endif
diff --git a/lib/engine/gui/gtk-frontend/assistant-window.cpp 
b/lib/engine/gui/gtk-frontend/assistant-window.cpp
index 410652a..2d0fb33 100644
--- a/lib/engine/gui/gtk-frontend/assistant-window.cpp
+++ b/lib/engine/gui/gtk-frontend/assistant-window.cpp
@@ -49,6 +49,8 @@
 #include "opal-bank.h"
 #include "device-lists.h"
 
+#include "gmconf.h"
+
 #include <gdk/gdkkeysyms.h>
 
 G_DEFINE_TYPE (AssistantWindow, assistant_window, GTK_TYPE_ASSISTANT);
@@ -632,54 +634,6 @@ apply_ekiga_out_page (AssistantWindow *assistant)
 
 
 static void
-apply_audio_devices_page (AssistantWindow */*assistant*/)
-{
-  gchar *ringer, *player, *recorder;
-
-  ringer = gm_conf_get_string (SOUND_EVENTS_KEY "output_device");
-  if (ringer == NULL || !ringer[0]) {
-    ringer = g_strdup (DEFAULT_AUDIO_DEVICE_NAME);
-    gm_conf_set_string (SOUND_EVENTS_KEY "output_device", ringer);
-  }
-  g_free (ringer);
-
-  player = gm_conf_get_string (AUDIO_DEVICES_KEY "output_device");
-  if (player == NULL || !player[0]) {
-    player = g_strdup (DEFAULT_AUDIO_DEVICE_NAME);
-    gm_conf_set_string (AUDIO_DEVICES_KEY "output_device", player);
-  }
-  g_free (player);
-
-  recorder = gm_conf_get_string (AUDIO_DEVICES_KEY "input_device");
-  if (recorder == NULL || !recorder[0]) {
-    recorder = g_strdup (DEFAULT_AUDIO_DEVICE_NAME);
-    gm_conf_set_string (AUDIO_DEVICES_KEY "input_device", recorder);
-  }
-  g_free (recorder);
-}
-
-
-static void
-apply_video_devices_page (AssistantWindow *assistant)
-{
-  std::vector <std::string> device_list;
-  gchar** array;
-  gchar* current_plugin;
-
-  current_plugin = gm_conf_get_string (VIDEO_DEVICES_KEY "input_device");
-  if (current_plugin == NULL || !current_plugin[0]) {
-    g_free (current_plugin);
-    get_videoinput_devices (assistant->priv->videoinput_core, device_list);
-    array = vector_of_string_to_array (device_list);
-    current_plugin = g_strdup (get_default_video_device_name (array));
-    g_free (array);
-    gm_conf_set_string (VIDEO_DEVICES_KEY "input_device", current_plugin);
-  }
-  g_free (current_plugin);
-}
-
-
-static void
 create_summary_page (AssistantWindow *assistant)
 {
   GtkWidget *vbox;
@@ -857,8 +811,6 @@ assistant_window_apply (GtkAssistant *gtkassistant)
   apply_personal_data_page (assistant);
   apply_ekiga_net_page (assistant);
   apply_ekiga_out_page (assistant);
-  apply_audio_devices_page (assistant);
-  apply_video_devices_page (assistant);
 
   /* Hide the assistant and show the main Ekiga window */
   gtk_widget_hide (GTK_WIDGET (assistant));
diff --git a/lib/engine/gui/gtk-frontend/chat-window.cpp b/lib/engine/gui/gtk-frontend/chat-window.cpp
index f4970c3..ad71225 100644
--- a/lib/engine/gui/gtk-frontend/chat-window.cpp
+++ b/lib/engine/gui/gtk-frontend/chat-window.cpp
@@ -443,12 +443,14 @@ chat_window_init (ChatWindow* self)
 /* public api */
 
 GtkWidget*
-chat_window_new (Ekiga::ServiceCore& core)
+chat_window_new (Ekiga::ServiceCore& core,
+                const char* key)
 {
   ChatWindow* self = NULL;
   GtkAccelGroup *accel = NULL;
 
   self = (ChatWindow*)g_object_new (CHAT_WINDOW_TYPE,
+                                   "key", key,
                                     "hide_on_esc", FALSE,
                                    NULL);
 
diff --git a/lib/engine/gui/gtk-frontend/chat-window.h b/lib/engine/gui/gtk-frontend/chat-window.h
index a75429b..1d7c3e1 100644
--- a/lib/engine/gui/gtk-frontend/chat-window.h
+++ b/lib/engine/gui/gtk-frontend/chat-window.h
@@ -69,7 +69,8 @@ struct _ChatWindowClass
 
 /* Public API */
 
-GtkWidget* chat_window_new (Ekiga::ServiceCore& core);
+GtkWidget* chat_window_new (Ekiga::ServiceCore& core,
+                           const char* key);
 
 /* GObject's boilerplate */
 
diff --git a/lib/engine/gui/gtk-frontend/gtk-frontend.cpp b/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
index dbdf67d..ea404be 100644
--- a/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
+++ b/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
@@ -154,11 +154,15 @@ GtkFrontend::build ()
   gtk_window_set_default_icon_name (GM_ICON_LOGO);
 
   addressbook_window =
-<<<<<<< HEAD
-    boost::shared_ptr<GtkWidget>(addressbook_window_new_with_key (contact_core, USER_INTERFACE 
".addressbook-window"), gtk_widget_destroy);
+    boost::shared_ptr<GtkWidget>(addressbook_window_new (contact_core,
+                                                        USER_INTERFACE ".addressbook-window"),
+                                gtk_widget_destroy);
 
   accounts_window =
-    boost::shared_ptr<GtkWidget> (accounts_window_new_with_key (account_core, USER_INTERFACE 
".accounts-window", details), gtk_widget_destroy);
+    boost::shared_ptr<GtkWidget>(accounts_window_new (account_core,
+                                                     details, 
+                                                     USER_INTERFACE ".accounts-window"),
+                                gtk_widget_destroy);
 
   // BEWARE: uses the main window during runtime
   assistant_window =
@@ -168,10 +172,14 @@ GtkFrontend::build ()
     boost::shared_ptr<GtkWidget> (call_window_new (core), gtk_widget_destroy);
 
   chat_window =
-    boost::shared_ptr<GtkWidget> (chat_window_new (core, USER_INTERFACE ".chat-window"), gtk_widget_destroy);
+    boost::shared_ptr<GtkWidget> (chat_window_new (core,
+                                                  USER_INTERFACE ".chat-window"),
+                                 gtk_widget_destroy);
 
+  // FIXME: GmWindow ?
   preferences_window =
-    boost::shared_ptr<GtkWidget> (preferences_window_new (core), gtk_widget_destroy);
+    boost::shared_ptr<GtkWidget> (preferences_window_new (core),
+                                 gtk_widget_destroy);
 
   // BEWARE: the status icon needs the chat window at startup
   // FIXME: the above BEWARE is related to a FIXME in the main window code,
diff --git a/lib/engine/gui/gtk-frontend/preferences-window.cpp 
b/lib/engine/gui/gtk-frontend/preferences-window.cpp
index 0748d09..af7075b 100644
--- a/lib/engine/gui/gtk-frontend/preferences-window.cpp
+++ b/lib/engine/gui/gtk-frontend/preferences-window.cpp
@@ -65,6 +65,7 @@
 
 typedef struct _GmPreferencesWindow
 {
+  _GmPreferencesWindow();
   ~_GmPreferencesWindow();
 
   GtkWidget *audio_codecs_list;
@@ -86,7 +87,7 @@ typedef struct _GmPreferencesWindow
 
 #define GM_PREFERENCES_WINDOW(x) (GmPreferencesWindow *) (x)
 
-_GmPreferencesWindow::_GmPreferencesWindow(Ekiga::ServiceCore &_core): core(_core)
+_GmPreferencesWindow::_GmPreferencesWindow()
 {
   sound_events_settings = g_settings_new (SOUND_EVENTS_SCHEMA);
   audio_devices_settings = g_settings_new (AUDIO_DEVICES_SCHEMA);
@@ -843,8 +844,6 @@ gm_pw_init_audio_devices_page (GtkWidget *prefs_window,
 
 
 static void
-<<<<<<< HEAD
-=======
 gm_prefs_window_get_videoinput_devices_list (Ekiga::ServiceCore& core,
                                              std::vector<std::string> & device_list)
 {
@@ -1045,7 +1044,7 @@ gm_pw_init_video_codecs_page (GtkWidget *prefs_window,
 
 
 GtkWidget *
-gm_pw_string_option_menu_new (GtkWidget *table,
+gm_pw_string_option_menu_new (GtkWidget *grid,
                               const gchar *label_txt,
                               const gchar **options,
                               GSettings *settings,
@@ -1072,10 +1071,8 @@ gm_pw_string_option_menu_new (GtkWidget *table,
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
 
-  gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (GTK_FILL),
-                    0, 0);
+  g_object_set (G_OBJECT (label), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), label, 0, row, 1, 1);
 
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
@@ -1125,10 +1122,8 @@ gm_pw_string_option_menu_new (GtkWidget *table,
   }
 
   gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu), history);
-  gtk_table_attach (GTK_TABLE (table), option_menu, 1, 2, row, row+1,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (GTK_FILL),
-                    0, 0);
+  g_object_set (G_OBJECT (option_menu), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), option_menu, 1, row, 1, 1);
 
   gtk_widget_set_tooltip_text (option_menu, tooltip);
 
@@ -1144,14 +1139,14 @@ gm_pw_string_option_menu_new (GtkWidget *table,
   g_free (signal_name);
 
   g_free (conf_string);
-  gtk_widget_show_all (table);
+  gtk_widget_show_all (grid);
 
   return option_menu;
 }
 
 
 GtkWidget *
-gm_pw_int_option_menu_new (GtkWidget *table,
+gm_pw_int_option_menu_new (GtkWidget *grid,
                            const gchar *label_txt,
                            const gchar **options,
                            GSettings *settings,
@@ -1178,10 +1173,8 @@ gm_pw_int_option_menu_new (GtkWidget *table,
   if (!writable)
     gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
 
-  gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (GTK_FILL),
-                    0, 0);
+  g_object_set (G_OBJECT (label), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), label, 0, row, 1, 1);
 
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
@@ -1214,10 +1207,8 @@ gm_pw_int_option_menu_new (GtkWidget *table,
   }
 
   gtk_combo_box_set_active (GTK_COMBO_BOX (option_menu), history);
-  gtk_table_attach (GTK_TABLE (table), option_menu, 1, 2, row, row+1,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (GTK_FILL),
-                    0, 0);
+  g_object_set (G_OBJECT (option_menu), "expand", TRUE, NULL);
+  gtk_grid_attach (GTK_GRID (grid), option_menu, 1, row, 1, 1);
 
   if (tooltip)
     gtk_widget_set_tooltip_text (option_menu, tooltip);
@@ -1233,7 +1224,7 @@ gm_pw_int_option_menu_new (GtkWidget *table,
                     G_CALLBACK (int_option_setting_changed), option_menu);
   g_free (signal_name);
 
-  gtk_widget_show_all (table);
+  gtk_widget_show_all (grid);
 
   return option_menu;
 }


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