[ekiga] Moved the PrefsWindow to the GtkFrontend part of the engine.



commit 277d2de1a1aa90c30ed00245eff6bfb352038c2f
Author: Damien Sandras <dsandras beip be>
Date:   Sat May 12 18:32:31 2012 +0200

    Moved the PrefsWindow to the GtkFrontend part of the engine.
    
    It belongs there. Everything belongs there except main.cpp which inits
    The Thing.

 lib/Makefile.am                                    |    4 ++
 .../engine/gui/gtk-frontend}/default_devices.cpp   |    0
 .../engine/gui/gtk-frontend}/default_devices.h     |    0
 lib/engine/gui/gtk-frontend/gtk-frontend.cpp       |    8 ++++
 lib/engine/gui/gtk-frontend/gtk-frontend.h         |    3 +
 .../engine/gui/gtk-frontend/preferences-window.cpp |   40 +++++++++++++++-----
 .../engine/gui/gtk-frontend/preferences-window.h   |    5 +-
 src/Makefile.am                                    |    4 --
 src/ekiga.cpp                                      |   16 --------
 src/ekiga.h                                        |    7 ---
 src/gui/main_window.cpp                            |    2 +-
 11 files changed, 49 insertions(+), 40 deletions(-)
---
diff --git a/lib/Makefile.am b/lib/Makefile.am
index c939ad7..482de4f 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -437,6 +437,8 @@ libekiga_la_SOURCES += \
 	$(engine_dir)/gui/gtk-frontend/roster-view-gtk.cpp \
 	$(engine_dir)/gui/gtk-frontend/call-history-view-gtk.h \
 	$(engine_dir)/gui/gtk-frontend/call-history-view-gtk.cpp \
+	$(engine_dir)/gui/gtk-frontend/default_devices.cpp \
+	$(engine_dir)/gui/gtk-frontend/default_devices.h \
 	$(engine_dir)/gui/gtk-frontend/presentity-view.h \
 	$(engine_dir)/gui/gtk-frontend/presentity-view.cpp \
 	$(engine_dir)/gui/gtk-frontend/heap-view.h \
@@ -447,6 +449,8 @@ libekiga_la_SOURCES += \
 	$(engine_dir)/gui/gtk-frontend/simple-chat-page.cpp \
 	$(engine_dir)/gui/gtk-frontend/multiple-chat-page.h \
 	$(engine_dir)/gui/gtk-frontend/multiple-chat-page.cpp \
+	$(engine_dir)/gui/gtk-frontend/preferences-window.cpp \
+	$(engine_dir)/gui/gtk-frontend/preferences-window.h \
 	$(engine_dir)/gui/gtk-frontend/statusicon.cpp \
 	$(engine_dir)/gui/gtk-frontend/statusicon.h \
 	$(engine_dir)/gui/gtk-frontend/chat-window.h \
diff --git a/src/gui/default_devices.cpp b/lib/engine/gui/gtk-frontend/default_devices.cpp
similarity index 100%
rename from src/gui/default_devices.cpp
rename to lib/engine/gui/gtk-frontend/default_devices.cpp
diff --git a/src/gui/default_devices.h b/lib/engine/gui/gtk-frontend/default_devices.h
similarity index 100%
rename from src/gui/default_devices.h
rename to lib/engine/gui/gtk-frontend/default_devices.h
diff --git a/lib/engine/gui/gtk-frontend/gtk-frontend.cpp b/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
index c824cc9..e26d1e5 100644
--- a/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
+++ b/lib/engine/gui/gtk-frontend/gtk-frontend.cpp
@@ -51,6 +51,7 @@
 #include "call-window.h"
 #include "chat-window.h"
 #include "statusicon.h"
+#include "preferences-window.h"
 #include "roster-view-gtk.h"
 #include "history-source.h"
 #include "book-view-gtk.h"
