[ekiga/ds-gsettings] Code simplification and cleanups.



commit d2d56c9986ff5658a0c849501235147c41316bc2
Author: Damien Sandras <dsandras beip be>
Date:   Sat Apr 13 12:03:31 2013 +0200

    Code simplification and cleanups.
    
    This is required for commit 9459a20e34515cf9d4558246f32e3a3091df5c5a.

 lib/engine/gui/gtk-frontend/call-window.cpp        | 66 ++++++++++++++--------
 lib/engine/gui/gtk-frontend/preferences-window.cpp |  4 +-
 src/gui/main_window.cpp                            |  2 +-
 3 files changed, 45 insertions(+), 27 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/call-window.cpp b/lib/engine/gui/gtk-frontend/call-window.cpp
index 9d336f2..3fa4680 100644
--- a/lib/engine/gui/gtk-frontend/call-window.cpp
+++ b/lib/engine/gui/gtk-frontend/call-window.cpp
@@ -755,6 +755,8 @@ on_videooutput_device_error_cb (Ekiga::VideoOutputManager & /* manager */,
                                 Ekiga::VideoOutputErrorCodes error_code,
                                 gpointer self)
 {
+  GtkWidget *dialog = NULL;
+
   const gchar *dialog_title =  _("Error while initializing video output");
   const gchar *tmp_msg = _("No video will be displayed on your machine during this call");
   gchar *dialog_msg = NULL;
@@ -773,10 +775,13 @@ on_videooutput_device_error_cb (Ekiga::VideoOutputManager & /* manager */,
       break;
   }
 
-  gnomemeeting_warning_dialog_on_widget (GTK_WINDOW (self),
-                                         "show_device_warnings",
-                                         dialog_title,
-                                         "%s", dialog_msg);
+  dialog = gtk_message_dialog_new (GTK_WINDOW (self), GTK_DIALOG_MODAL,
+                                   GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+                                   dialog_msg);
+  gtk_window_set_title (GTK_WINDOW (dialog), dialog_title);
+  g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
+  gtk_widget_show_all (GTK_WIDGET (dialog));
+
   g_free (dialog_msg);
 }
 
