summaryrefslogtreecommitdiffabout
path: root/kalarmd
authorzautrix <zautrix>2005-10-29 00:21:37 (UTC)
committer zautrix <zautrix>2005-10-29 00:21:37 (UTC)
commitacd1c021e6ddef4285b3220d7515a3917416b92f (patch) (side-by-side diff)
tree3409f47cc4a9a0b6ffb53313e9a3b4a1d82f70ce /kalarmd
parent7a90e619147e06e5f4d4facef98364f78a4a04ef (diff)
downloadkdepimpi-acd1c021e6ddef4285b3220d7515a3917416b92f.zip
kdepimpi-acd1c021e6ddef4285b3220d7515a3917416b92f.tar.gz
kdepimpi-acd1c021e6ddef4285b3220d7515a3917416b92f.tar.bz2
fix
Diffstat (limited to 'kalarmd') (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp52
-rw-r--r--kalarmd/simplealarmdaemonimpl.h4
2 files changed, 42 insertions, 14 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index 82873e1..2742610 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -67,14 +67,17 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
mPopUp->insertSeparator();
mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) );
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 );
mSoundPopUp = new QPopupMenu( this );
- mPausePopUp = 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( "24", 24 );
QPopupMenu* savePopUp = new QPopupMenu( this );
savePopUp->insertItem( "Save", 0 );
savePopUp->insertItem( "Load", 1 );
@@ -101,6 +104,7 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
mBeepPopUp->insertItem( "Auto suspend",mSuspendPopUp );
mBeepPopUp->insertItem( "Beep interval",mPausePopUp );
mBeepPopUp->insertItem( "Replay",mSoundPopUp );
+ mBeepPopUp->insertItem( "Font Size",mFontsizePopup );
mBeepPopUp->insertItem( "Config",savePopUp );
mBeepPopUp->insertItem( "300", 300 );
mBeepPopUp->insertItem( "180", 180 );
@@ -129,7 +133,8 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
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 ( savePopUp, SIGNAL( activated ( int ) ), this, SLOT (saveSlot( int ) ) );
+ connect ( mFontsizePopup, SIGNAL( activated ( int ) ), this, SLOT (confFontSize( int ) ) );
mTimerTime = 0;
mCustomText = "Custom Text";
mCustomMinutes = 7;
@@ -147,15 +152,13 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
wavAlarm = true;
mSoundPopUp->setItemChecked ( 1, true );
}
- saveSlot( 1 );
mTimerStartLabel = new QLabel( 0, 0, WType_Popup );
//mTimerStartLabel->setCaption( "Timer started!");
mTimerStartLabel->setAlignment ( Qt::AlignCenter ) ;
- fon = mTimerPopUp->font();
- fon.setBold( true );
- points = (fon.pointSize()*2);
- fon.setPointSize( points );
- mTimerStartLabel->setFont( fon );
+ saveSlot( 1 );
+
+
+
}
SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl()
@@ -171,6 +174,8 @@ void SimpleAlarmDaemonImpl::saveSlot( int load )
//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 ) ) {
@@ -189,6 +194,12 @@ void SimpleAlarmDaemonImpl::saveSlot( int load )
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 )
@@ -232,6 +243,7 @@ void SimpleAlarmDaemonImpl::saveSlot( int load )
QString configString ;
configString += "PPAU " + QString::number( mPausePlay ) + "\n";
configString += "SUCO " + QString::number( mSuspend ) + "\n";
+ configString += "POFO " + QString::number( mPopupFontSize ) + "\n";
configString += "WAAL " + QString::number( wavAlarm ) + "\n";
configString += "PLBE " + QString::number( mPlayBeeps ) + "\n";
configString += "CUTE " + mCustomText + "\n";
@@ -631,6 +643,20 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
mTimerTime = 1;
}
+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()
{
QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
diff --git a/kalarmd/simplealarmdaemonimpl.h b/kalarmd/simplealarmdaemonimpl.h
index 9b7de94..06ef91b 100644
--- a/kalarmd/simplealarmdaemonimpl.h
+++ b/kalarmd/simplealarmdaemonimpl.h
@@ -57,6 +57,7 @@ class SimpleAlarmDaemonImpl : public QLabel
void slotPlayBeep( int );
void showTimer( );
void confPause( int );
+ void confFontSize( int );
void confTimer( int );
void saveSlot( int );
void confSuspend( int );
@@ -75,7 +76,7 @@ class SimpleAlarmDaemonImpl : public QLabel
QString mAlarmMessage;
int mTimerTime;
int getFileNameLen( QString );
- QPopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp;
+ QPopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp, *mFontsizePopup;
QDateTime mRunningTimer;
void fillTimerPopUp();
QString timerMesssage;
@@ -83,6 +84,7 @@ class SimpleAlarmDaemonImpl : public QLabel
QString mRunningTimerText;
int mCustomMinutes;
int mTimerPopupConf;
+ int mPopupFontSize;
bool wavAlarm;
};
class KODateLabel : public QLabel