author | zautrix <zautrix> | 2005-10-30 00:34:47 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-30 00:34:47 (UTC) |
commit | ae2e0518976e23b820c8c451bf2659fbeb9ca8a5 (patch) (side-by-side diff) | |
tree | 80425dd9be33e788c05b121467f2f65f938637d3 /kalarmd/simplealarmdaemonimpl.cpp | |
parent | 2bde460ef07e5446c410fda92f9e05691b316aec (diff) | |
download | kdepimpi-ae2e0518976e23b820c8c451bf2659fbeb9ca8a5.zip kdepimpi-ae2e0518976e23b820c8c451bf2659fbeb9ca8a5.tar.gz kdepimpi-ae2e0518976e23b820c8c451bf2659fbeb9ca8a5.tar.bz2 |
fix
Diffstat (limited to 'kalarmd/simplealarmdaemonimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index f134d5b..fe9ff5a 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp @@ -23,193 +23,193 @@ #include "simplealarmdaemonimpl.h" #include "alarmdialog.h" #include <qpopupmenu.h> #include <qapp.h> #include <qdir.h> #include <qfile.h> #include <qhbox.h> #include <qtimer.h> #include <qfile.h> #include <qdatetime.h> #include <qpushbutton.h> #include <qlayout.h> #include <qlineedit.h> #include <qdialog.h> #define protected public #include <qspinbox.h> #undef protected #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( this ); mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); mPopUp->insertSeparator(); mPopUp->insertItem( "Todo List", 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( this ); mBeepPopUp = new QPopupMenu( this ); mSoundPopUp = new QPopupMenu( this ); mPausePopUp = new QPopupMenu( this ); mFontsizePopup = new QPopupMenu( this ); mFontsizePopup->insertItem( "10", 10 ); mFontsizePopup->insertItem( "12", 12 ); mFontsizePopup->insertItem( "14", 14 ); mFontsizePopup->insertItem( "16", 16 ); mFontsizePopup->insertItem( "18", 18 ); mFontsizePopup->insertItem( "20", 20 ); mFontsizePopup->insertItem( "22", 22 ); mFontsizePopup->insertItem( "24", 24 ); mFontsizePopup->insertItem( "26", 26 ); mFontsizePopup->insertItem( "28", 28 ); mFontsizePopup->insertItem( "30", 30 ); mFontsizePopup->insertItem( "32", 32 ); mFontsizePopup->insertItem( "36", 36 ); 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( 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( "Config",savePopUp ); mBeepPopUp->insertItem( "Replay",mSoundPopUp ); mBeepPopUp->insertItem( "Font Size",mFontsizePopup ); mBeepPopUp->insertItem( "Auto suspend",mSuspendPopUp ); mBeepPopUp->insertItem( "Beep interval",mPausePopUp ); mBeepPopUp->insertItem( "180", 180 ); mBeepPopUp->insertItem( "60", 60 ); mBeepPopUp->insertItem( "30", 30 ); - mBeepPopUp->insertItem( "18", 18 ); + mBeepPopUp->insertItem( "17", 17 ); mBeepPopUp->insertItem( "10", 10 ); mBeepPopUp->insertItem( "3", 3 ); mBeepPopUp->insertItem( "1", 1 ); mBeepPopUp->insertItem( "Off", 0 ); mBeepPopUp->insertSeparator(); mBeepPopUp->insertItem( "Simulate", 1000 ); mBeepPopUp->setCheckable( true ); mPopUp->insertSeparator(); mPopUp->insertItem( "Play beeps", mBeepPopUp ); mPopUp->insertSeparator(); mPopUp->insertItem( "Timer", mTimerPopUp ); //mPopUp->insertSeparator(); //mPopUp->insertItem( "Simulate", this, SLOT ( simulate() ) ); mPopUp->resize( mPopUp->sizeHint() ); mPlayBeeps = 60; mBeepPopUp->setItemChecked ( mPlayBeeps, true ); connect ( mBeepPopUp, SIGNAL( activated ( int ) ), this, SLOT (slotPlayBeep( int ) ) ); connect ( mTimerPopUp, SIGNAL( activated ( int ) ), this, SLOT (confTimer( int ) ) ); connect ( mTimerPopUp, SIGNAL(aboutToShow() ), this, SLOT ( showTimer( ) ) ); connect ( mSoundPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSound( int ) ) ); connect ( mPausePopUp, SIGNAL( activated ( int ) ), this, SLOT (confPause( int ) ) ); connect ( mSuspendPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSuspend( int ) ) ); connect ( savePopUp, SIGNAL( activated ( int ) ), this, SLOT (saveSlot( int ) ) ); connect ( mFontsizePopup, SIGNAL( activated ( int ) ), this, SLOT (confFontSize( int ) ) ); mTimerTime = 0; mCustomText = "Custom Text"; mCustomMinutes = 7; mTimerPopupConf = 1; fillTimerPopUp(); mPausePlay = 0; confPause( 1 ); mSuspend = 0; confSuspend( 0 ); if ( QApplication::desktop()->width() < 480 ) { wavAlarm = false; mSoundPopUp->setItemChecked ( 0, true ); } else { wavAlarm = true; mSoundPopUp->setItemChecked ( 1, true ); } mTimerStartLabel = new QLabel( 0, 0, WType_Popup ); //mTimerStartLabel->setCaption( "Timer started!"); mTimerStartLabel->setAlignment ( Qt::AlignCenter ) ; saveSlot( 1 ); } SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() { //delete mPopUp; delete mAlarmDialog; delete mTimerStartLabel; } void SimpleAlarmDaemonImpl::saveSlot( int load ) { QString fileName = QDir::homeDirPath() +"/.kopialarmrc"; //qDebug("save %d ", load ); QFile file( fileName ); if ( load ) { mPopupFontSize = mTimerPopUp->font().pointSize(); confFontSize( mPopupFontSize ); if( !QFile::exists( fileName) ) return; if (!file.open( IO_ReadOnly ) ) { return ; } QString line; bool ok; int val; int len; while ( file.readLine( line, 1024 ) > 0 ) { //qDebug("read %s ", line.latin1()); len = line.length(); if ( line.left(4 ) == "PPAU" ) { val = line.mid( 4,len-5).toInt( &ok ); if ( ok ) { confPause( val ); } } if ( line.left(4 ) == "POFO" ) { val = line.mid( 4,len-5).toInt( &ok ); if ( ok ) { confFontSize( val ); } } if ( line.left(4 ) == "SUCO" ) { val = line.mid( 4,len-5).toInt( &ok ); if ( ok ) confSuspend ( val ); } if ( line.left(4 ) == "WAAL" ) { |