-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 48 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.h | 4 |
2 files changed, 40 insertions, 12 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 82873e1..2742610 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp @@ -69,7 +69,3 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) mTimerPopUp = new QPopupMenu( this ); - QFont fon = mTimerPopUp->font(); - int points = (fon.pointSize()*4)/3; - fon.setPointSize( points ); - mTimerPopUp->setFont( fon ); - mPopUp->setFont( fon ); + mBeepPopUp = new QPopupMenu( this ); @@ -77,2 +73,9 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) 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( "24", 24 ); QPopupMenu* savePopUp = new QPopupMenu( this ); @@ -103,2 +106,3 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) mBeepPopUp->insertItem( "Replay",mSoundPopUp ); + mBeepPopUp->insertItem( "Font Size",mFontsizePopup ); mBeepPopUp->insertItem( "Config",savePopUp ); @@ -132,2 +136,3 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) connect ( savePopUp, SIGNAL( activated ( int ) ), this, SLOT (saveSlot( int ) ) ); + connect ( mFontsizePopup, SIGNAL( activated ( int ) ), this, SLOT (confFontSize( int ) ) ); mTimerTime = 0; @@ -149,3 +154,2 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) } - saveSlot( 1 ); mTimerStartLabel = new QLabel( 0, 0, WType_Popup ); @@ -153,7 +157,6 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) mTimerStartLabel->setAlignment ( Qt::AlignCenter ) ; - fon = mTimerPopUp->font(); - fon.setBold( true ); - points = (fon.pointSize()*2); - fon.setPointSize( points ); - mTimerStartLabel->setFont( fon ); + saveSlot( 1 ); + + + } @@ -173,2 +176,4 @@ void SimpleAlarmDaemonImpl::saveSlot( int load ) if ( load ) { + mPopupFontSize = mTimerPopUp->font().pointSize(); + confFontSize( mPopupFontSize ); if( !QFile::exists( fileName) ) @@ -191,2 +196,8 @@ void SimpleAlarmDaemonImpl::saveSlot( int load ) } + if ( line.left(4 ) == "POFO" ) { + val = line.mid( 4,len-5).toInt( &ok ); + if ( ok ) { + confFontSize( val ); + } + } if ( line.left(4 ) == "SUCO" ) { @@ -234,2 +245,3 @@ void SimpleAlarmDaemonImpl::saveSlot( int load ) configString += "SUCO " + QString::number( mSuspend ) + "\n"; + configString += "POFO " + QString::number( mPopupFontSize ) + "\n"; configString += "WAAL " + QString::number( wavAlarm ) + "\n"; @@ -633,2 +645,16 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) +void SimpleAlarmDaemonImpl::confFontSize( int size ) +{ + + mFontsizePopup->setItemChecked( mPopupFontSize, false ); + mPopupFontSize = size; + mFontsizePopup->setItemChecked( mPopupFontSize, true ); + QFont fon = mTimerPopUp->font(); + fon.setPointSize( mPopupFontSize ); + mTimerPopUp->setFont( fon ); + mPopUp->setFont( fon ); + fon.setBold( true ); + fon.setPointSize( mPopupFontSize * 2 ); + mTimerStartLabel->setFont( fon ); +} void SimpleAlarmDaemonImpl::writeFile() diff --git a/kalarmd/simplealarmdaemonimpl.h b/kalarmd/simplealarmdaemonimpl.h index 9b7de94..06ef91b 100644 --- a/kalarmd/simplealarmdaemonimpl.h +++ b/kalarmd/simplealarmdaemonimpl.h @@ -59,2 +59,3 @@ class SimpleAlarmDaemonImpl : public QLabel void confPause( int ); + void confFontSize( int ); void confTimer( int ); @@ -77,3 +78,3 @@ class SimpleAlarmDaemonImpl : public QLabel int getFileNameLen( QString ); - QPopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp; + QPopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp, *mFontsizePopup; QDateTime mRunningTimer; @@ -85,2 +86,3 @@ class SimpleAlarmDaemonImpl : public QLabel int mTimerPopupConf; + int mPopupFontSize; bool wavAlarm; |