[Xfce4-commits] <xfce4-mixer:master> Port xfce4-mixer to libxfce4ui

Jannis Pohlmann noreply at xfce.org
Wed Jul 28 22:20:01 CEST 2010


Updating branch refs/heads/master
         to ff98de4a193728cc4cbe2c6ed3006fd7966ddccf (commit)
       from 91606745b307ea7b87be06670e1b577eb95ac076 (commit)

commit ff98de4a193728cc4cbe2c6ed3006fd7966ddccf
Author: Romain Bouvier <skunnyk at archlinux.fr>
Date:   Fri May 7 22:06:32 2010 +0200

    Port xfce4-mixer to libxfce4ui
    
    Signed-off-by: Jannis Pohlmann <jannis at xfce.org>

 configure.in.in                          |    4 ++--
 libxfce4mixer/Makefile.am                |    4 ++--
 panel-plugin/Makefile.am                 |    4 ++--
 panel-plugin/xfce-mixer-plugin.c         |   20 ++++++++++++--------
 panel-plugin/xfce-plugin-dialog.c        |    2 +-
 panel-plugin/xfce-volume-button.c        |   14 ++++++++++----
 xfce4-mixer/Makefile.am                  |    4 ++--
 xfce4-mixer/main.c                       |   10 ++++++----
 xfce4-mixer/xfce-mixer-controls-dialog.c |    2 +-
 xfce4-mixer/xfce-mixer-option.c          |    2 +-
 xfce4-mixer/xfce-mixer-switch.c          |    2 +-
 xfce4-mixer/xfce-mixer-track.c           |    2 +-
 xfce4-mixer/xfce-mixer-window.c          |   22 ++++++++--------------
 xfce4-mixer/xfce-mixer.c                 |    2 +-
 14 files changed, 50 insertions(+), 44 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 3ff66e0..2bc6847 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -75,9 +75,9 @@ dnl ***********************************
 XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.12.0])
 XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.12.0])
 XDT_CHECK_PACKAGE([GST_PLUGINS_BASE], [gstreamer-plugins-base-0.10], [0.10.2])
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.6.0])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.6.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.7.0])
 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.6.0])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
 
diff --git a/libxfce4mixer/Makefile.am b/libxfce4mixer/Makefile.am
index b01d3f5..399bb2d 100644
--- a/libxfce4mixer/Makefile.am
+++ b/libxfce4mixer/Makefile.am
@@ -28,7 +28,7 @@ libxfce4mixer_la_CFLAGS = 						\
 	$(GLIB_CFLAGS)							\
 	$(GTK_FLAGS)							\
 	$(LIBXFCE4UTIL_CFLAGS)						\
-	$(LIBXFCEGUI4_CFLAGS)						\
+	$(LIBXFCE4UI_CFLAGS)						\
 	$(XFCONF_CFLAGS)						\
 	$(GST_PLUGINS_BASE_CFLAGS)
 
@@ -40,7 +40,7 @@ libxfce4mixer_la_LIBADD =						\
 	$(GLIB_LIBS)							\
 	$(GTK_FLAGS)							\
 	$(LIBXFCE4UTIL_LIBS)						\
-	$(LIBXFCEGUI4_LIBS)						\
+	$(LIBXFCE4UI_LIBS)						\
 	$(XFCONF_LIBS)							\
 	$(GST_PLUGINS_BASE_LIBS)					\
 	-lgstaudio-0.10							\
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index dcf97d6..358ea44 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -24,7 +24,7 @@ xfce4_mixer_plugin_CFLAGS =						\
 	$(GLIB_CFLAGS)							\
 	$(GTK_CFLAGS)							\
 	$(LIBXFCE4UTIL_CFLAGS)						\
-	$(LIBXFCEGUI4_CFLAGS)						\
+	$(LIBXFCE4UI_CFLAGS)						\
 	$(LIBXFCE4PANEL_CFLAGS)						\
 	$(GST_PLUGINS_BASE_CFLAGS)
 
@@ -37,7 +37,7 @@ xfce4_mixer_plugin_LDFLAGS =						\
 	$(GLIB_LIBS)							\
 	$(GTK_LIBS)							\
 	$(LIBXFCE4UTIL_LIBS)						\
