-rw-r--r-- | kalarmd/simplealarmdaemonapplet.cpp | 1 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonapplet.h | 1 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 18 |
3 files changed, 10 insertions, 10 deletions
diff --git a/kalarmd/simplealarmdaemonapplet.cpp b/kalarmd/simplealarmdaemonapplet.cpp index 7e8125d..94d8428 100644 --- a/kalarmd/simplealarmdaemonapplet.cpp +++ b/kalarmd/simplealarmdaemonapplet.cpp @@ -2,32 +2,33 @@ #include "simplealarmdaemonimpl.h" #include <qcopchannel_qws.h> #include <qlabel.h> #include <qapp.h> #include <qpe/resource.h> SimpleAlarmDaemonApplet::SimpleAlarmDaemonApplet() : mApplet( 0 ), ref( 0 ) { } SimpleAlarmDaemonApplet::~SimpleAlarmDaemonApplet() { delete mApplet; + mApplet = 0; } QWidget *SimpleAlarmDaemonApplet::applet( QWidget *parent ) { if ( !mApplet ) { mApplet = new SimpleAlarmDaemonImpl( parent ); if ( QApplication::desktop()->width() < 480 ) mApplet->setPixmap( Resource::loadPixmap( "ko16" ) ); else mApplet->setPixmap( Resource::loadPixmap( "ko24" ) ); QCopChannel* c = new QCopChannel("koalarm",mApplet , "channel" ) ; QObject::connect( c, SIGNAL (received ( const QCString &, const QByteArray & )),mApplet, SLOT(recieve( const QCString&, const QByteArray& ))); mApplet->show(); } return mApplet; diff --git a/kalarmd/simplealarmdaemonapplet.h b/kalarmd/simplealarmdaemonapplet.h index a4cbee4..1787bf3 100644 --- a/kalarmd/simplealarmdaemonapplet.h +++ b/kalarmd/simplealarmdaemonapplet.h @@ -1,23 +1,22 @@ #ifndef SIMPLEALARMDAEMONAPPLET_H #define SIMPLEALARMDAEMONAPPLET_H #include <qpe/taskbarappletinterface.h> class SimpleAlarmDaemonImpl; -class ScreenshotApplet; class SimpleAlarmDaemonApplet : public TaskbarAppletInterface { public: SimpleAlarmDaemonApplet(); virtual ~SimpleAlarmDaemonApplet(); QRESULT queryInterface( const QUuid&, QUnknownInterface** ); Q_REFCOUNT virtual QWidget *applet( QWidget *parent ); virtual int position() const; private: SimpleAlarmDaemonImpl *mApplet; ulong ref; diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 4ff6861..50c4605 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp @@ -35,66 +35,66 @@ #include <qlineedit.h> #include <qdialog.h> #include <qspinbox.h> #include <qtextstream.h> #include <qtopia/qcopenvelope_qws.h> #include <qtopia/alarmserver.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) : QLabel( parent ) { mAlarmDialog = new AlarmDialog( 0 ); - mPopUp = new QPopupMenu( 0 ); + mPopUp = new QPopupMenu( this ); mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); mPopUp->insertSeparator(); mPopUp->insertItem( "What's Todo?", this, SLOT ( showTodo() ) ); mPopUp->insertSeparator(); mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) ); mPopUp->insertSeparator(); mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) ); mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) ); mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) ); mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); mPopUp->insertSeparator(); mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); - mTimerPopUp = new QPopupMenu( mPopUp ); + mTimerPopUp = new QPopupMenu( this ); - mBeepPopUp = new QPopupMenu( mPopUp ); - mSoundPopUp = new QPopupMenu( mBeepPopUp ); - mPausePopUp = new QPopupMenu( mBeepPopUp ); - QPopupMenu* savePopUp = new QPopupMenu( mBeepPopUp ); + mBeepPopUp = new QPopupMenu( this ); + mSoundPopUp = new QPopupMenu( this ); + mPausePopUp = new QPopupMenu( this ); + QPopupMenu* savePopUp = new QPopupMenu( this ); savePopUp->insertItem( "Save", 0 ); savePopUp->insertItem( "Load", 1 ); mSoundPopUp->insertItem( "Buzzer", 0 ); mSoundPopUp->insertItem( "Wav file", 1 ); mPausePopUp->insertItem( " 1 sec", 1 ); mPausePopUp->insertItem( " 2 sec", 2 ); mPausePopUp->insertItem( " 3 sec", 3 ); mPausePopUp->insertItem( " 5 sec", 5 ); mPausePopUp->insertItem( "10 sec", 10 ); mPausePopUp->insertItem( "30 sec", 30 ); mPausePopUp->insertItem( " 1 min", 60 ); mPausePopUp->insertItem( " 5 min", 300 ); mPausePopUp->insertItem( "10 min", 600 ); - mSuspendPopUp = new QPopupMenu( mBeepPopUp ); + mSuspendPopUp = new QPopupMenu( this ); mSuspendPopUp->insertItem( "Off", 0 ); mSuspendPopUp->insertItem( " 1x", 1 ); mSuspendPopUp->insertItem( " 2x", 2 ); mSuspendPopUp->insertItem( " 3x", 3 ); mSuspendPopUp->insertItem( " 5x", 5 ); mSuspendPopUp->insertItem( "10x", 10 ); mSuspendPopUp->insertItem( "20x", 20 ); mSuspendPopUp->insertItem( "30x", 30 ); mBeepPopUp->insertItem( "Auto suspend",mSuspendPopUp ); mBeepPopUp->insertItem( "Beep interval",mPausePopUp ); mBeepPopUp->insertItem( "Replay",mSoundPopUp ); mBeepPopUp->insertItem( "Config",savePopUp ); mBeepPopUp->insertItem( "300", 300 ); mBeepPopUp->insertItem( "180", 180 ); mBeepPopUp->insertItem( "60", 60 ); mBeepPopUp->insertItem( "30", 30 ); @@ -129,33 +129,33 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) confPause( 1 ); mSuspend = 0; confSuspend( 0 ); if ( QApplication::desktop()->width() < 480 ) { wavAlarm = false; mSoundPopUp->setItemChecked ( 0, true ); } else { wavAlarm = true; mSoundPopUp->setItemChecked ( 1, true ); } saveSlot( 1 ); } SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() { - delete mPopUp; + //delete mPopUp; delete mAlarmDialog; } void SimpleAlarmDaemonImpl::saveSlot( int load ) { QString fileName = QDir::homeDirPath() +"/.kopialarmrc"; //qDebug("save %d ", load ); QFile file( fileName ); if ( load ) { if( !QFile::exists( fileName) ) return; if (!file.open( IO_ReadOnly ) ) { return ; } QString line; bool ok; int val; @@ -551,33 +551,33 @@ void SimpleAlarmDaemonImpl::showWN() void SimpleAlarmDaemonImpl::newTodo() { QCopEnvelope e("QPE/Application/kopi", "-newTodo"); } void SimpleAlarmDaemonImpl::newEvent() { QCopEnvelope e("QPE/Application/kopi", "-newEvent"); } void SimpleAlarmDaemonImpl::newMail() { QCopEnvelope e("QPE/Application/ompi", "newMail()"); } void SimpleAlarmDaemonImpl::showAdd() { - QCopEnvelope e("QPE/Application/kapi", " "); + QCopEnvelope e("QPE/Application/kapi", "raise()"); } void SimpleAlarmDaemonImpl::ringSync() { QCopEnvelope e("QPE/Application/kopi", "-ringSync"); } void SimpleAlarmDaemonImpl::newCountdown() { //recieve("cal_alarm", 10 ); } void SimpleAlarmDaemonImpl::simulate() { writeFile(); QString filename = getenv("QPEDIR") ; filename += "/pics/kdepim/korganizer/koalarm.wav"; startAlarm("Alarm simulation", filename ); |