[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeutils/klaptopdaemon
From:       Dirk Mueller <mueller () kde ! org>
Date:       2003-09-24 10:53:01
[Download RAW message or body]

CVS commit by mueller: 

replace the messagebox-popups with sneaky KPassivePopups
that don't steal my focus and don't force me to do an extra click.


  M +1 -1      Makefile.am   1.42
  M +1 -2      daemon_state.cpp   1.6
  M +14 -5     laptop_daemon.cpp   1.49


--- kdeutils/klaptopdaemon/Makefile.am  #1.41:1.42
@@ -9,5 +9,5 @@
 
 kded_klaptopdaemon_la_SOURCES = laptop_daemon.cpp kpcmcia.cpp xautolock.cc \
-        kpcmciainfo.cpp daemondock.cpp notify.cpp laptop_daemon.skel  
+        kpcmciainfo.cpp daemondock.cpp laptop_daemon.skel  
 kded_klaptopdaemon_la_LDFLAGS = $(all_libraries) -module -avoid-version  -lXtst
 kded_klaptopdaemon_la_LIBADD   = $(LIB_KDEUI) libkcmlaptop.la

--- kdeutils/klaptopdaemon/daemon_state.cpp  #1.5:1.6
@@ -37,5 +37,4 @@
 #include "daemon_state.h"
 #include "portable.h"
-#include "notify.h"
 #include <kaboutdata.h>
 #include <kaudioplayer.h>

--- kdeutils/klaptopdaemon/laptop_daemon.cpp  #1.48:1.49
@@ -37,5 +37,4 @@
 #include "laptop_daemon.h"
 #include "portable.h"
-#include "notify.h"
 #include <kaboutdata.h>
 #include <kaudioplayer.h>
@@ -43,4 +42,5 @@
 #include <sys/ioctl.h>
 #include <kmessagebox.h>
+#include <kpassivepopup.h>
 #include <dcopclient.h>
 #include <qsocketnotifier.h>
@@ -541,7 +541,16 @@ void laptop_daemon::haveBatteryLow(int t
         // notify if we must (must be last since it's synchronous)
         if (s.notify[t]) {
-                KBatteryNotify *notify_dlg = new KBatteryNotify(num, type);
-                notify_dlg->show();
-                // will delete itself
+            if (type) {
+                KPassivePopup::message(i18n("Battery power is running out!"),
+                                       i18n("%1 % charge left.").arg(num),
+                                       BarIcon("laptop_battery"), dock_widget,
+                                       0, 20000);
+            }
+            else {
+                KPassivePopup::message(i18n("Battery power is running out!"),
+                                       i18n("%1 minutes left.").arg(num),
+                                       BarIcon("laptop_battery"), dock_widget,
+                                       0, 20000);
+            }
         }
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic