r3149 - in trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt: . src

stefan at sita.openmoko.org stefan at sita.openmoko.org
Fri Oct 12 11:37:42 CEST 2007


Author: stefan
Date: 2007-10-12 11:37:38 +0200 (Fri, 12 Oct 2007)
New Revision: 3149

Modified:
   trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/ChangeLog
   trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/configure.ac
   trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/src/openmoko-panel-bt.c
Log:
2007-10-12  Stefan Schmidt <stefan at openmoko.org>

    * src/openmoko-panel-bt.c:
	* configure.ac:
	Use libnotify dor showing changes instead of dialog boxes. Patch by
	Alexandre d'Alton <alex at alexdalton.org>


Modified: trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/ChangeLog	2007-10-12 09:14:48 UTC (rev 3148)
+++ trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/ChangeLog	2007-10-12 09:37:38 UTC (rev 3149)
@@ -1,3 +1,10 @@
+2007-10-12  Stefan Schmidt <stefan at openmoko.org>
+
+	* src/openmoko-panel-bt.c:
+	* configure.ac:
+	Use libnotify dor showing changes instead of dialog boxes. Patch by
+	Alexandre d'Alton <alex at alexdalton.org>
+
 2007-09-02	Michael Lauer <mickey at openmoko.org>
 
 	* src/openmoko-panel-bt.c:

Modified: trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/configure.ac
===================================================================
--- trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/configure.ac	2007-10-12 09:14:48 UTC (rev 3148)
+++ trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/configure.ac	2007-10-12 09:37:38 UTC (rev 3149)
@@ -11,7 +11,7 @@
 AC_PROG_LIBTOOL
 
 # base deps
-PKG_CHECK_MODULES(OPENMOKO, libmokopanelui2)
+PKG_CHECK_MODULES(OPENMOKO, libmokopanelui2 libnotify)
 
 LIBS="$LIBS $OPENMOKO_LIBS"
 CFLAGS="$CFLAGS $OPENMOKO_CFLAGS" 

Modified: trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/src/openmoko-panel-bt.c
===================================================================
--- trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/src/openmoko-panel-bt.c	2007-10-12 09:14:48 UTC (rev 3148)
+++ trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/src/openmoko-panel-bt.c	2007-10-12 09:37:38 UTC (rev 3149)
@@ -14,7 +14,7 @@
  *
  */
 #include <libmokopanelui2/moko-panel-applet.h>
-
+#include <libnotify/notify.h>
 #include <gtk/gtkimage.h>
 #include <gtk/gtkbox.h>
 #include <gtk/gtk.h>
@@ -29,32 +29,6 @@
   int state;
 } BtApplet;
 
-void quick_message(gchar *message) {
-
-   GtkWidget *dialog, *label, *okay_button;
-
-   /* Create the widgets */
-
-   dialog = gtk_dialog_new();
-   label = gtk_label_new (message);
-   okay_button = gtk_button_new_with_label("Okay");
-
-   /* Ensure that the dialog box is destroyed when the user clicks ok. */
-
-   gtk_signal_connect_object (GTK_OBJECT (okay_button), "clicked",
-                              GTK_SIGNAL_FUNC (gtk_widget_destroy), dialog);
-   gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->action_area),
-                      okay_button);
-
-   gtk_window_set_title(GTK_WINDOW(dialog), "Bt Status");
-
-   /* Add the label, and show everything we've added to the dialog. */
-
-   gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
-                      label);
-   gtk_widget_show_all (dialog);
-}
-
 static int
 read_bt_power(void)
 {
@@ -96,18 +70,24 @@
 bt_applet_power_on(GtkWidget* menu, BtApplet* applet)
 {
     int ret;
+    NotifyNotification * nn;
+
     ret = set_bt_power(1);
     mb_panel_update(applet, 1);
-    quick_message("  Bluetooth turned on  \n\n");
+    nn = notify_notification_new ("Bluetooh turned on", NULL, NULL, NULL);
+    notify_notification_show (nn, NULL);
 }
 
 static void
 bt_applet_power_off(GtkWidget* menu, BtApplet* applet)
 {
     int ret;
+    NotifyNotification * nn;
+
     ret = set_bt_power(0);
     mb_panel_update(applet, 0);
-    quick_message("  Bluetooth turned off  \n\n");
+    nn = notify_notification_new ("Bluetooh turned off", NULL, NULL, NULL);
+    notify_notification_show (nn, NULL);
 }
 
 static void
@@ -115,12 +95,14 @@
 {
     int ret;
     char tmp_string[256];
+    NotifyNotification * nn;
 
     ret = read_bt_power();
 
     sprintf(tmp_string, "  Bluetooth is %s  \n\n", ret ? "on" : "off");
 
-    quick_message(tmp_string);
+    nn = notify_notification_new (tmp_string, NULL, NULL, NULL);
+    notify_notification_show (nn, NULL);
 }
 
 static void





More information about the commitlog mailing list