summaryrefslogtreecommitdiffabout
path: root/kalarmd/alarmdialog.cpp
Unidiff
Diffstat (limited to 'kalarmd/alarmdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/alarmdialog.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp
index b82724f..521781e 100644
--- a/kalarmd/alarmdialog.cpp
+++ b/kalarmd/alarmdialog.cpp
@@ -3,97 +3,96 @@
3 Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24// $Id$ 24// $Id$
25 25
26#include <qhbox.h> 26#include <qhbox.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qapp.h> 28#include <qapp.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qsound.h> 33#include <qsound.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35#include <qspinbox.h> 35#include <qspinbox.h>
36#include <stdlib.h> 36#include <stdlib.h>
37#ifndef _WIN32_ 37#ifndef _WIN32_
38#include <unistd.h> 38#include <unistd.h>
39#include <sys/ioctl.h> 39#include <sys/ioctl.h>
40#endif 40#endif
41#include <stdio.h> 41#include <stdio.h>
42#include <fcntl.h> 42#include <fcntl.h>
43 43
44#ifndef DESKTOP_VERSION 44#ifndef DESKTOP_VERSION
45#include <qtopia/alarmserver.h> 45#include <qtopia/alarmserver.h>
46#include <qpe/resource.h> 46#include <qpe/resource.h>
47#include <qtopia/sound.h> 47#include <qtopia/sound.h>
48#endif 48#endif
49 49
50#include "alarmdialog.h" 50#include "alarmdialog.h"
51#include "alarmdialog.moc"
52 51
53 52
54AlarmDialog::AlarmDialog(QWidget *parent,const char *name) 53AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
55 : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) 54 : QDialog (parent, name, true, Qt::WStyle_StaysOnTop )
56{ 55{
57 setCaption( "KO/Pi Alarm!" ); 56 setCaption( "KO/Pi Alarm!" );
58 QVBoxLayout* layout = new QVBoxLayout( this); 57 QVBoxLayout* layout = new QVBoxLayout( this);
59 QLabel* l = new QLabel("The following event triggered alarm:",this); 58 QLabel* l = new QLabel("The following event triggered alarm:",this);
60 layout->addWidget ( l ); 59 layout->addWidget ( l );
61 l->setAlignment( AlignCenter); 60 l->setAlignment( AlignCenter);
62 mMessage = new QLabel ( " ", this ); 61 mMessage = new QLabel ( " ", this );
63 int fs = 18; 62 int fs = 18;
64 int fs2 = 12; 63 int fs2 = 12;
65 if ( QApplication::desktop()->width() < 480 ) { 64 if ( QApplication::desktop()->width() < 480 ) {
66 setMaximumSize(220, 260); 65 setMaximumSize(220, 260);
67 fs2 = 10; 66 fs2 = 10;
68 } 67 }
69 else { 68 else {
70 setMaximumSize(440, 440); 69 setMaximumSize(440, 440);
71 } 70 }
72 layout->setSpacing( 3 ); 71 layout->setSpacing( 3 );
73 layout->setMargin( 3 ); 72 layout->setMargin( 3 );
74 73
75 l->setFont( QFont("helvetica",fs2, QFont::Bold) ); 74 l->setFont( QFont("helvetica",fs2, QFont::Bold) );
76 mMessage->setFont( QFont("helvetica",fs, QFont::Bold) ); 75 mMessage->setFont( QFont("helvetica",fs, QFont::Bold) );
77 mMessage->setAlignment( AlignCenter); 76 mMessage->setAlignment( AlignCenter);
78 l = new QLabel("Missed Alarms:",this); 77 l = new QLabel("Missed Alarms:",this);
79 l->setAlignment( AlignCenter); 78 l->setAlignment( AlignCenter);
80 layout->addWidget ( mMessage ); 79 layout->addWidget ( mMessage );
81 layout->addWidget ( l ); 80 layout->addWidget ( l );
82 mMissedAlarms= new QLabel ( "", this ); 81 mMissedAlarms= new QLabel ( "", this );
83 mMissedAlarms->setAlignment( AlignCenter); 82 mMissedAlarms->setAlignment( AlignCenter);
84 83
85 playSoundTimer = new QTimer( this ); 84 playSoundTimer = new QTimer( this );
86 connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); 85 connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) );
87 86
88 playSoundTimer->stop(); 87 playSoundTimer->stop();
89 88
90 layout->addWidget ( mMissedAlarms ); 89 layout->addWidget ( mMissedAlarms );
91 QHBox *suspendBox = new QHBox( this ); 90 QHBox *suspendBox = new QHBox( this );
92 suspendBox->setSpacing(3); 91 suspendBox->setSpacing(3);
93 layout->addWidget ( suspendBox ); 92 layout->addWidget ( suspendBox );
94 (void)new QLabel("Suspend duration (minutes):",suspendBox); 93 (void)new QLabel("Suspend duration (minutes):",suspendBox);
95 mSuspendSpin = new QSpinBox(1,1440,1,suspendBox); 94 mSuspendSpin = new QSpinBox(1,1440,1,suspendBox);
96 mSuspendSpin->setValue(7); // default suspend duration 95 mSuspendSpin->setValue(7); // default suspend duration
97 QHBox * bbox = new QHBox ( this ); 96 QHBox * bbox = new QHBox ( this );
98 layout->addWidget ( bbox ); 97 layout->addWidget ( bbox );
99 bbox->layout()->setSpacing( 5 ); 98 bbox->layout()->setSpacing( 5 );