author | zautrix <zautrix> | 2004-10-27 13:36:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-27 13:36:25 (UTC) |
commit | e099c37ac90e95c5a3110941aaae2be229bccb8e (patch) (unidiff) | |
tree | dad2ae54474767c4c5797e1780c4a3fee8c132e5 /kalarmd/simplealarmdaemonimpl.cpp | |
parent | 2f3396d84d2f3c92e1e0e420d677892c1f9c0778 (diff) | |
download | kdepimpi-e099c37ac90e95c5a3110941aaae2be229bccb8e.zip kdepimpi-e099c37ac90e95c5a3110941aaae2be229bccb8e.tar.gz kdepimpi-e099c37ac90e95c5a3110941aaae2be229bccb8e.tar.bz2 |
wn view enhancements
Diffstat (limited to 'kalarmd/simplealarmdaemonimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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 @@ | |||
35 | #include <qlineedit.h> | 35 | #include <qlineedit.h> |
36 | #include <qdialog.h> | 36 | #include <qdialog.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qtextstream.h> | 38 | #include <qtextstream.h> |
39 | #include <qtopia/qcopenvelope_qws.h> | 39 | #include <qtopia/qcopenvelope_qws.h> |
40 | #include <qtopia/alarmserver.h> | 40 | #include <qtopia/alarmserver.h> |
41 | 41 | ||
42 | #include <stdlib.h> | 42 | #include <stdlib.h> |
43 | #include <stdio.h> | 43 | #include <stdio.h> |
44 | #include <unistd.h> | 44 | #include <unistd.h> |
45 | 45 | ||
46 | 46 | ||
47 | SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | 47 | SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) |
48 | : QLabel( parent ) | 48 | : QLabel( parent ) |
49 | { | 49 | { |
50 | mAlarmDialog = new AlarmDialog( 0 ); | 50 | mAlarmDialog = new AlarmDialog( 0 ); |
51 | mPopUp = new QPopupMenu( 0 ); | 51 | mPopUp = new QPopupMenu( this ); |
52 | mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); | 52 | mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); |
53 | mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); | 53 | mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); |
54 | mPopUp->insertSeparator(); | 54 | mPopUp->insertSeparator(); |
55 | mPopUp->insertItem( "What's Todo?", this, SLOT ( showTodo() ) ); | 55 | mPopUp->insertItem( "What's Todo?", this, SLOT ( showTodo() ) ); |
56 | mPopUp->insertSeparator(); | 56 | mPopUp->insertSeparator(); |
57 | mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) ); | 57 | mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) ); |
58 | mPopUp->insertSeparator(); | 58 | mPopUp->insertSeparator(); |
59 | mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) ); | 59 | mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) ); |
60 | mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) ); | 60 | mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) ); |
61 | mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) ); | 61 | mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) ); |
62 | mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); | 62 | mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); |
63 | mPopUp->insertSeparator(); | 63 | mPopUp->insertSeparator(); |
64 | mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); | 64 | mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); |
65 | mTimerPopUp = new QPopupMenu( mPopUp ); | 65 | mTimerPopUp = new QPopupMenu( this ); |
66 | 66 | ||
67 | mBeepPopUp = new QPopupMenu( mPopUp ); | 67 | mBeepPopUp = new QPopupMenu( this ); |
68 | mSoundPopUp = new QPopupMenu( mBeepPopUp ); | 68 | mSoundPopUp = new QPopupMenu( this ); |
69 | mPausePopUp = new QPopupMenu( mBeepPopUp ); | 69 | mPausePopUp = new QPopupMenu( this ); |
70 | QPopupMenu* savePopUp = new QPopupMenu( mBeepPopUp ); | 70 | QPopupMenu* savePopUp = new QPopupMenu( this ); |
71 | savePopUp->insertItem( "Save", 0 ); | 71 | savePopUp->insertItem( "Save", 0 ); |
72 | savePopUp->insertItem( "Load", 1 ); | 72 | savePopUp->insertItem( "Load", 1 ); |
73 | mSoundPopUp->insertItem( "Buzzer", 0 ); | 73 | mSoundPopUp->insertItem( "Buzzer", 0 ); |
74 | mSoundPopUp->insertItem( "Wav file", 1 ); | 74 | mSoundPopUp->insertItem( "Wav file", 1 ); |
75 | mPausePopUp->insertItem( " 1 sec", 1 ); | 75 | mPausePopUp->insertItem( " 1 sec", 1 ); |
76 | mPausePopUp->insertItem( " 2 sec", 2 ); | 76 | mPausePopUp->insertItem( " 2 sec", 2 ); |
77 | mPausePopUp->insertItem( " 3 sec", 3 ); | 77 | mPausePopUp->insertItem( " 3 sec", 3 ); |
78 | mPausePopUp->insertItem( " 5 sec", 5 ); | 78 | mPausePopUp->insertItem( " 5 sec", 5 ); |
79 | mPausePopUp->insertItem( "10 sec", 10 ); | 79 | mPausePopUp->insertItem( "10 sec", 10 ); |
80 | mPausePopUp->insertItem( "30 sec", 30 ); | 80 | mPausePopUp->insertItem( "30 sec", 30 ); |
81 | mPausePopUp->insertItem( " 1 min", 60 ); | 81 | mPausePopUp->insertItem( " 1 min", 60 ); |
82 | mPausePopUp->insertItem( " 5 min", 300 ); | 82 | mPausePopUp->insertItem( " 5 min", 300 ); |
83 | mPausePopUp->insertItem( "10 min", 600 ); | 83 | mPausePopUp->insertItem( "10 min", 600 ); |
84 | mSuspendPopUp = new QPopupMenu( mBeepPopUp ); | 84 | mSuspendPopUp = new QPopupMenu( this ); |
85 | mSuspendPopUp->insertItem( "Off", 0 ); | 85 | mSuspendPopUp->insertItem( "Off", 0 ); |
86 | mSuspendPopUp->insertItem( " 1x", 1 ); | 86 | mSuspendPopUp->insertItem( " 1x", 1 ); |
87 | mSuspendPopUp->insertItem( " 2x", 2 ); | 87 | mSuspendPopUp->insertItem( " 2x", 2 ); |
88 | mSuspendPopUp->insertItem( " 3x", 3 ); | 88 | mSuspendPopUp->insertItem( " 3x", 3 ); |
89 | mSuspendPopUp->insertItem( " 5x", 5 ); | 89 | mSuspendPopUp->insertItem( " 5x", 5 ); |
90 | mSuspendPopUp->insertItem( "10x", 10 ); | 90 | mSuspendPopUp->insertItem( "10x", 10 ); |
91 | mSuspendPopUp->insertItem( "20x", 20 ); | 91 | mSuspendPopUp->insertItem( "20x", 20 ); |
92 | mSuspendPopUp->insertItem( "30x", 30 ); | 92 | mSuspendPopUp->insertItem( "30x", 30 ); |
93 | mBeepPopUp->insertItem( "Auto suspend",mSuspendPopUp ); | 93 | mBeepPopUp->insertItem( "Auto suspend",mSuspendPopUp ); |
94 | mBeepPopUp->insertItem( "Beep interval",mPausePopUp ); | 94 | mBeepPopUp->insertItem( "Beep interval",mPausePopUp ); |
95 | mBeepPopUp->insertItem( "Replay",mSoundPopUp ); | 95 | mBeepPopUp->insertItem( "Replay",mSoundPopUp ); |
96 | mBeepPopUp->insertItem( "Config",savePopUp ); | 96 | mBeepPopUp->insertItem( "Config",savePopUp ); |
97 | mBeepPopUp->insertItem( "300", 300 ); | 97 | mBeepPopUp->insertItem( "300", 300 ); |
98 | mBeepPopUp->insertItem( "180", 180 ); | 98 | mBeepPopUp->insertItem( "180", 180 ); |
99 | mBeepPopUp->insertItem( "60", 60 ); | 99 | mBeepPopUp->insertItem( "60", 60 ); |
100 | mBeepPopUp->insertItem( "30", 30 ); | 100 | mBeepPopUp->insertItem( "30", 30 ); |
@@ -129,33 +129,33 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | |||
129 | confPause( 1 ); | 129 | confPause( 1 ); |
130 | mSuspend = 0; | 130 | mSuspend = 0; |
131 | confSuspend( 0 ); | 131 | confSuspend( 0 ); |
132 | if ( QApplication::desktop()->width() < 480 ) { | 132 | if ( QApplication::desktop()->width() < 480 ) { |
133 | wavAlarm = false; | 133 | wavAlarm = false; |
134 | mSoundPopUp->setItemChecked ( 0, true ); | 134 | mSoundPopUp->setItemChecked ( 0, true ); |
135 | } | 135 | } |
136 | else { | 136 | else { |
137 | wavAlarm = true; | 137 | wavAlarm = true; |
138 | mSoundPopUp->setItemChecked ( 1, true ); | 138 | mSoundPopUp->setItemChecked ( 1, true ); |
139 | } | 139 | } |
140 | saveSlot( 1 ); | 140 | saveSlot( 1 ); |
141 | } | 141 | } |
142 | 142 | ||
143 | SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() | 143 | SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() |
144 | { | 144 | { |
145 | delete mPopUp; | 145 | //delete mPopUp; |
146 | delete mAlarmDialog; | 146 | delete mAlarmDialog; |
147 | } | 147 | } |
148 | void SimpleAlarmDaemonImpl::saveSlot( int load ) | 148 | void SimpleAlarmDaemonImpl::saveSlot( int load ) |
149 | { | 149 | { |
150 | QString fileName = QDir::homeDirPath() +"/.kopialarmrc"; | 150 | QString fileName = QDir::homeDirPath() +"/.kopialarmrc"; |
151 | //qDebug("save %d ", load ); | 151 | //qDebug("save %d ", load ); |
152 | QFile file( fileName ); | 152 | QFile file( fileName ); |
153 | if ( load ) { | 153 | if ( load ) { |
154 | if( !QFile::exists( fileName) ) | 154 | if( !QFile::exists( fileName) ) |
155 | return; | 155 | return; |
156 | if (!file.open( IO_ReadOnly ) ) { | 156 | if (!file.open( IO_ReadOnly ) ) { |
157 | return ; | 157 | return ; |
158 | } | 158 | } |
159 | QString line; | 159 | QString line; |
160 | bool ok; | 160 | bool ok; |
161 | int val; | 161 | int val; |
@@ -551,33 +551,33 @@ void SimpleAlarmDaemonImpl::showWN() | |||
551 | void SimpleAlarmDaemonImpl::newTodo() | 551 | void SimpleAlarmDaemonImpl::newTodo() |
552 | { | 552 | { |
553 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); | 553 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); |
554 | } | 554 | } |
555 | 555 | ||
556 | void SimpleAlarmDaemonImpl::newEvent() | 556 | void SimpleAlarmDaemonImpl::newEvent() |
557 | { | 557 | { |
558 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); | 558 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); |
559 | 559 | ||
560 | } | 560 | } |
561 | void SimpleAlarmDaemonImpl::newMail() | 561 | void SimpleAlarmDaemonImpl::newMail() |
562 | { | 562 | { |
563 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); | 563 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); |
564 | } | 564 | } |
565 | void SimpleAlarmDaemonImpl::showAdd() | 565 | void SimpleAlarmDaemonImpl::showAdd() |
566 | { | 566 | { |
567 | QCopEnvelope e("QPE/Application/kapi", " "); | 567 | QCopEnvelope e("QPE/Application/kapi", "raise()"); |
568 | } | 568 | } |
569 | void SimpleAlarmDaemonImpl::ringSync() | 569 | void SimpleAlarmDaemonImpl::ringSync() |
570 | { | 570 | { |
571 | QCopEnvelope e("QPE/Application/kopi", "-ringSync"); | 571 | QCopEnvelope e("QPE/Application/kopi", "-ringSync"); |
572 | 572 | ||
573 | } | 573 | } |
574 | void SimpleAlarmDaemonImpl::newCountdown() | 574 | void SimpleAlarmDaemonImpl::newCountdown() |
575 | { | 575 | { |
576 | //recieve("cal_alarm", 10 ); | 576 | //recieve("cal_alarm", 10 ); |
577 | } | 577 | } |
578 | void SimpleAlarmDaemonImpl::simulate() | 578 | void SimpleAlarmDaemonImpl::simulate() |
579 | { | 579 | { |
580 | writeFile(); | 580 | writeFile(); |
581 | QString filename = getenv("QPEDIR") ; | 581 | QString filename = getenv("QPEDIR") ; |
582 | filename += "/pics/kdepim/korganizer/koalarm.wav"; | 582 | filename += "/pics/kdepim/korganizer/koalarm.wav"; |
583 | startAlarm("Alarm simulation", filename ); | 583 | startAlarm("Alarm simulation", filename ); |