gnome-power-manager r3127 - in trunk: . applets/brightness applets/inhibit po src



Author: rhughes
Date: Mon Dec 15 12:43:59 2008
New Revision: 3127
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3127&view=rev

Log:
2008-12-15  Richard Hughes  <richard hughsie com>

* applets/brightness/Makefile.am:
* applets/brightness/brightness-applet.c: (gpm_applet_help_cb):
* applets/brightness/gpm-common.c:
* applets/inhibit/Makefile.am:
* applets/inhibit/gpm-common.c:
* applets/inhibit/inhibit-applet.c: (gpm_applet_help_cb):
* src/gpm-common.c: (gpm_help_display):
* src/gpm-common.h:
Remove libgnomeui dependency from brightness and inhibit applets.
Original patch from Lucas Rocha <lucasr at mundo gmail com>.
Fixes #564531


Added:
   trunk/applets/brightness/gpm-common.c   (contents, props changed)
   trunk/applets/inhibit/gpm-common.c   (contents, props changed)
Modified:
   trunk/ChangeLog
   trunk/applets/brightness/Makefile.am
   trunk/applets/brightness/brightness-applet.c
   trunk/applets/inhibit/Makefile.am
   trunk/applets/inhibit/inhibit-applet.c
   trunk/po/POTFILES.skip
   trunk/src/gpm-common.c
   trunk/src/gpm-common.h

Modified: trunk/applets/brightness/Makefile.am
==============================================================================
--- trunk/applets/brightness/Makefile.am	(original)
+++ trunk/applets/brightness/Makefile.am	Mon Dec 15 12:43:59 2008
@@ -14,16 +14,24 @@
 	-DLIBDIR=\""$(libdir)"\" 				\
 	-DVERSION="\"$(VERSION)\"" 				\
 	-DGPM_DATA=\"$(pkgdatadir)\"				\
-	-DEGG_LOG_FILE=\""~/gnome-power-manager.log"\"	\
-	-DEGG_VERBOSE="\"GPM_VERBOSE\""			\
-	-DEGG_LOGGING="\"GPM_LOGGING\""			\
-	-DEGG_CONSOLE="\"GPM_CONSOLE\""			\
+	-DEGG_LOG_FILE=\""~/gnome-power-manager.log"\"		\
+	-DEGG_VERBOSE="\"GPM_VERBOSE\""				\
+	-DEGG_LOGGING="\"GPM_LOGGING\""				\
+	-DEGG_CONSOLE="\"GPM_CONSOLE\""				\
 	-I$(top_srcdir)/libdbus-glib				\
 	$(NULL)
 
 libexec_PROGRAMS=gnome-brightness-applet
 
-gnome_brightness_applet_SOURCES = brightness-applet.c egg-dbus-monitor.c egg-dbus-monitor.h egg-debug.c egg-debug.h gpm-common.h
+gnome_brightness_applet_SOURCES =				\
+	brightness-applet.c					\
+	egg-dbus-monitor.c					\
+	egg-dbus-monitor.h					\
+	egg-debug.c						\
+	egg-debug.h						\
+	gpm-common.c						\
+	gpm-common.h
+
 gnome_brightness_applet_LDADD =					\
 	$(DBUS_LIBS)						\
 	$(GNOME_LIBS)

Modified: trunk/applets/brightness/brightness-applet.c
==============================================================================
--- trunk/applets/brightness/brightness-applet.c	(original)
+++ trunk/applets/brightness/brightness-applet.c	Mon Dec 15 12:43:59 2008
@@ -30,7 +30,6 @@
 #include <panel-applet.h>
 #include <gtk/gtk.h>
 #include <gtk/gtkbox.h>
-#include <libgnomeui/gnome-help.h>
 #include <gdk/gdkkeysyms.h>
 #include <glib-object.h>
 #include <dbus/dbus-glib.h>
