summaryrefslogtreecommitdiffabout
path: root/kalarmd/simplealarmdaemonimpl.cpp
Side-by-side diff
Diffstat (limited to 'kalarmd/simplealarmdaemonimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index c1e064c..553e377 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -127,50 +127,51 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
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 ) ) );
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 );
}
saveSlot( 1 );
- mTimerStartLabel = new QLabel( 0 );
- mTimerStartLabel->setCaption( "Timer started!");
+ 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 );
}
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 ) {
if( !QFile::exists( fileName) )
return;
if (!file.open( IO_ReadOnly ) ) {
return ;
@@ -598,56 +599,56 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
mCustomMinutes = spinh.value()*60+spinm.value();
if ( mCustomMinutes == 0 )
mCustomMinutes = 1;
if ( mCustomMinutes > 1440 )
mCustomMinutes = 1440;
mess += mCustomText;
disp = mCustomText;
minutes = mCustomMinutes;
mRunningTimerText = mCustomText.stripWhiteSpace ();
int in = mRunningTimerText.find( " " );
mRunningTimerText = mRunningTimerText.left ( in );
}
else {
mess += mTimerPopUp->text( minutes );
disp = mTimerPopUp->text( minutes );
mRunningTimerText = mTimerPopUp->text( minutes );
minutes -= 10;
}
}
//minutes = 1;
mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 );
timerMesssage = mess;
AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8());
- mTimerStartLabel->setText( disp );
- int w = 200;
- int h = mTimerStartLabel->sizeHint().height() ;
+ mTimerStartLabel->setText( disp + "\n\nTimer started!" );
+ int w = mTimerStartLabel->sizeHint().width()+20;
+ int h = mTimerStartLabel->sizeHint().height()+40 ;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
mTimerStartLabel->show();
- QTimer::singleShot( 2000, mTimerStartLabel, SLOT ( hide() ) );
+ QTimer::singleShot( 3000, mTimerStartLabel, SLOT ( hide() ) );
mTimerTime = 1;
}
void SimpleAlarmDaemonImpl::writeFile()
{
QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
//QCopEnvelope e("QPE/Application/kopi", "-writeFile");
}
void SimpleAlarmDaemonImpl::showWN()
{
QCopEnvelope e("QPE/Application/kopi", "-showWN");
}
void SimpleAlarmDaemonImpl::newTodo()
{
QCopEnvelope e("QPE/Application/kopi", "-newTodo");
}
void SimpleAlarmDaemonImpl::newEvent()
{
QCopEnvelope e("QPE/Application/kopi", "-newEvent");
}
void SimpleAlarmDaemonImpl::newMail()
{