From 86615c968d7ef19d98c686fa3a6be3aeb7dcb7e4 Mon Sep 17 00:00:00 2001 From: Romain Bouvier Date: Sun, 25 Jul 2010 13:25:52 +0200 Subject: [PATCH] Port xfce4-cpugraph-plugin to libxfce4ui --- configure.ac | 4 ++-- panel-plugin/Makefile.am | 4 ++-- panel-plugin/cpu.c | 10 ++++++++-- panel-plugin/properties.c | 10 +++------- panel-plugin/settings.c | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 98f9d3f..e75694b 100644 --- a/configure.ac +++ b/configure.ac @@ -27,9 +27,9 @@ dnl Check for standard header files AC_HEADER_STDC dnl configure the panel plugin -XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.20]) +XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.7.0]) XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.20]) -XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.12.0]) +XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0]) dnl translations XDT_I18N([@LINGUAS@]) diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am index 595c61f..6340196 100644 --- a/panel-plugin/Makefile.am +++ b/panel-plugin/Makefile.am @@ -3,11 +3,11 @@ plugin_PROGRAMS = xfce4-cpugraph-plugin xfce4_cpugraph_plugin_CFLAGS = \ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ - @LIBXFCEGUI4_CFLAGS@ \ + @LIBXFCE4UI_CFLAGS@ \ @LIBXFCE4PANEL_CFLAGS@ xfce4_cpugraph_plugin_LDADD = \ - @LIBXFCEGUI4_LIBS@ \ + @LIBXFCE4UI_LIBS@ \ @LIBXFCE4PANEL_LIBS@ xfce4_cpugraph_plugin_SOURCES = \ diff --git a/panel-plugin/cpu.c b/panel-plugin/cpu.c index ca9628f..fbbe48b 100644 --- a/panel-plugin/cpu.c +++ b/panel-plugin/cpu.c @@ -3,7 +3,7 @@ #include "mode.h" #include "properties.h" -#include +#include #include #ifndef _ # include @@ -322,7 +322,13 @@ static gboolean command_cb( GtkWidget *w,GdkEventButton *event, CPUGraph *base ) { if( event->button == 1 && base->command ) { - xfce_exec( base->command, base->in_terminal, base->startup_notification, NULL ); + GError *error = NULL; + if(!g_spawn_command_line_async(base->command, &error)) { + xfce_dialog_show_error(NULL, + error, + _("%s could not be launched")); + g_error_free(error); + } } return FALSE; } diff --git a/panel-plugin/properties.c b/panel-plugin/properties.c index a014d2c..b2d9a39 100644 --- a/panel-plugin/properties.c +++ b/panel-plugin/properties.c @@ -3,7 +3,7 @@ #include "settings.h" #include -#include +#include #ifndef _ # include @@ -52,7 +52,7 @@ void create_options( XfcePanelPlugin *plugin, CPUGraph *base ) xfce_panel_plugin_block_menu( plugin ); - dlg = gtk_dialog_new_with_buttons( _("CPU Graph Properties"), + dlg = xfce_titled_dialog_new_with_buttons( _("CPU Graph Properties"), GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( plugin ) ) ), GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, GTK_STOCK_CLOSE, @@ -64,11 +64,7 @@ void create_options( XfcePanelPlugin *plugin, CPUGraph *base ) gtk_container_set_border_width( GTK_CONTAINER( dlg ), 2 ); - header = xfce_create_header( NULL, _("CPU Graph") ); - gtk_widget_set_size_request( GTK_BIN( header )->child, -1, 32 ); - gtk_container_set_border_width( GTK_CONTAINER( header ), BORDER - 2 ); - gtk_widget_show( header ); - gtk_box_pack_start( GTK_BOX( GTK_DIALOG( dlg )->vbox ), header, FALSE, TRUE, 0 ); + xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG(dlg), _("CPU Graph")); sg = gtk_size_group_new( GTK_SIZE_GROUP_HORIZONTAL ); diff --git a/panel-plugin/settings.c b/panel-plugin/settings.c index 7835837..92dd552 100644 --- a/panel-plugin/settings.c +++ b/panel-plugin/settings.c @@ -1,5 +1,5 @@ #include "settings.h" -#include +#include static void default_command( const gchar ** command, gboolean * in_terminal, gboolean * startup_notification ) { -- 1.7.1.1