@@ -886,13 +891,14 @@ on_videoinput_device_error_cb (Ekiga::VideoInputManager & /* manager */,
                                Ekiga::VideoInputErrorCodes error_code,
                                gpointer self)
 {
+  GtkWidget *dialog = NULL;
+
   gchar *dialog_title = NULL;
   gchar *dialog_msg = NULL;
   gchar *tmp_msg = NULL;
 
-  dialog_title =
-  g_strdup_printf (_("Error while accessing video device %s"),
-                   (const char *) device.name.c_str());
+  dialog_title = g_strdup_printf (_("Error while accessing video device %s"),
+                                  (const char *) device.name.c_str());
 
   tmp_msg = g_strdup (_("A moving logo will be transmitted during calls."));
   switch (error_code) {
@@ -927,10 +933,13 @@ on_videoinput_device_error_cb (Ekiga::VideoInputManager & /* manager */,
       break;
   }
 
-  gnomemeeting_warning_dialog_on_widget (GTK_WINDOW (GTK_WIDGET (self)),
-                                         "show_device_warnings",
-                                         dialog_title,
-                                         "%s", dialog_msg);
+  dialog = gtk_message_dialog_new (GTK_WINDOW (self), GTK_DIALOG_MODAL,
+                                   GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+                                   dialog_msg);
+  gtk_window_set_title (GTK_WINDOW (dialog), dialog_title);
+  g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
+  gtk_widget_show_all (dialog);
+
   g_free (dialog_msg);
   g_free (dialog_title);
   g_free (tmp_msg);
@@ -970,6 +979,8 @@ on_audioinput_device_error_cb (Ekiga::AudioInputManager & /* manager */,
                                Ekiga::AudioInputErrorCodes error_code,
                                gpointer self)
 {
+  GtkWidget *dialog = NULL;
+
   gchar *dialog_title = NULL;
   gchar *dialog_msg = NULL;
   gchar *tmp_msg = NULL;
@@ -997,10 +1008,13 @@ on_audioinput_device_error_cb (Ekiga::AudioInputManager & /* manager */,
       break;
   }
 
-  gnomemeeting_warning_dialog_on_widget (GTK_WINDOW (self),
-                                         "show_device_warnings",
-                                         dialog_title,
-                                         "%s", dialog_msg);
+  dialog = gtk_message_dialog_new (GTK_WINDOW (self), GTK_DIALOG_MODAL,
+                                   GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+                                   dialog_msg);
+  gtk_window_set_title (GTK_WINDOW (dialog), dialog_title);
+  g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
+  gtk_widget_show_all (GTK_WIDGET (dialog));
+
   g_free (dialog_msg);
   g_free (dialog_title);
   g_free (tmp_msg);
@@ -1050,6 +1064,8 @@ on_audiooutput_device_error_cb (Ekiga::AudioOutputManager & /*manager */,
                                 Ekiga::AudioOutputErrorCodes error_code,
                                 gpointer self)
 {
+  GtkWidget *dialog = NULL;
+
   if (ps == Ekiga::secondary)
     return;
 
@@ -1078,10 +1094,13 @@ on_audiooutput_device_error_cb (Ekiga::AudioOutputManager & /*manager */,
       break;
   }
 
-  gnomemeeting_warning_dialog_on_widget (GTK_WINDOW (GTK_WIDGET (self)),
-                                         "show_device_warnings",
-                                         dialog_title,
-                                         "%s", dialog_msg);
+  dialog = gtk_message_dialog_new (GTK_WINDOW (self), GTK_DIALOG_MODAL,
+                                   GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+                                   dialog_msg);
+  gtk_window_set_title (GTK_WINDOW (dialog), dialog_title);
+  g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
+  gtk_widget_show_all (GTK_WIDGET (dialog));
+
   g_free (dialog_msg);
   g_free (dialog_title);
   g_free (tmp_msg);
@@ -1828,7 +1847,7 @@ gm_cw_video_settings_window_new (EkigaCallWindow *cw)
 
   gtk_widget_set_sensitive (GTK_WIDGET (cw->priv->video_settings_frame), false);
 
-  gm_window_hide_on_delete (window);
+  gtk_widget_hide_on_delete (window);
 
   return window;
 }
@@ -1880,7 +1899,6 @@ gm_cw_audio_settings_window_new (EkigaCallWindow *cw)
 
   gtk_box_pack_start (GTK_BOX (main_vbox), cw->priv->audio_output_volume_frame,
                       false, false, 0);
-  gtk_widget_show_all (cw->priv->audio_output_volume_frame);
   gtk_widget_set_sensitive (GTK_WIDGET (cw->priv->audio_output_volume_frame),  false);
 
   /* Audio control frame, we need it to disable controls */
@@ -1915,10 +1933,10 @@ gm_cw_audio_settings_window_new (EkigaCallWindow *cw)
 
   gtk_box_pack_start (GTK_BOX (main_vbox), cw->priv->audio_input_volume_frame,
                       false, false, 0);
-  gtk_widget_show_all (cw->priv->audio_input_volume_frame);
   gtk_widget_set_sensitive (GTK_WIDGET (cw->priv->audio_input_volume_frame),  false);
 
   gtk_container_add (GTK_CONTAINER (window), main_vbox);
+  gtk_widget_show_all (main_vbox);
 
   g_signal_connect (cw->priv->adj_output_volume, "value-changed",
                    G_CALLBACK (audio_volume_changed_cb), cw);
@@ -1926,7 +1944,7 @@ gm_cw_audio_settings_window_new (EkigaCallWindow *cw)
   g_signal_connect (cw->priv->adj_input_volume, "value-changed",
                    G_CALLBACK (audio_volume_changed_cb), cw);
 
-  gm_window_hide_on_delete (window);
+  gtk_widget_hide_on_delete (window);
 
   g_signal_connect (window, "show",
                     G_CALLBACK (audio_volume_window_shown_cb), cw);
@@ -2148,7 +2166,7 @@ ekiga_call_window_transfer_dialog_run (EkigaCallWindow *cw,
   else
     gm_entry_dialog_set_text (GM_ENTRY_DIALOG (cw->priv->transfer_call_popup), "sip:");
 
-  gm_window_show (cw->priv->transfer_call_popup);
+  gtk_widget_show_all (cw->priv->transfer_call_popup);
 
   answer = gtk_dialog_run (GTK_DIALOG (cw->priv->transfer_call_popup));
   switch (answer) {
diff --git a/lib/engine/gui/gtk-frontend/preferences-window.cpp 
b/lib/engine/gui/gtk-frontend/preferences-window.cpp
index a5119c6..e21c32d 100644
--- a/lib/engine/gui/gtk-frontend/preferences-window.cpp
+++ b/lib/engine/gui/gtk-frontend/preferences-window.cpp
@@ -1350,10 +1350,10 @@ preferences_window_new (Ekiga::ServiceCore& core)
 
   /* That's an usual GtkWindow, connect it to the signals */
   g_signal_connect_swapped (window, "response",
-                           G_CALLBACK (gm_window_hide),
+                           G_CALLBACK (gtk_widget_hide),
                            (gpointer) window);
 
-  gm_window_hide_on_delete (window);
+  gtk_widget_hide_on_delete (window);
 
   boost::signals::connection conn;
   boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core = core.get<Ekiga::VideoInputCore> 
("videoinput-core");
diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp
index 265b5c6..f911292 100644
--- a/src/gui/main_window.cpp
+++ b/src/gui/main_window.cpp
@@ -569,7 +569,7 @@ static void
 show_gm_window_cb (G_GNUC_UNUSED GtkWidget *widget,
                    gpointer data)
 {
-  gm_window_show (GTK_WIDGET (data));
+  gtk_widget_show (GTK_WIDGET (data));
 }
 
 static void


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