-	$(LIBXFCEGUI4_LIBS)						\
+	$(LIBXFCE4UI_LIBS)						\
 	$(LIBXFCE4PANEL_LIBS)						\
 	$(GST_PLUGINS_BASE_LIBS)					\
 	-lgstaudio-0.10							\
diff --git a/panel-plugin/xfce-mixer-plugin.c b/panel-plugin/xfce-mixer-plugin.c
index 88eeaad..af26ba2 100644
--- a/panel-plugin/xfce-mixer-plugin.c
+++ b/panel-plugin/xfce-mixer-plugin.c
@@ -31,9 +31,8 @@
 #include <gst/gst.h>
 
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
-#include <libxfce4panel/xfce-panel-plugin.h>
-#include <libxfce4panel/xfce-hvbox.h>
+#include <libxfce4ui/libxfce4ui.h>
+#include <libxfce4panel/libxfce4panel.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
 
@@ -344,7 +343,7 @@ xfce_mixer_plugin_clicked (XfceMixerPlugin *mixer_plugin)
                                       GTK_STOCK_DIALOG_ERROR,
                                       NULL,
                                       _("No left-click command defined yet. You can change this in the plugin properties."),
-                                      XFCE_CUSTOM_STOCK_BUTTON, _("Properties"), GTK_STOCK_PREFERENCES, GTK_RESPONSE_ACCEPT,
+                                      XFCE_BUTTON_TYPE_MIXED, _("Properties"), GTK_STOCK_PREFERENCES, GTK_RESPONSE_ACCEPT,
                                       GTK_STOCK_CLOSE, GTK_RESPONSE_REJECT,
                                       NULL);
 
@@ -367,7 +366,9 @@ xfce_mixer_plugin_clicked (XfceMixerPlugin *mixer_plugin)
                                  mixer_plugin->command);
 
       /* Display error */
-      xfce_err (message);
+      xfce_dialog_show_error (NULL,
+                              NULL,
+                              message); 
 
       /* Free error message */
       g_free (message);
@@ -392,9 +393,12 @@ xfce_mixer_plugin_configure (XfceMixerPlugin *mixer_plugin)
   /* Warn user if no sound cards are available */
   if (G_UNLIKELY (g_list_length (xfce_mixer_get_cards ()) <= 0))
     {
-      xfce_err (_("GStreamer was unable to detect any sound devices. "
-                  "Some sound system specific GStreamer packages may "
-                  "be missing. It may also be a permissions problem."));
+      xfce_dialog_show_error (NULL,
+                              NULL,
+                              _("GStreamer was unable to detect any sound devices. "
+                              "Some sound system specific GStreamer packages may "
+                              "be missing. It may also be a permissions problem.")); 
+
     }
   else
     {
diff --git a/panel-plugin/xfce-plugin-dialog.c b/panel-plugin/xfce-plugin-dialog.c
index 3c7edbf..cf099aa 100644
--- a/panel-plugin/xfce-plugin-dialog.c
+++ b/panel-plugin/xfce-plugin-dialog.c
@@ -27,7 +27,7 @@
 #include <gst/gst.h>
 #include <gst/interfaces/mixer.h>
 
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
 
diff --git a/panel-plugin/xfce-volume-button.c b/panel-plugin/xfce-volume-button.c
index 82a7129..7d3f939 100644
--- a/panel-plugin/xfce-volume-button.c
+++ b/panel-plugin/xfce-volume-button.c
@@ -27,7 +27,9 @@
 
 #include <gdk/gdkkeysyms.h>
 
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
+
+#include <libxfce4panel/libxfce4panel.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
 
@@ -205,7 +207,7 @@ xfce_volume_button_init (XfceVolumeButton *button)
   button->adjustment = gtk_adjustment_new (0.0, 0.0, 1.0, 0.05, 0.05, 0.0);
 
   /* Create a new scaled image for the button icon */
-  button->image = xfce_scaled_image_new ();
+  button->image = xfce_panel_image_new ();
   gtk_container_add (GTK_CONTAINER (button), button->image);
   gtk_widget_show (button->image);
 
@@ -430,7 +432,7 @@ xfce_volume_button_update (XfceVolumeButton *button)
 
   /* Update the button icon */
   if (G_LIKELY (pixbuf != NULL))
-    xfce_scaled_image_set_from_pixbuf (XFCE_SCALED_IMAGE (button->image), pixbuf);
+    xfce_panel_image_set_from_pixbuf (XFCE_PANEL_IMAGE (button->image), pixbuf);
 }
 
 
