summaryrefslogtreecommitdiffabout
path: root/kalarmd/simplealarmdaemonapplet.cpp
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /kalarmd/simplealarmdaemonapplet.cpp
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'kalarmd/simplealarmdaemonapplet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonapplet.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/kalarmd/simplealarmdaemonapplet.cpp b/kalarmd/simplealarmdaemonapplet.cpp
new file mode 100644
index 0000000..bb89606
--- a/dev/null
+++ b/kalarmd/simplealarmdaemonapplet.cpp
@@ -0,0 +1,58 @@
1#include "simplealarmdaemonapplet.h"
2
3#include "simplealarmdaemonimpl.h"
4
5#include <qpe/global.h>
6#include <qcopchannel_qws.h>
7#include <qlabel.h>
8#include <qapp.h>
9#include <qpe/resource.h>
10SimpleAlarmDaemonApplet::SimpleAlarmDaemonApplet()
11 : mApplet( 0 ), ref( 0 )
12{
13
14}
15
16SimpleAlarmDaemonApplet::~SimpleAlarmDaemonApplet()
17{
18 delete mApplet;
19}
20
21
22QWidget *SimpleAlarmDaemonApplet::applet( QWidget *parent )
23{
24 if ( !mApplet ) {
25 mApplet = new SimpleAlarmDaemonImpl( parent );
26 if ( QApplication::desktop()->width() < 480 )
27 mApplet->setPixmap( Resource::loadPixmap( "ko16" ) );
28 else
29 mApplet->setPixmap( Resource::loadPixmap( "ko24" ) );
30 QCopChannel* c = new QCopChannel("koalarm",mApplet , "channel" ) ;
31 QObject::connect( c, SIGNAL (received ( const QCString &, const QByteArray & )),mApplet, SLOT(recieve( const QCString&, const QByteArray& )));
32 mApplet->show();
33 }
34 return mApplet;
35}
36
37int SimpleAlarmDaemonApplet::position() const
38{
39 return 7;
40}
41
42QRESULT SimpleAlarmDaemonApplet::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
43{
44 *iface = 0;
45 if ( uuid == IID_QUnknown )
46 *iface = this;
47 else if ( uuid == IID_TaskbarApplet )
48 *iface = this;
49
50 if ( *iface )
51 (*iface)->addRef();
52 return QS_OK;
53}
54
55Q_EXPORT_INTERFACE()
56{
57 Q_CREATE_INSTANCE( SimpleAlarmDaemonApplet )
58}