author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kalarmd | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | kalarmd/alarmdialog.cpp | 26 | ||||
-rw-r--r-- | kalarmd/alarmdialog.h | 2 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 16 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.h | 3 |
4 files changed, 26 insertions, 21 deletions
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index 18ce9da..467fef7 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp | |||
@@ -22,11 +22,12 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | // $Id$ | 24 | // $Id$ |
25 | 25 | ||
26 | #include <qhbox.h> | 26 | #include <q3hbox.h> |
27 | #include <qvbox.h> | 27 | #include <q3vbox.h> |
28 | #include <qapp.h> | 28 | #include <qapplication.h> |
29 | #include <QDesktopWidget> | ||
29 | #include <qlabel.h> | 30 | #include <qlabel.h> |
30 | #include <qlayout.h> | 31 | #include <qlayout.h> |
31 | #include <qfile.h> | 32 | #include <qfile.h> |
32 | #include <qtimer.h> | 33 | #include <qtimer.h> |
@@ -38,8 +39,11 @@ | |||
38 | #include <qspinbox.h> | 39 | #include <qspinbox.h> |
39 | #undef protected | 40 | #undef protected |
40 | #else | 41 | #else |
41 | #include <qspinbox.h> | 42 | #include <qspinbox.h> |
43 | //Added by qt3to4: | ||
44 | #include <Q3HBoxLayout> | ||
45 | #include <Q3VBoxLayout> | ||
42 | #endif | 46 | #endif |
43 | #include <stdlib.h> | 47 | #include <stdlib.h> |
44 | #ifndef _WIN32_ | 48 | #ifndef _WIN32_ |
45 | #include <unistd.h> | 49 | #include <unistd.h> |
@@ -61,12 +65,12 @@ | |||
61 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) | 65 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) |
62 | : QDialog (parent, name ,false, Qt::WStyle_StaysOnTop ) | 66 | : QDialog (parent, name ,false, Qt::WStyle_StaysOnTop ) |
63 | { | 67 | { |
64 | setCaption( "KO/Pi Alarm!" ); | 68 | setCaption( "KO/Pi Alarm!" ); |
65 | QVBoxLayout* layout = new QVBoxLayout( this); | 69 | Q3VBoxLayout* layout = new Q3VBoxLayout( this); |
66 | QLabel* l = new QLabel("The following event triggered alarm:",this); | 70 | QLabel* l = new QLabel("The following event triggered alarm:",this); |
67 | layout->addWidget ( l ); | 71 | layout->addWidget ( l ); |
68 | l->setAlignment( AlignCenter); | 72 | l->setAlignment( Qt::AlignCenter); |
69 | mMessage = new QLabel ( " ", this ); | 73 | mMessage = new QLabel ( " ", this ); |
70 | int fs = 18; | 74 | int fs = 18; |
71 | int fs2 = 12; | 75 | int fs2 = 12; |
72 | int baseSize = 6; | 76 | int baseSize = 6; |
@@ -82,12 +86,12 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name) | |||
82 | fo.setPointSize( fs2 ); | 86 | fo.setPointSize( fs2 ); |
83 | l->setFont( fo ); | 87 | l->setFont( fo ); |
84 | fo.setPointSize( fs ); | 88 | fo.setPointSize( fs ); |
85 | mMessage->setFont(fo ); | 89 | mMessage->setFont(fo ); |
86 | mMessage->setAlignment( AlignCenter); | 90 | mMessage->setAlignment( Qt::AlignCenter); |
87 | layout->addWidget ( mMessage ); | 91 | layout->addWidget ( mMessage ); |
88 | mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); | 92 | mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); |
89 | mMissedAlarms->setAlignment( AlignCenter); | 93 | mMissedAlarms->setAlignment( Qt::AlignCenter); |
90 | 94 | ||
91 | playSoundTimer = new QTimer( this ); | 95 | playSoundTimer = new QTimer( this ); |
92 | connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); | 96 | connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); |
93 | 97 | ||
@@ -102,9 +106,9 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name) | |||
102 | fo = font(); | 106 | fo = font(); |
103 | fo.setPointSize( 12 ); | 107 | fo.setPointSize( 12 ); |
104 | labb->setFont ( fo ); | 108 | labb->setFont ( fo ); |
105 | #endif | 109 | #endif |
106 | labb->setAlignment(AlignCenter); | 110 | labb->setAlignment(Qt::AlignCenter); |
107 | //layout->addWidget ( labb ); | 111 | //layout->addWidget ( labb ); |
108 | fo = font(); | 112 | fo = font(); |
109 | int pointSize = 36; | 113 | int pointSize = 36; |
110 | if ( QApplication::desktop()->width() <= 320 ) | 114 | if ( QApplication::desktop()->width() <= 320 ) |
@@ -121,19 +125,19 @@ AlarmDialog::AlarmDialog(QWidget *parent,const char *name) | |||
121 | mSuspendSpin->downButton ()->setFixedSize( QSize( 8*baseSize, 5*baseSize )); | 125 | mSuspendSpin->downButton ()->setFixedSize( QSize( 8*baseSize, 5*baseSize )); |
122 | #endif | 126 | #endif |
123 | mSuspendSpin->setFixedSize( 18*baseSize, 10*baseSize+2 ); | 127 | mSuspendSpin->setFixedSize( 18*baseSize, 10*baseSize+2 ); |
124 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); | 128 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); |
125 | QHBoxLayout* layoutSpin = new QHBoxLayout( layout ); | 129 | Q3HBoxLayout* layoutSpin = new Q3HBoxLayout( layout ); |
126 | layoutSpin->addStretch (); | 130 | layoutSpin->addStretch (); |
127 | layoutSpin->addWidget ( labb ); | 131 | layoutSpin->addWidget ( labb ); |
128 | layoutSpin->addWidget ( mSuspendSpin ); | 132 | layoutSpin->addWidget ( mSuspendSpin ); |
129 | layoutSpin->addStretch (); | 133 | layoutSpin->addStretch (); |
130 | 134 | ||
131 | QVBox * bbox = new QVBox ( this ); | 135 | Q3VBox * bbox = new Q3VBox ( this ); |
132 | layout->addWidget ( bbox ); | 136 | layout->addWidget ( bbox ); |
133 | bbox->layout()->setSpacing( 2 ); | 137 | bbox->layout()->setSpacing( 2 ); |
134 | labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox); | 138 | labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox); |
135 | labb->setAlignment(AlignCenter); | 139 | labb->setAlignment(Qt::AlignCenter); |
136 | mSuspendButton = new QPushButton( "Suspend", bbox); | 140 | mSuspendButton = new QPushButton( "Suspend", bbox); |
137 | QPushButton* silen = new QPushButton( " Stop sound ", bbox); | 141 | QPushButton* silen = new QPushButton( " Stop sound ", bbox); |
138 | okbut = new QPushButton( "Ok", bbox); | 142 | okbut = new QPushButton( "Ok", bbox); |
139 | mSuspendButton->setFont( fo ); | 143 | mSuspendButton->setFont( fo ); |
diff --git a/kalarmd/alarmdialog.h b/kalarmd/alarmdialog.h index 52e681a..c3e0966 100644 --- a/kalarmd/alarmdialog.h +++ b/kalarmd/alarmdialog.h | |||
@@ -29,8 +29,10 @@ | |||
29 | #include <qdatetime.h> | 29 | #include <qdatetime.h> |
30 | #include <qstring.h> | 30 | #include <qstring.h> |
31 | #include <qcombobox.h> | 31 | #include <qcombobox.h> |
32 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
33 | //Added by qt3to4: | ||
34 | #include <QLabel> | ||
33 | 35 | ||
34 | #include "sharp_char.h" | 36 | #include "sharp_char.h" |
35 | 37 | ||
36 | 38 | ||
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 15eff28..74a53cb 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -51,9 +51,9 @@ | |||
51 | SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | 51 | SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) |
52 | : QLabel( parent ) | 52 | : QLabel( parent ) |
53 | { | 53 | { |
54 | mAlarmDialog = new AlarmDialog( 0 ); | 54 | mAlarmDialog = new AlarmDialog( 0 ); |
55 | mPopUp = new QPopupMenu( this ); | 55 | mPopUp = new Q3PopupMenu( this ); |
56 | mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); | 56 | mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); |
57 | mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); | 57 | mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); |
58 | mPopUp->insertSeparator(); | 58 | mPopUp->insertSeparator(); |
59 | mPopUp->insertItem( "Todo List", this, SLOT ( showTodo() ) ); | 59 | mPopUp->insertItem( "Todo List", this, SLOT ( showTodo() ) ); |
@@ -65,14 +65,14 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | |||
65 | mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) ); | 65 | mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) ); |
66 | mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); | 66 | mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); |
67 | mPopUp->insertSeparator(); | 67 | mPopUp->insertSeparator(); |
68 | mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); | 68 | mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); |
69 | mTimerPopUp = new QPopupMenu( this ); | 69 | mTimerPopUp = new Q3PopupMenu( this ); |
70 | 70 | ||
71 | mBeepPopUp = new QPopupMenu( this ); | 71 | mBeepPopUp = new Q3PopupMenu( this ); |
72 | mSoundPopUp = new QPopupMenu( this ); | 72 | mSoundPopUp = new Q3PopupMenu( this ); |
73 | mPausePopUp = new QPopupMenu( this ); | 73 | mPausePopUp = new Q3PopupMenu( this ); |
74 | mFontsizePopup = new QPopupMenu( this ); | 74 | mFontsizePopup = new Q3PopupMenu( this ); |
75 | mFontsizePopup->insertItem( "10", 10 ); | 75 | mFontsizePopup->insertItem( "10", 10 ); |
76 | mFontsizePopup->insertItem( "12", 12 ); | 76 | mFontsizePopup->insertItem( "12", 12 ); |
77 | mFontsizePopup->insertItem( "14", 14 ); | 77 | mFontsizePopup->insertItem( "14", 14 ); |
78 | mFontsizePopup->insertItem( "16", 16 ); | 78 | mFontsizePopup->insertItem( "16", 16 ); |
@@ -84,9 +84,9 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | |||
84 | mFontsizePopup->insertItem( "28", 28 ); | 84 | mFontsizePopup->insertItem( "28", 28 ); |
85 | mFontsizePopup->insertItem( "30", 30 ); | 85 | mFontsizePopup->insertItem( "30", 30 ); |
86 | mFontsizePopup->insertItem( "32", 32 ); | 86 | mFontsizePopup->insertItem( "32", 32 ); |
87 | mFontsizePopup->insertItem( "36", 36 ); | 87 | mFontsizePopup->insertItem( "36", 36 ); |
88 | QPopupMenu* savePopUp = new QPopupMenu( this ); | 88 | QPopupMenu* savePopUp = new Q3PopupMenu( this ); |
89 | savePopUp->insertItem( "Save", 0 ); | 89 | savePopUp->insertItem( "Save", 0 ); |
90 | savePopUp->insertItem( "Load", 1 ); | 90 | savePopUp->insertItem( "Load", 1 ); |
91 | mSoundPopUp->insertItem( "Buzzer", 0 ); | 91 | mSoundPopUp->insertItem( "Buzzer", 0 ); |
92 | mSoundPopUp->insertItem( "Wav file", 1 ); | 92 | mSoundPopUp->insertItem( "Wav file", 1 ); |
@@ -98,9 +98,9 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | |||
98 | mPausePopUp->insertItem( "15 sec", 15 ); | 98 | mPausePopUp->insertItem( "15 sec", 15 ); |
99 | mPausePopUp->insertItem( "30 sec", 30 ); | 99 | mPausePopUp->insertItem( "30 sec", 30 ); |
100 | mPausePopUp->insertItem( " 1 min", 60 ); | 100 | mPausePopUp->insertItem( " 1 min", 60 ); |
101 | mPausePopUp->insertItem( " 5 min", 300 ); | 101 | mPausePopUp->insertItem( " 5 min", 300 ); |
102 | mSuspendPopUp = new QPopupMenu( this ); | 102 | mSuspendPopUp = new Q3PopupMenu( this ); |
103 | mSuspendPopUp->insertItem( "Off", 0 ); | 103 | mSuspendPopUp->insertItem( "Off", 0 ); |
104 | mSuspendPopUp->insertItem( " 1x", 1 ); | 104 | mSuspendPopUp->insertItem( " 1x", 1 ); |
105 | mSuspendPopUp->insertItem( " 2x", 2 ); | 105 | mSuspendPopUp->insertItem( " 2x", 2 ); |
106 | mSuspendPopUp->insertItem( " 3x", 3 ); | 106 | mSuspendPopUp->insertItem( " 3x", 3 ); |
diff --git a/kalarmd/simplealarmdaemonimpl.h b/kalarmd/simplealarmdaemonimpl.h index 06ef91b..ac65797 100644 --- a/kalarmd/simplealarmdaemonimpl.h +++ b/kalarmd/simplealarmdaemonimpl.h | |||
@@ -29,9 +29,8 @@ | |||
29 | #include <qtimer.h> | 29 | #include <qtimer.h> |
30 | 30 | ||
31 | class QLabel; | 31 | class QLabel; |
32 | class QTimer; | 32 | class QTimer; |
33 | class QPopupMenu; | ||
34 | class AlarmDialog; | 33 | class AlarmDialog; |
35 | class SimpleAlarmDaemonImpl : public QLabel | 34 | class SimpleAlarmDaemonImpl : public QLabel |
36 | { | 35 | { |
37 | Q_OBJECT | 36 | Q_OBJECT |
@@ -75,9 +74,9 @@ class SimpleAlarmDaemonImpl : public QLabel | |||
75 | int mSuspend; | 74 | int mSuspend; |
76 | QString mAlarmMessage; | 75 | QString mAlarmMessage; |
77 | int mTimerTime; | 76 | int mTimerTime; |
78 | int getFileNameLen( QString ); | 77 | int getFileNameLen( QString ); |
79 | QPopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp, *mFontsizePopup; | 78 | Q3PopupMenu* mPopUp, *mBeepPopUp, *mTimerPopUp, *mSoundPopUp,*mPausePopUp,*mSuspendPopUp, *mFontsizePopup; |
80 | QDateTime mRunningTimer; | 79 | QDateTime mRunningTimer; |
81 | void fillTimerPopUp(); | 80 | void fillTimerPopUp(); |
82 | QString timerMesssage; | 81 | QString timerMesssage; |
83 | QString mCustomText; | 82 | QString mCustomText; |