@@ -491,7 +493,11 @@ xfce_volume_button_set_icon_size (XfceVolumeButton *button,
       if (GDK_IS_PIXBUF (button->pixbufs[i]))
         g_object_unref (G_OBJECT (button->pixbufs[i]));
 
-      button->pixbufs[i] = xfce_themed_icon_load (icons[i], button->icon_size);
+      button->pixbufs[i] = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(),
+                                                     icons[i],
+                                                     button->icon_size,
+                                                     GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+                                                     NULL);
     }
 }
 
diff --git a/xfce4-mixer/Makefile.am b/xfce4-mixer/Makefile.am
index 037cc97..a869325 100644
--- a/xfce4-mixer/Makefile.am
+++ b/xfce4-mixer/Makefile.am
@@ -28,7 +28,7 @@ xfce4_mixer_CFLAGS = 							\
 	$(GLIB_CFLAGS)							\
 	$(GTK_CFLAGS)							\
 	$(LIBXFCE4UTIL_CFLAGS)						\
-	$(LIBXFCEGUI4_CFLAGS)						\
+	$(LIBXFCE4UI_CFLAGS)						\
 	$(XFCONF_CFLAGS)						\
 	$(GST_PLUGINS_BASE_CFLAGS)
 
@@ -41,7 +41,7 @@ xfce4_mixer_LDFLAGS = 							\
 	$(GTHREAD_LIBS)							\
 	$(GTK_LIBS)							\
 	$(LIBXFCE4UTIL_LIBS)						\
-	$(LIBXFCEGUI4_LIBS)						\
+	$(LIBXFCE4UI_LIBS)						\
 	$(XFCONF_LIBS)							\
 	$(GST_PLUGINS_BASE_LIBS)					\
 	-lgstaudio-0.10							\