@@ -103,6 +104,7 @@ void GtkFrontend::build ()
   addressbook_window = addressbook_window_new_with_key (*contact_core, "/apps/" PACKAGE_NAME "/general/user_interface/addressbook_window");
   call_window = call_window_new (core);
   chat_window = chat_window_new (core, "/apps/" PACKAGE_NAME "/general/user_interface/chat_window");
+  preferences_window = preferences_window_new (core);
   status_icon = status_icon_new (core);
 }
 
@@ -125,6 +127,12 @@ const GtkWidget *GtkFrontend::get_addressbook_window () const
 }
 
 
+const GtkWidget *GtkFrontend::get_preferences_window () const
+{
+  return preferences_window;
+}
+
+
 const GtkWidget *GtkFrontend::get_call_window () const
 {
   return call_window;
diff --git a/lib/engine/gui/gtk-frontend/gtk-frontend.h b/lib/engine/gui/gtk-frontend/gtk-frontend.h
index c3e5a42..30b45ab 100644
--- a/lib/engine/gui/gtk-frontend/gtk-frontend.h
+++ b/lib/engine/gui/gtk-frontend/gtk-frontend.h
@@ -63,6 +63,8 @@ public:
 
   const std::string get_description () const;
 
+  const GtkWidget *get_preferences_window () const;
+
   const GtkWidget *get_addressbook_window () const;
 
   const GtkWidget *get_call_window () const;
@@ -73,6 +75,7 @@ public:
 
 private :
 
+  GtkWidget *preferences_window;
   GtkWidget *addressbook_window;
   GtkWidget *call_window;
   GtkWidget *chat_window;
diff --git a/src/gui/preferences.cpp b/lib/engine/gui/gtk-frontend/preferences-window.cpp
similarity index 96%
rename from src/gui/preferences.cpp
rename to lib/engine/gui/gtk-frontend/preferences-window.cpp
index 04e8812..85b270b 100644
--- a/src/gui/preferences.cpp
+++ b/lib/engine/gui/gtk-frontend/preferences-window.cpp
@@ -39,12 +39,13 @@
 
 #include "config.h"
 
-#include "preferences.h"
+#include <gmpreferences.h>
+#include <gmconf.h>
+
+#include "preferences-window.h"
 #include "default_devices.h"
 
 #include "gmwindow.h"
-#include <gmpreferences.h>
-#include <gmconf.h>
 #include "codecsbox.h"
 
 #include "videoinput-core.h"
@@ -55,6 +56,26 @@
 #include "platform/winpaths.h"
 #endif
 
+#define GENERAL_KEY         "/apps/" PACKAGE_NAME "/general/"
+#define USER_INTERFACE_KEY "/apps/" PACKAGE_NAME "/general/user_interface/"
+#define CONTACTS_KEY "/apps/" PACKAGE_NAME "/contacts/"
+#define VIDEO_DISPLAY_KEY USER_INTERFACE_KEY "video_display/"
+#define SOUND_EVENTS_KEY  "/apps/" PACKAGE_NAME "/general/sound_events/"
+#define AUDIO_DEVICES_KEY "/apps/" PACKAGE_NAME "/devices/audio/"
+#define VIDEO_DEVICES_KEY "/apps/" PACKAGE_NAME "/devices/video/"
+#define PERSONAL_DATA_KEY "/apps/" PACKAGE_NAME "/general/personal_data/"
+#define CALL_OPTIONS_KEY "/apps/" PACKAGE_NAME "/general/call_options/"
+#define NAT_KEY "/apps/" PACKAGE_NAME "/general/nat/"
+#define PROTOCOLS_KEY "/apps/" PACKAGE_NAME "/protocols/"
+#define H323_KEY "/apps/" PACKAGE_NAME "/protocols/h323/"
+#define SIP_KEY "/apps/" PACKAGE_NAME "/protocols/sip/"
+#define PORTS_KEY "/apps/" PACKAGE_NAME "/protocols/ports/"
+#define CALL_FORWARDING_KEY "/apps/" PACKAGE_NAME "/protocols/call_forwarding/"
+#define LDAP_KEY "/apps/" PACKAGE_NAME "/protocols/ldap/"
+#define CODECS_KEY "/apps/" PACKAGE_NAME "/codecs/"
+#define AUDIO_CODECS_KEY "/apps/" PACKAGE_NAME "/codecs/audio/"
+#define VIDEO_CODECS_KEY  "/apps/" PACKAGE_NAME "/codecs/video/"
+
 
 typedef struct _GmPreferencesWindow
 {
@@ -554,8 +575,7 @@ gm_pw_init_sound_events_page (GtkWidget *prefs_window,
     gtk_tree_view_get_selection (GTK_TREE_VIEW (pw->sound_events_list));
 
   frame = gtk_frame_new (NULL);
-  gtk_container_set_border_width (GTK_CONTAINER (frame), 
-                                  2 * GNOMEMEETING_PAD_SMALL);
+  gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
   gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
   gtk_container_add (GTK_CONTAINER (frame), pw->sound_events_list);
   gtk_container_set_border_width (GTK_CONTAINER (pw->sound_events_list), 0);
@@ -1246,7 +1266,7 @@ gm_prefs_window_update_devices_list (GtkWidget *prefs_window)
 
 
 GtkWidget *
-gm_prefs_window_new (Ekiga::ServiceCore *core)
+preferences_window_new (Ekiga::ServiceCore & core)
 {
   GmPreferencesWindow *pw = NULL;
 
@@ -1273,7 +1293,7 @@ gm_prefs_window_new (Ekiga::ServiceCore *core)
   /* The GMObject data */
   pw = new GmPreferencesWindow ();
 
-  pw->core = core;
+  pw->core = &core;
 
   g_object_set_data_full (G_OBJECT (window), "GMObject",
 			  pw, (GDestroyNotify) gm_pw_destroy);
@@ -1339,9 +1359,9 @@ gm_prefs_window_new (Ekiga::ServiceCore *core)
   gm_window_hide_on_delete (window);
 
   boost::signals::connection conn;
-  boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core = core->get<Ekiga::VideoInputCore> ("videoinput-core");
-  boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core = core->get<Ekiga::AudioInputCore> ("audioinput-core");
-  boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core = core->get<Ekiga::AudioOutputCore> ("audiooutput-core");
+  boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core = core.get<Ekiga::VideoInputCore> ("videoinput-core");
+  boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core = core.get<Ekiga::AudioInputCore> ("audioinput-core");
+  boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core = core.get<Ekiga::AudioOutputCore> ("audiooutput-core");
 
   conn = videoinput_core->device_added.connect (boost::bind (&on_videoinput_device_added_cb, _1, _2, window));
   pw->connections.push_back (conn);
diff --git a/src/gui/preferences.h b/lib/engine/gui/gtk-frontend/preferences-window.h
similarity index 96%
rename from src/gui/preferences.h
rename to lib/engine/gui/gtk-frontend/preferences-window.h
index 4347fab..a7c4ecb 100644
--- a/src/gui/preferences.h
+++ b/lib/engine/gui/gtk-frontend/preferences-window.h
@@ -40,7 +40,8 @@
 #ifndef _PREFERENCES_H_
 #define _PREFERENCES_H_
 
-#include "common.h"
+#include <gtk/gtk.h>
+
 #include "framework/services.h"
 
 /* DESCRIPTION  :  /
@@ -49,7 +50,7 @@
  *                 to appropriate callbacks, then returns it.
  * PRE          :  /
  */
-GtkWidget *gm_prefs_window_new (Ekiga::ServiceCore *core);
+GtkWidget *preferences_window_new (Ekiga::ServiceCore & core);
 
 
 #endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 2b28514..86d4ace 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,13 +61,9 @@ ekiga_SOURCES +=			\
 	gui/assistant.cpp		\
 	gui/conf.h			\
 	gui/conf.cpp			\
-	gui/default_devices.cpp	        \
-	gui/default_devices.h	        \
 	gui/main.cpp		        \
 	gui/main_window.h		\
 	gui/main_window.cpp		\
-	gui/preferences.h		\
-	gui/preferences.cpp		\
 	gui/statusmenu.h		\
 	gui/statusmenu.cpp
 
diff --git a/src/ekiga.cpp b/src/ekiga.cpp
index 8875cfb..59fa9f0 100644
--- a/src/ekiga.cpp
+++ b/src/ekiga.cpp
@@ -39,7 +39,6 @@
 #include "config.h"
 
 #include "ekiga.h"
-#include "preferences.h"
 #include "assistant.h"
 #include "accounts.h"
 #include "main_window.h"
@@ -58,7 +57,6 @@ GnomeMeeting::GnomeMeeting ()
   GM = this;
 
   assistant_window = NULL;
-  prefs_window = NULL;
   main_window = NULL;
   assistant_window = NULL;
   accounts_window = NULL;
@@ -70,10 +68,6 @@ GnomeMeeting::Exit ()
 {
   PWaitAndSignal m(ep_var_mutex);
 
-  if (prefs_window)
-    gtk_widget_destroy (prefs_window);
-  prefs_window = NULL;
-
   if (main_window)
     gtk_widget_destroy (main_window);
   main_window = NULL;
@@ -103,13 +97,6 @@ GnomeMeeting::GetMainWindow ()
 
 
 GtkWidget *
-GnomeMeeting::GetPrefsWindow ()
-{
-  return prefs_window;
-}
-
-
-GtkWidget *
 GnomeMeeting::GetAssistantWindow ()
 {
   return assistant_window;
@@ -136,14 +123,11 @@ void GnomeMeeting::BuildGUI (Ekiga::ServiceCorePtr services)
   /* Build the GUI */
   gtk_window_set_default_icon_name (GM_ICON_LOGO);
   accounts_window = gm_accounts_window_new (*services);
-  prefs_window = gm_prefs_window_new (services.get ());
   assistant_window = ekiga_assistant_new (services.get ());
   main_window = gm_main_window_new (*services);
   // FIXME should be moved inside the gm_accounts_window_new code
   gtk_window_set_transient_for (GTK_WINDOW (accounts_window), GTK_WINDOW (main_window));
   // FIXME should be moved in ekiga_assistant_new
-  gtk_window_set_transient_for (GTK_WINDOW (prefs_window), GTK_WINDOW (main_window));
-  // FIXME should be moved in ekiga_assistant_new
   gtk_window_set_transient_for (GTK_WINDOW (assistant_window), GTK_WINDOW (main_window));
 
   /* GM is started */
diff --git a/src/ekiga.h b/src/ekiga.h
index 5621edd..ed1fe7b 100644
--- a/src/ekiga.h
+++ b/src/ekiga.h
@@ -84,13 +84,6 @@ class GnomeMeeting : public PProcess
 
 
   /* DESCRIPTION  :  /
-   * BEHAVIOR     :  Returns a pointer to the preferences window GMObject.
-   * PRE          :  /
-   */
-  GtkWidget* GetPrefsWindow ();
-
-
-  /* DESCRIPTION  :  /
    * BEHAVIOR     :  Returns a pointer to the assistant window.
    * PRE          :  /
    */
diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp
index b6e83a2..3ed9a52 100644
--- a/src/gui/main_window.cpp
+++ b/src/gui/main_window.cpp
@@ -1260,7 +1260,7 @@ ekiga_main_window_init_menu (EkigaMainWindow *mw)
   boost::shared_ptr<GtkFrontend> gtk_frontend = mw->priv->core->get<GtkFrontend> ("gtk-frontend");
   addressbook_window = GTK_WIDGET (gtk_frontend->get_addressbook_window ());
   accounts_window = GnomeMeeting::Process ()->GetAccountsWindow ();
-  prefs_window = GnomeMeeting::Process ()->GetPrefsWindow ();
+  prefs_window = GTK_WIDGET (gtk_frontend->get_preferences_window ());
   assistant_window = GnomeMeeting::Process ()->GetAssistantWindow ();
 
   mw->priv->main_menu = gtk_menu_bar_new ();



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