summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index eff96eb..2acfacf 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -59,25 +59,29 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
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 );
QFont fon = mTimerPopUp->font();
- fon.setPointSize( fon.pointSize() *3/2 );
+ int points = 16;
+ if ( QApplication::desktop()->width() < 480 )
+ points = 12;
+ fon.setPointSize( points );
+ //qDebug("point s %d ", fon.pointSize());
mTimerPopUp->setFont( fon );
mPopUp->setFont( fon );
mBeepPopUp = new QPopupMenu( this );
mSoundPopUp = new QPopupMenu( this );
mPausePopUp = new QPopupMenu( this );
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 );
@@ -303,32 +307,30 @@ void SimpleAlarmDaemonImpl::recieve( const QCString& msg, const QByteArray& )
int len = mess.mid( 10 ).find("+++");
if ( len < 2 )
error = true;
else {
tempfilename = mess.mid( 10, len );
if ( !QFile::exists( tempfilename ) )
error = true;
}
if ( error ) {
mAlarmMessage = "Procedure Alarm\nError - File not found\n";
mAlarmMessage += mess.mid( 10+len+3+9 );
} else {
- {
- QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
- }
//qDebug("-----system command %s ",tempfilename.latin1() );
if ( vfork () == 0 ) {
execl ( tempfilename.latin1(), 0 );
return;
}
+ QTimer::singleShot( 10000, this, SLOT ( writeFile() ) );
return;
}
//qDebug("+++++++system command %s ",tempfilename.latin1() );
}
if ( mess.left( 11 ) == "audio_alarm") {
bool error = false;
int len = mess.mid( 11 ).find("+++");
if ( len < 2 )
error = true;
else {
tempfilename = mess.mid( 11, len );
@@ -336,25 +338,25 @@ void SimpleAlarmDaemonImpl::recieve( const QCString& msg, const QByteArray& )
error = true;
}
if ( ! error ) {
filename = tempfilename;
}
mAlarmMessage = mess.mid( 11+len+3+9 );
//qDebug("audio file command %s ",tempfilename.latin1() );
}
if ( mess.left( 9 ) == "cal_alarm") {
mAlarmMessage = mess.mid( 9 ) ;
}
- writeFile();
+ QTimer::singleShot( 10000, this, SLOT ( writeFile() ) );
startAlarm( mAlarmMessage, filename );
}
int SimpleAlarmDaemonImpl::getFileNameLen( QString mess )
{
return 0;
}
void SimpleAlarmDaemonImpl::startAlarm( QString mess, QString filename )
{
//mAlarmDialog->show();
//mAlarmDialog->raise();
@@ -639,25 +641,25 @@ void SimpleAlarmDaemonImpl::showAdd()
}
void SimpleAlarmDaemonImpl::ringSync()
{
QCopEnvelope e("QPE/Application/kopi", "-ringSync");
}
void SimpleAlarmDaemonImpl::newCountdown()
{
//recieve("cal_alarm", 10 );
}
void SimpleAlarmDaemonImpl::simulate()
{
- writeFile();
+ QTimer::singleShot( 10000, this, SLOT ( writeFile() ) );
QString filename = getenv("QPEDIR") ;
filename += "/pics/kdepim/korganizer/koalarm.wav";
startAlarm("Alarm simulation", filename );
}
void SimpleAlarmDaemonImpl::showKO()
{
QCopEnvelope e("QPE/Application/kopi", "-showKO");
// testing only
//QCopEnvelope e("QPE/Application/kopi", "nextView()");
}
void SimpleAlarmDaemonImpl::showTodo()