Bug 63752 - Auto-Away On Desktop Lock
Summary: Auto-Away On Desktop Lock
Status: RESOLVED REMIND
Alias: None
Product: kopete
Classification: Applications
Component: general (show other bugs)
Version: 0.7.1
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 71730 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-05 14:09 UTC by Thomas Kesselheim
Modified: 2004-01-03 10:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to enable. (912 bytes, patch)
2003-09-17 13:09 UTC, Olivier Goffart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kesselheim 2003-09-05 14:09:59 UTC
Version:           0.7.1 (using KDE 3.1.3)
Installed from:     (3.0)
Compiler:          gcc version 2.95.4 20011002 (Debian prerelease)
OS:          Linux (i686) release 2.4.21

It would be really helpful if the status could automatically be set to "away" when the desktop is locked. Many users quickly click on the desktop lock when leaving their computer and so this could be combined with an Auto-Away.
Comment 1 Chris Chapin 2003-09-11 22:21:50 UTC
Subject: Re: Auto-Away On Desktop Lock

ok so i checked into this and it looks like there's not signal emitted when 
the desktop is locked. 
"<ossi> sadly, there is no such signal ... i had to hack it directly into 
kdesktop_lock to let kdm know ... :(" 
dcop mabey?

Comment 2 Martijn Klingens 2003-09-13 00:48:35 UTC
Subject: Re: [Kopete-devel]  Auto-Away On Desktop Lock

On Thursday 11 September 2003 22:21, Chris Chapin wrote:
> ok so i checked into this and it looks like there's not signal emitted when
> the desktop is locked.
> "<ossi> sadly, there is no such signal ... i had to hack it directly into
> kdesktop_lock to let kdm know ... :("
> dcop mabey?

http://lists.kde.org/?l=kde-cvs&m=106330075012138&w=2

Whoever feels like it can add it or at least send a patch for review :)

Comment 3 Olivier Goffart 2003-09-17 13:06:01 UTC
Subject: kdenetwork/kopete/kopete

CVS commit by ogoffart: 

make possible to go away with DCOP.
also, commented code to go away when desktop lock.
this is commented because of the feature frezee.

CCMAIL: 63752@bugs.kde.org


  M +27 -0     kopeteiface.cpp   1.26
  M +35 -0     kopeteiface.h   1.18


--- kdenetwork/kopete/kopete/kopeteiface.cpp  #1.25:1.26
@@ -18,4 +18,6 @@
 #include <kmessagebox.h>
 #include <klocale.h>
+#include <kconfig.h>
+#include <kglobal.h>
 
 #include "kopeteiface.h"
@@ -25,8 +27,18 @@
 #include "kopetepluginmanager.h"
 #include "kopeteprotocol.h"
+#include "kopeteaway.h"
 
 
 KopeteIface::KopeteIface() : DCOPObject( "KopeteIface" )
 {
+#if 0 //disabled because of feature frezee.   TODO: enable after kde 3.2
+        KConfig *config = KGlobal::config();
+        config->setGroup("AutoAway");
+
+        if (config->readBoolEntry("UseAutoAway", true))
+                connectDCOPSignal("kdesktop", "KScreensaverIface", "KDE_start_screensaver()", "setAutoAway()", false);
+        else
+                disconnectDCOPSignal("kdesktop", "KScreensaverIface", "KDE_start_screensaver()", "setAutoAway()");
+#endif
 }
 
@@ -187,4 +199,19 @@ bool KopeteIface::unloadPlugin( const QS
                 argument.prepend( "kopete_" );
         return KopetePluginManager::self()->unloadPlugin( argument );
+}
+
+void KopeteIface::setAway()
+{
+        KopeteAccountManager::manager()->setAwayAll();
+}
+
+void KopeteIface::setAvailable()
+{
+        KopeteAccountManager::manager()->setAvailableAll();
+}
+
+void KopeteIface::setAutoAway()
+{
+        KopeteAway::getInstance()->setAutoAway();
 }
 

--- kdenetwork/kopete/kopete/kopeteiface.h  #1.17:1.18
@@ -65,11 +65,46 @@ k_dcop:
                 const QString &displayName, const QString &groupName = QString::null );
 
+        /**
+         * return a list of alls accounts.
+         * form: XXXProtocol||AccountId
+         */
         QStringList accounts();
 
+        /**
+         * connect a given account in the given protocol
+         */
         void connect(const QString &protocolName, const QString &accountId);
+        /**
+         * disconnect a given account in the given protocol
+         */
         void disconnect(const QString &protocolName, const QString &accountId);
 
+        /**
+         * load a plugin
+         * the name is the name of the library: example: kopete_msn
+         * but you can ommit the kopete_ prefix
+         */
         bool loadPlugin( const QString& name );
+        /**
+         * unload a plugin
+         * the name is the name of the library: example: kopete_msn
+         * but you can ommit the kopete_ prefix
+         */
         bool unloadPlugin( const QString& name );
+
+        /**
+         * set all account away using the global away function
+         */
+        void setAway();
+        /**
+         * set Available all accountes
+         */
+        void setAvailable();
+        /**
+         * set all account away using the auto away funciton.
+         * accounts will return online if activity is detected again
+         */
+        void setAutoAway();
+
 };
 


Comment 4 Olivier Goffart 2003-09-17 13:09:09 UTC
Created attachment 2487 [details]
Patch to enable.

Here is a patch to enable the autoAway when the desktop is locked.
Comment 5 Olivier Goffart 2003-09-17 13:10:38 UTC
close the bug since it's already in the code 
Comment 6 Olivier Goffart 2004-01-03 10:04:25 UTC
*** Bug 71730 has been marked as a duplicate of this bug. ***