summaryrefslogtreecommitdiffabout
path: root/kalarmd
authorzautrix <zautrix>2005-03-27 09:46:04 (UTC)
committer zautrix <zautrix>2005-03-27 09:46:04 (UTC)
commitb170a7414ff72016285ea207caa7ccf786530e77 (patch) (side-by-side diff)
treecb635d155fed20ecb33f877659a00d88bedb309e /kalarmd
parentee6f7d5329658c567882e8e496c65eef8874496e (diff)
downloadkdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.zip
kdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.tar.gz
kdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.tar.bz2
many fixes
Diffstat (limited to 'kalarmd') (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/alarmdialog.cpp52
1 files changed, 42 insertions, 10 deletions
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp
index c939ae0..7ead3b9 100644
--- a/kalarmd/alarmdialog.cpp
+++ b/kalarmd/alarmdialog.cpp
@@ -49,2 +49,3 @@
#include <qtopia/sound.h>
+
#endif
@@ -93,10 +94,12 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
layout->addWidget ( mMissedAlarmsCombo );
- QVBox *suspendBox = new QVBox( this );
- suspendBox->setSpacing(3);
- layout->addWidget ( suspendBox );
- QLabel* labb = new QLabel("Suspend duration (minutes):",suspendBox);
+
+ QLabel* labb = new QLabel("Suspend duration (minutes):",this);
labb->setAlignment(AlignCenter);
+ layout->addWidget ( labb );
fo = font();
- fo.setPointSize( 36 );
- mSuspendSpin = new QSpinBox(1,1440,1,suspendBox);
+ int pointSize = 36;
+ if ( QApplication::desktop()->width() <= 320 )
+ pointSize = 24;
+ fo.setPointSize( pointSize );
+ mSuspendSpin = new QSpinBox(1,1440,1,this);
mSuspendSpin->setFont( fo );
@@ -110,3 +113,7 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
mSuspendSpin->setFixedSize( 100,62 );
- mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
+ mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
+ QHBoxLayout* layoutSpin = new QHBoxLayout( layout );
+ layoutSpin->addStretch ();
+ layoutSpin->addWidget ( mSuspendSpin );
+ layoutSpin->addStretch ();
@@ -115,2 +122,4 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
bbox->layout()->setSpacing( 2 );
+ labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox);
+ labb->setAlignment(AlignCenter);
mSuspendButton = new QPushButton( "Suspend", bbox);
@@ -261,11 +270,34 @@ void AlarmDialog::playSound ()
++alarmCounter;
+#ifdef DESKTOP_VERSION
+ mPlayWav = true;
+#endif
if ( !mPlayWav || mFileName.length() < 2 ) {
-#ifndef DESKTOP_VERSION
+#ifdef DESKTOP_VERSION
+ qDebug("Sound play not possible - file not found");
+#else
Sound::soundAlarm ();
#endif
- } else {
+ } else
+
+ {
+#ifdef DESKTOP_VERSION
+#ifdef _WIN32_
+ QSound::play ( mFileName );
+#else
+
+ QString command = "playwave -r 22050 " + mFileName;
+ qDebug("KO: Playing file %s with 22kHz",mFileName.latin1() );
+ int ret = system ( command.latin1() );
+ if ( ret != 0 ) {
+ qDebug("Sound play command failed: %s ",command.latin1() );
+ }
+
+#endif
+
+#else
QSound::play ( mFileName );
+#endif
//qDebug("BEEP!");
- }
+ }
} else {