summaryrefslogtreecommitdiff
path: root/battstat
diff options
context:
space:
mode:
Diffstat (limited to 'battstat')
-rw-r--r--battstat/Makefile.am10
-rw-r--r--battstat/battstat-upower.c6
-rw-r--r--battstat/battstat_applet.c30
-rw-r--r--battstat/org.mate.applets.BattstatApplet.mate-panel-applet.in.in2
-rw-r--r--battstat/org.mate.panel.applet.BattstatAppletFactory.service.in2
5 files changed, 11 insertions, 39 deletions
diff --git a/battstat/Makefile.am b/battstat/Makefile.am
index 4985f251..21ff989d 100644
--- a/battstat/Makefile.am
+++ b/battstat/Makefile.am
@@ -25,6 +25,7 @@ DIST_SUBDIRS = docs sounds apmlib
AM_CPPFLAGS = \
$(MATE_APPLETS4_CFLAGS) \
+ $(MATEDESKTOP_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
$(HAL_CFLAGS) \
$(UPOWER_CFLAGS) \
@@ -34,10 +35,10 @@ AM_CPPFLAGS = \
-DBATTSTAT_MENU_UI_DIR=\""$(uidir)"\"
-libexec_PROGRAMS = battstat-applet-2
+libexec_PROGRAMS = battstat-applet
-battstat_applet_2_SOURCES = \
+battstat_applet_SOURCES = \
battstat.h \
pixmaps.h \
properties.c \
@@ -53,8 +54,9 @@ battstat_applet_2_SOURCES = \
battstat-upower.h
-battstat_applet_2_LDADD = \
+battstat_applet_LDADD = \
$(MATE_APPLETS4_LIBS) \
+ $(MATEDESKTOP_LIBS) \
$(LIBNOTIFY_LIBS) \
$(HAL_LIBS) \
$(APMLIB) \
@@ -91,7 +93,7 @@ org.mate.panel.applet.BattstatAppletFactory.service: $(service_in_files)
CLEANFILES = $(applet_DATA) $(applet_DATA).in $(service_DATA) $(gsettings_SCHEMAS_in) $(gsettings_SCHEMAS) *.gschema.valid
-uidir = $(datadir)/mate-2.0/ui
+uidir = $(datadir)/mate/ui
ui_DATA = battstat-applet-menu.xml
EXTRA_DIST = \
diff --git a/battstat/battstat-upower.c b/battstat/battstat-upower.c
index b0838176..792be860 100644
--- a/battstat/battstat-upower.c
+++ b/battstat/battstat-upower.c
@@ -325,15 +325,9 @@ error_dialog( const char *fmt , ...)
dialog = gtk_message_dialog_new( NULL, 0, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK, "%s", str);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped( G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (dialog) );
-#else
- g_signal_connect_swapped( GTK_OBJECT (dialog), "response",
- G_CALLBACK (gtk_widget_destroy),
- GTK_OBJECT (dialog) );
-#endif
gtk_widget_show_all( dialog );
}
diff --git a/battstat/battstat_applet.c b/battstat/battstat_applet.c
index 9de1ff7c..1c9d10c9 100644
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -44,6 +44,8 @@
#include <libnotify/notify.h>
#endif
+#include <libmate-desktop/mate-aboutdialog.h>
+
#include "battstat.h"
#include "pixmaps.h"
@@ -382,15 +384,9 @@ battstat_error_dialog( GtkWidget *applet, const char *msg )
gtk_window_set_screen( GTK_WINDOW (dialog),
gtk_widget_get_screen (GTK_WIDGET (applet)) );
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped( G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (dialog) );
-#else
- g_signal_connect_swapped( GTK_OBJECT (dialog), "response",
- G_CALLBACK (gtk_widget_destroy),
- GTK_OBJECT (dialog) );
-#endif
gtk_widget_show_all( dialog );
}
@@ -513,15 +509,9 @@ battery_full_dialog (GtkWidget *applet)
GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT,
NULL);
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (dialog));
-#else
- g_signal_connect_swapped (GTK_OBJECT (dialog), "response",
- G_CALLBACK (gtk_widget_destroy),
- GTK_OBJECT (dialog));
-#endif
gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
hbox = gtk_hbox_new (FALSE, 6);
@@ -677,11 +667,7 @@ battery_low_dialog( ProgressData *battery, BatteryStatus *info )
gtk_dialog_set_default_response( GTK_DIALOG (battery->battery_low_dialog),
GTK_RESPONSE_ACCEPT );
-#if GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect_swapped( G_OBJECT (battery->battery_low_dialog),
-#else
- g_signal_connect_swapped( GTK_OBJECT (battery->battery_low_dialog),
-#endif
"response",
G_CALLBACK (battery_low_dialog_destroy),
battery );
@@ -1018,12 +1004,8 @@ copy_gdk_pixmap( GdkPixmap *src, GdkGC *gc )
gint height, width;
GdkPixmap *dest;
- #if GTK_CHECK_VERSION(3, 0, 0)
width = gdk_window_get_width(GDK_WINDOW(src));
height = gdk_window_get_height(GDK_WINDOW(src));
- #else
- gdk_drawable_get_size(GDK_DRAWABLE(src), &width, &height);
- #endif
dest = gdk_pixmap_new( GDK_DRAWABLE( src ), width, height, -1 );
@@ -1420,7 +1402,7 @@ about_cb( GtkAction *action, ProgressData *battstat )
/* true */ _("HAL backend enabled.") :
/* false */ _("Legacy (non-HAL) backend enabled.")));
- gtk_show_about_dialog( NULL,
+ mate_show_about_dialog( NULL,
"version", VERSION,
"copyright", "\xC2\xA9 2000 The Gnulix Society, "
"\xC2\xA9 2002-2005 Free Software Foundation and "
@@ -1747,15 +1729,9 @@ create_layout(ProgressData *battstat)
g_object_ref( battstat->status );
g_object_ref( battstat->percent );
g_object_ref( battstat->battery );
-#if GTK_CHECK_VERSION (3, 0, 0)
g_object_ref_sink( G_OBJECT( battstat->status ) );
g_object_ref_sink( G_OBJECT( battstat->percent ) );
g_object_ref_sink( G_OBJECT( battstat->battery ) );
-#else
- g_object_ref_sink( GTK_OBJECT( battstat->status ) );
- g_object_ref_sink( GTK_OBJECT( battstat->percent ) );
- g_object_ref_sink( GTK_OBJECT( battstat->battery ) );
-#endif
/* Let reconfigure_layout know that the table is currently empty. */
battstat->layout.status = LAYOUT_NONE;
diff --git a/battstat/org.mate.applets.BattstatApplet.mate-panel-applet.in.in b/battstat/org.mate.applets.BattstatApplet.mate-panel-applet.in.in
index f9b6d3ed..9600dfc7 100644
--- a/battstat/org.mate.applets.BattstatApplet.mate-panel-applet.in.in
+++ b/battstat/org.mate.applets.BattstatApplet.mate-panel-applet.in.in
@@ -1,6 +1,6 @@
[Applet Factory]
Id=BattstatAppletFactory
-Location=@LIBEXECDIR@/battstat-applet-2
+Location=@LIBEXECDIR@/battstat-applet
_Name=Battstat Factory
_Description=Battstat Factory
diff --git a/battstat/org.mate.panel.applet.BattstatAppletFactory.service.in b/battstat/org.mate.panel.applet.BattstatAppletFactory.service.in
index b2983113..050fd3c8 100644
--- a/battstat/org.mate.panel.applet.BattstatAppletFactory.service.in
+++ b/battstat/org.mate.panel.applet.BattstatAppletFactory.service.in
@@ -1,3 +1,3 @@
[D-BUS Service]
Name=org.mate.panel.applet.BattstatAppletFactory
-Exec=@LIBEXECDIR@/battstat-applet-2
+Exec=@LIBEXECDIR@/battstat-applet