@@ -795,24 +794,7 @@
 static void
 gpm_applet_help_cb (BonoboUIComponent *uic, gpointer data, const gchar *verbname)
 {
-	GError *error = NULL;
-	GpmBrightnessApplet *applet = GPM_BRIGHTNESS_APPLET(data);
-	GnomeProgram *program = gnome_program_get ();
-
-	gnome_help_display_with_doc_id (program, "gnome-power-manager",
-					"gnome-power-manager.xml",
-					"applets-brightness", &error);
-	if (error != NULL) {
-		GtkWidget *dialog =
-			gtk_message_dialog_new (GTK_WINDOW (GTK_WIDGET(applet)->parent),
-						GTK_DIALOG_DESTROY_WITH_PARENT,
-						GTK_MESSAGE_ERROR,
-						GTK_BUTTONS_CLOSE,
-						"%s", error->message);
-		gtk_dialog_run (GTK_DIALOG (dialog));
-		gtk_widget_destroy (dialog);
-		g_error_free (error);
-	}
+	gpm_help_display ("applets-brightness");
 }
 
 /**

Added: trunk/applets/brightness/gpm-common.c
==============================================================================
--- (empty file)
+++ trunk/applets/brightness/gpm-common.c	Mon Dec 15 12:43:59 2008
@@ -0,0 +1 @@
+link ../../src/gpm-common.c
\ No newline at end of file

Modified: trunk/applets/inhibit/Makefile.am
==============================================================================
--- trunk/applets/inhibit/Makefile.am	(original)
+++ trunk/applets/inhibit/Makefile.am	Mon Dec 15 12:43:59 2008
@@ -14,16 +14,24 @@
 	-DLIBDIR=\""$(libdir)"\" 				\
 	-DVERSION="\"$(VERSION)\"" 				\
 	-DGPM_DATA=\"$(pkgdatadir)\"				\
-	-DEGG_LOG_FILE=\""~/gnome-power-manager.log"\"	\
-	-DEGG_VERBOSE="\"GPM_VERBOSE\""			\
-	-DEGG_LOGGING="\"GPM_LOGGING\""			\
-	-DEGG_CONSOLE="\"GPM_CONSOLE\""			\
+	-DEGG_LOG_FILE=\""~/gnome-power-manager.log"\"		\
+	-DEGG_VERBOSE="\"GPM_VERBOSE\""				\
+	-DEGG_LOGGING="\"GPM_LOGGING\""				\
+	-DEGG_CONSOLE="\"GPM_CONSOLE\""				\
 	-I$(top_srcdir)/libdbus-glib				\
 	$(NULL)
 
 libexec_PROGRAMS=gnome-inhibit-applet
 
-gnome_inhibit_applet_SOURCES = inhibit-applet.c egg-dbus-monitor.c egg-dbus-monitor.h egg-debug.c egg-debug.h gpm-common.h
+gnome_inhibit_applet_SOURCES =					\
+	inhibit-applet.c					\
+	egg-dbus-monitor.c					\
+	egg-dbus-monitor.h					\
+	egg-debug.c						\
+	egg-debug.h						\
+	gpm-common.c						\
+	gpm-common.h
+
 gnome_inhibit_applet_LDADD =					\
 	$(DBUS_LIBS)						\
 	$(GNOME_LIBS)

Added: trunk/applets/inhibit/gpm-common.c
==============================================================================
--- (empty file)
+++ trunk/applets/inhibit/gpm-common.c	Mon Dec 15 12:43:59 2008
@@ -0,0 +1 @@
+link ../../src/gpm-common.c
\ No newline at end of file

Modified: trunk/applets/inhibit/inhibit-applet.c
==============================================================================
--- trunk/applets/inhibit/inhibit-applet.c	(original)
+++ trunk/applets/inhibit/inhibit-applet.c	Mon Dec 15 12:43:59 2008
@@ -30,7 +30,6 @@
 #include <panel-applet.h>
 #include <gtk/gtk.h>
 #include <gtk/gtkbox.h>
-#include <libgnomeui/gnome-help.h>
 #include <glib-object.h>
 #include <dbus/dbus-glib.h>
 
@@ -465,24 +464,7 @@
 static void
 gpm_applet_help_cb (BonoboUIComponent *uic, gpointer data, const gchar *verbname)
 {
-	GError *error = NULL;
-	GpmInhibitApplet *applet = GPM_INHIBIT_APPLET(data);
-	GnomeProgram *program = gnome_program_get ();
-
-	gnome_help_display_with_doc_id (program, "gnome-power-manager",
-					"gnome-power-manager.xml",
-					"applets-inhibit", &error);
-	if (error != NULL) {
-		GtkWidget *dialog =
-			gtk_message_dialog_new (GTK_WINDOW (GTK_WIDGET(applet)->parent),
-						GTK_DIALOG_DESTROY_WITH_PARENT,
-						GTK_MESSAGE_ERROR,
-						GTK_BUTTONS_CLOSE,
-						"%s", error->message);
-		gtk_dialog_run (GTK_DIALOG (dialog));
-		gtk_widget_destroy (dialog);
-		g_error_free (error);
-	}
+	gpm_help_display ("applets-inhibit");
 }
 
 /**

Modified: trunk/po/POTFILES.skip
==============================================================================
--- trunk/po/POTFILES.skip	(original)
+++ trunk/po/POTFILES.skip	Mon Dec 15 12:43:59 2008
@@ -5,4 +5,5 @@
 data/gnome-power-statistics.desktop.in
 data/gpm-qos.glade
 src/gpm-engine-old.c
-
+applets/brightness/gpm-common.c
+applets/inhibit/gpm-common.c

Modified: trunk/src/gpm-common.c
==============================================================================
--- trunk/src/gpm-common.c	(original)
+++ trunk/src/gpm-common.c	Mon Dec 15 12:43:59 2008
@@ -123,7 +123,7 @@
  * @link_id: Subsection of gnome-power-manager help section
  **/
 void
-gpm_help_display (char * link_id)
+gpm_help_display (const gchar *link_id)
 {
 	GError *error = NULL;
 	char *command;

Modified: trunk/src/gpm-common.h
==============================================================================
--- trunk/src/gpm-common.h	(original)
+++ trunk/src/gpm-common.h	Mon Dec 15 12:43:59 2008
@@ -189,7 +189,7 @@
 gchar		*gpm_get_timestring		(guint		 time);
 GpmIconPolicy	 gpm_tray_icon_mode_from_string	(const gchar	*mode);
 const gchar	*gpm_tray_icon_mode_to_string	(GpmIconPolicy	 mode);
-void 		 gpm_help_display		(char		*link_id);
+void 		 gpm_help_display		(const gchar	*link_id);
 
 G_END_DECLS
 



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