diff --git a/xfce4-mixer/main.c b/xfce4-mixer/main.c
index bad19a3..e459f8f 100644
--- a/xfce4-mixer/main.c
+++ b/xfce4-mixer/main.c
@@ -29,7 +29,7 @@
 #include <gst/gst.h>
 
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 #include <xfconf/xfconf.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
@@ -87,9 +87,11 @@ main (int    argc,
   /* Warn users if there were no sound cards detected by GStreamer */
   if (G_UNLIKELY (g_list_length (xfce_mixer_get_cards ()) <= 0))
     {
-      xfce_err (_("GStreamer was unable to detect any sound devices. "
-                  "Some sound system specific GStreamer packages may "
-                  "be missing. It may also be a permissions problem."));
+      xfce_dialog_show_error (NULL,
+                              NULL,
+                              _("GStreamer was unable to detect any sound devices. "
+                              "Some sound system specific GStreamer packages may "
+                              "be missing. It may also be a permissions problem."));
 
       return EXIT_FAILURE;
     }
diff --git a/xfce4-mixer/xfce-mixer-controls-dialog.c b/xfce4-mixer/xfce-mixer-controls-dialog.c
index ad5eba1..c1ba813 100644
--- a/xfce4-mixer/xfce-mixer-controls-dialog.c
+++ b/xfce4-mixer/xfce-mixer-controls-dialog.c
@@ -26,7 +26,7 @@
 #include <gst/interfaces/mixer.h>
 
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
 
diff --git a/xfce4-mixer/xfce-mixer-option.c b/xfce4-mixer/xfce-mixer-option.c
index 5d0254f..709e1e4 100644
--- a/xfce4-mixer/xfce-mixer-option.c
+++ b/xfce4-mixer/xfce-mixer-option.c
@@ -26,7 +26,7 @@
 #include <gst/interfaces/mixer.h>
 
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
 
diff --git a/xfce4-mixer/xfce-mixer-switch.c b/xfce4-mixer/xfce-mixer-switch.c
index 880682a..c759b7f 100644
--- a/xfce4-mixer/xfce-mixer-switch.c
+++ b/xfce4-mixer/xfce-mixer-switch.c
@@ -26,7 +26,7 @@
 #include <gst/interfaces/mixer.h>
 
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
 
diff --git a/xfce4-mixer/xfce-mixer-track.c b/xfce4-mixer/xfce-mixer-track.c
index c1b5b3f..f015349 100644
--- a/xfce4-mixer/xfce-mixer-track.c
+++ b/xfce4-mixer/xfce-mixer-track.c
@@ -26,7 +26,7 @@
 #include <gst/interfaces/mixer.h>
 
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
 
diff --git a/xfce4-mixer/xfce-mixer-window.c b/xfce4-mixer/xfce-mixer-window.c
index d08505d..f525e46 100644
--- a/xfce4-mixer/xfce-mixer-window.c
+++ b/xfce4-mixer/xfce-mixer-window.c
@@ -27,7 +27,7 @@
 #include <gst/interfaces/mixer.h>
 
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
 
@@ -57,12 +57,12 @@ static void     xfce_mixer_window_update_contents        (XfceMixerWindow      *
 
 struct _XfceMixerWindowClass
 {
-  GtkWindowClass __parent__;
+  XfceTitledDialogClass __parent__;
 };
 
 struct _XfceMixerWindow
 {
-  GtkWindow __parent__;
+  XfceTitledDialog __parent__;
 
   XfceMixerPreferences *preferences;
 
@@ -118,7 +118,8 @@ xfce_mixer_window_get_type (void)
           NULL,
         };
 
-      type = g_type_register_static (GTK_TYPE_WINDOW, "XfceMixerWindow", &info, 0);
+      type = g_type_register_static (XFCE_TYPE_TITLED_DIALOG, "XfceMixerWindow", &info, 0);
+
     }
   
   return type;
@@ -146,7 +147,6 @@ xfce_mixer_window_init (XfceMixerWindow *window)
 {
   GtkAccelGroup *accel_group;
   GtkAction     *action;
-  GtkWidget     *heading;
   GtkWidget     *separator;
   GtkWidget     *label;
   GtkWidget     *button;
@@ -168,6 +168,8 @@ xfce_mixer_window_init (XfceMixerWindow *window)
   gtk_window_set_title (GTK_WINDOW (window), _("Mixer"));
   gtk_window_set_default_size (GTK_WINDOW (window), width, height);
   gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
+  xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (window), _("Configure sound card(s) and control the volume of selected tracks"));
+
   g_signal_connect (window, "delete-event", G_CALLBACK (xfce_mixer_window_closed), window);
 
   /* Quit mixer when the main window is closed */
@@ -189,17 +191,9 @@ xfce_mixer_window_init (XfceMixerWindow *window)
     }
   gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
 
-  vbox = gtk_vbox_new (FALSE, 0);
-  gtk_container_add (GTK_CONTAINER (window), vbox);
+  vbox = gtk_dialog_get_content_area (GTK_DIALOG (window));
   gtk_widget_show (vbox);
 
-  heading = xfce_heading_new ();
-  xfce_heading_set_title (XFCE_HEADING (heading), _("Mixer"));
-  xfce_heading_set_subtitle (XFCE_HEADING (heading), _("Configure sound card(s) and control the volume of selected tracks"));
-  xfce_heading_set_icon_name (XFCE_HEADING (heading), "multimedia-volume-control");
-  gtk_box_pack_start (GTK_BOX (vbox), heading, FALSE, TRUE, 0);
-  gtk_widget_show (heading);
-
   separator = gtk_hseparator_new ();
   gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, TRUE, 0);
   gtk_widget_show (separator);
diff --git a/xfce4-mixer/xfce-mixer.c b/xfce4-mixer/xfce-mixer.c
index c09a5b4..8d3ffcd 100644
--- a/xfce4-mixer/xfce-mixer.c
+++ b/xfce4-mixer/xfce-mixer.c
@@ -26,7 +26,7 @@
 #include <gst/interfaces/mixer.h>
 
 #include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
 
 #include "libxfce4mixer/libxfce4mixer.h"
 



More information about the Xfce4-commits mailing list