[arch-commits] CVS update of extra/kde/kdebluetooth (kdebluetooth-trayicon-state.patch)

Thomas Baechler thomas at archlinux.org
Thu Jun 14 12:28:26 EDT 2007


    Date: Thursday, June 14, 2007 @ 12:28:26
  Author: thomas
    Path: /home/cvs-extra/extra/kde/kdebluetooth

   Added: kdebluetooth-trayicon-state.patch (1.1)

forgot to add trayicon patch before


-----------------------------------+
 kdebluetooth-trayicon-state.patch |  104 ++++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)


Index: extra/kde/kdebluetooth/kdebluetooth-trayicon-state.patch
diff -u /dev/null extra/kde/kdebluetooth/kdebluetooth-trayicon-state.patch:1.1
--- /dev/null	Thu Jun 14 12:28:25 2007
+++ extra/kde/kdebluetooth/kdebluetooth-trayicon-state.patch	Thu Jun 14 12:28:25 2007
@@ -0,0 +1,104 @@
+Index: kbluetooth/trayicon.cpp
+===================================================================
+--- kbluetooth/trayicon.cpp	(Revision 674824)
++++ kbluetooth/trayicon.cpp	(Revision 674945)
+@@ -20,6 +20,9 @@
+     iconConnectingBlinkState = false;
+     this->helpMenu = new KHelpMenu(this, KApplication::kApplication()->aboutData());
+     this->app = app;
++
++    manager = app->manager;
++
+     //iconState = IDLE;
+     KConfig *config = KGlobal::config();
+     config->setGroup("UI");
+@@ -129,10 +132,19 @@
+     connect(this, SIGNAL(quitSelected()),
+         this, SLOT(slotQuitSelected()));
+ 
++    // Connection state
++    adapter = new Adapter(manager->defaultAdapter(), app->conn);
++    connect(adapter, SIGNAL(remoteDeviceConnected(const QString&)), SLOT(slotIconConnected(const QString&)));
++    connect(adapter, SIGNAL(remoteDeviceDisconnected(const QString&)), SLOT(slotIconDisconnected(const QString&)));
++
++    connect(manager, SIGNAL(adapterRemoved(const QString&)), SLOT(slotIconAdapterChanged(const QString&)));
++    connect(manager, SIGNAL(adapterAdded(const QString&)), SLOT(slotIconAdapterChanged(const QString&)));
++
+ }
+ 
+ TrayIcon::~TrayIcon()
+ {
++    delete adapter;
+ }
+ 
+ void TrayIcon::setAlwaysShowIcon(bool state) {
+@@ -160,7 +172,6 @@
+ {
+     QString oldText = QToolTip::textFor(this);
+     QString newText = "";
+-    manager = app->manager;
+     Adapter::ConnectionList connList;
+ 	if (alwaysVisible) {
+ 	    if (manager->listAdapters().count() > 0) {
+@@ -179,13 +190,8 @@
+ 	Manager::AdapterList list = manager->listAdapters();
+ 	Manager::AdapterList::iterator it;
+ 	for (it = list.begin(); it != list.end(); ++it) {
+-		if (*it == manager->defaultAdapter()) {
+-			adapter = new Adapter((*it), app->conn);
+-			connList = adapter->listConnections();
+-		 } else {
+-			Adapter a((*it), app->conn);
+-			connList = a.listConnections();
+-		}
++		Adapter a((*it), app->conn);
++		connList = a.listConnections();
+ 		
+ 		if (connList.size()) {
+ 			setPixmap(iconConnected);
+@@ -385,6 +391,30 @@
+     }
+ }
+ 
++void TrayIcon::slotIconConnected(const QString& /*address*/)
++{
++	if (alwaysVisible)
++		setPixmap(iconConnected);
++
++}
++
++void TrayIcon::slotIconDisconnected(const QString& /*address*/)
++{
++	if (alwaysVisible)
++        	setPixmap(iconIdle);
++}
++
++void TrayIcon::slotIconAdapterChanged(const QString& /*address*/)
++{
++	if (!alwaysVisible)
++		return;
++
++	if (!manager->listAdapters().size())
++		setPixmap(iconNoAdapter);
++	else
++		setPixmap(iconIdle);
++}
++
+ #if 0 
+ // TODO : make use of KNofityClient 
+ void TrayIcon::slotConnectionComplete(int status, QString addr)
+Index: kbluetooth/trayicon.h
+===================================================================
+--- kbluetooth/trayicon.h	(Revision 674824)
++++ kbluetooth/trayicon.h	(Revision 674945)
+@@ -84,6 +84,10 @@
+     void slotAbout() { helpMenu->aboutApplication(); };
+     void slotShowHelp();
+     void updateIcon();
++    void slotIconConnected(const QString&);
++    void slotIconDisconnected(const QString&);
++    void slotIconAdapterChanged(const QString&);
++
+         
+ protected:
+     void mousePressEvent(QMouseEvent *e);




More information about the arch-commits mailing list