author | llornkcor <llornkcor> | 2002-04-12 18:02:30 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-12 18:02:30 (UTC) |
commit | b7e13820e0adc60fa4927edeb60d8f2c3c221887 (patch) (unidiff) | |
tree | 67c3efe9aa1633dcdf1faf459bab9e3a5f39db61 | |
parent | dac84ca1099fe40bf6e05140bad04eeaa155669d (diff) | |
download | opie-b7e13820e0adc60fa4927edeb60d8f2c3c221887.zip opie-b7e13820e0adc60fa4927edeb60d8f2c3c221887.tar.gz opie-b7e13820e0adc60fa4927edeb60d8f2c3c221887.tar.bz2 |
changed buttons to more obvious intention, and made setting alarm slider pagestep to onemake
-rw-r--r-- | noncore/tools/clock/clock.cpp | 8 | ||||
-rw-r--r-- | noncore/tools/clock/setAlarm.cpp | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index 6f570c5..097ea90 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp | |||
@@ -146,37 +146,37 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) | |||
146 | t->start( 1000 ); | 146 | t->start( 1000 ); |
147 | 147 | ||
148 | connect( qApp, SIGNAL( timeChanged() ), SLOT( updateClock() ) ); | 148 | connect( qApp, SIGNAL( timeChanged() ), SLOT( updateClock() ) ); |
149 | 149 | ||
150 | swatch_running = FALSE; | 150 | swatch_running = FALSE; |
151 | swatch_totalms = 0; | 151 | swatch_totalms = 0; |
152 | 152 | ||
153 | connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(changeClock(bool)) ); | 153 | connect( qApp, SIGNAL(clockChanged(bool)), this, SLOT(changeClock(bool)) ); |
154 | 154 | ||
155 | QString tmp = config.readEntry("clockAlarmHour", ""); | 155 | QString tmp = config.readEntry("clockAlarmHour", ""); |
156 | bool ok; | 156 | bool ok; |
157 | hour = tmp.toInt(&ok,10); | 157 | hour = tmp.toInt(&ok,10); |
158 | tmp = config.readEntry("clockAlarmMinute",""); | 158 | tmp = config.readEntry("clockAlarmMinute",""); |
159 | minute = tmp.toInt(&ok,10); | 159 | minute = tmp.toInt(&ok,10); |
160 | 160 | ||
161 | if( config.readEntry("clockAlarmSet","FALSE") == "TRUE") { | 161 | if( config.readEntry("clockAlarmSet","FALSE") == "TRUE") { |
162 | alarmOffBtn->setText( tr( "Alarm On" ) ); | 162 | alarmOffBtn->setText( tr( "Alarm Is On" ) ); |
163 | alarmBool=TRUE; | 163 | alarmBool=TRUE; |
164 | snoozeBtn->show(); | 164 | snoozeBtn->show(); |
165 | } else { | 165 | } else { |
166 | alarmOffBtn->setText( tr( "Alarm Off" ) ); | 166 | alarmOffBtn->setText( tr( "Alarm Is Off" ) ); |
167 | alarmBool=FALSE; | 167 | alarmBool=FALSE; |
168 | snoozeBtn->hide(); | 168 | snoozeBtn->hide(); |
169 | } | 169 | } |
170 | 170 | ||
171 | QTimer::singleShot( 0, this, SLOT(updateClock()) ); | 171 | QTimer::singleShot( 0, this, SLOT(updateClock()) ); |
172 | modeSelect(0); | 172 | modeSelect(0); |
173 | } | 173 | } |
174 | 174 | ||
175 | Clock::~Clock() | 175 | Clock::~Clock() |
176 | { | 176 | { |
177 | toggleScreenSaver( true ); | 177 | toggleScreenSaver( true ); |
178 | } | 178 | } |
179 | 179 | ||
180 | void Clock::updateClock() | 180 | void Clock::updateClock() |
181 | { | 181 | { |
182 | if ( clockRB->isChecked() ) { | 182 | if ( clockRB->isChecked() ) { |
@@ -313,39 +313,39 @@ void Clock::slotSnooze() | |||
313 | QTime t = QTime::currentTime(); | 313 | QTime t = QTime::currentTime(); |
314 | QDateTime whenl( when.date(), t.addSecs( snoozeTime*60)); | 314 | QDateTime whenl( when.date(), t.addSecs( snoozeTime*60)); |
315 | when=whenl; | 315 | when=whenl; |
316 | AlarmServer::addAlarm( when, | 316 | AlarmServer::addAlarm( when, |
317 | "QPE/Application/clock", | 317 | "QPE/Application/clock", |
318 | "alarm(QDateTime,int)", warn ); | 318 | "alarm(QDateTime,int)", warn ); |
319 | 319 | ||
320 | } | 320 | } |
321 | 321 | ||
322 | //toggles alarm on/off | 322 | //toggles alarm on/off |
323 | void Clock::slotToggleAlarm() | 323 | void Clock::slotToggleAlarm() |
324 | { | 324 | { |
325 | Config config( "qpe" ); | 325 | Config config( "qpe" ); |
326 | config.setGroup("Time"); | 326 | config.setGroup("Time"); |
327 | if(alarmBool) { | 327 | if(alarmBool) { |
328 | config.writeEntry("clockAlarmSet","FALSE"); | 328 | config.writeEntry("clockAlarmSet","FALSE"); |
329 | alarmOffBtn->setText( tr( "Alarm Off" ) ); | 329 | alarmOffBtn->setText( tr( "Alarm Is Off" ) ); |
330 | snoozeBtn->hide(); | 330 | snoozeBtn->hide(); |
331 | alarmBool=FALSE; | 331 | alarmBool=FALSE; |
332 | alarmOff(); | 332 | alarmOff(); |
333 | } else { | 333 | } else { |
334 | config.writeEntry("clockAlarmSet","TRUE"); | 334 | config.writeEntry("clockAlarmSet","TRUE"); |
335 | alarmOffBtn->setText( tr( "Alarm On" ) ); | 335 | alarmOffBtn->setText( tr( "Alarm Is On" ) ); |
336 | snoozeBtn->show(); | 336 | snoozeBtn->show(); |
337 | alarmBool=TRUE; | 337 | alarmBool=TRUE; |
338 | alarmOn(); | 338 | alarmOn(); |
339 | } | 339 | } |
340 | config.write(); | 340 | config.write(); |
341 | } | 341 | } |
342 | 342 | ||
343 | void Clock::alarmOn() | 343 | void Clock::alarmOn() |
344 | { | 344 | { |
345 | QDate d = QDate::currentDate(); | 345 | QDate d = QDate::currentDate(); |
346 | QTime tm((int)hour,(int)minute,0); | 346 | QTime tm((int)hour,(int)minute,0); |
347 | qDebug("Time set "+tm.toString()); | 347 | qDebug("Time set "+tm.toString()); |
348 | QTime t = QTime::currentTime(); | 348 | QTime t = QTime::currentTime(); |
349 | if( t > tm) | 349 | if( t > tm) |
350 | d = d.addDays(1); | 350 | d = d.addDays(1); |
351 | int warn; | 351 | int warn; |
diff --git a/noncore/tools/clock/setAlarm.cpp b/noncore/tools/clock/setAlarm.cpp index 01e52f6..6b95e6a 100644 --- a/noncore/tools/clock/setAlarm.cpp +++ b/noncore/tools/clock/setAlarm.cpp | |||
@@ -56,32 +56,33 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl | |||
56 | Hour_Slider = new QSlider( this, "Hour_Slider" ); | 56 | Hour_Slider = new QSlider( this, "Hour_Slider" ); |
57 | Hour_Slider->setPageStep( 1); | 57 | Hour_Slider->setPageStep( 1); |
58 | Hour_Slider->setOrientation( QSlider::Horizontal ); | 58 | Hour_Slider->setOrientation( QSlider::Horizontal ); |
59 | connect(Hour_Slider, SIGNAL( valueChanged(int)),this,SLOT(slotChangeHour(int))); | 59 | connect(Hour_Slider, SIGNAL( valueChanged(int)),this,SLOT(slotChangeHour(int))); |
60 | 60 | ||
61 | Set_AlarmLayout->addWidget( Hour_Slider, 2, 0 ); | 61 | Set_AlarmLayout->addWidget( Hour_Slider, 2, 0 ); |
62 | 62 | ||
63 | Hour_LCDNumber = new QLCDNumber( this, "Hour_LCDNumber" ); | 63 | Hour_LCDNumber = new QLCDNumber( this, "Hour_LCDNumber" ); |
64 | Hour_LCDNumber->setFrameShape( QLCDNumber::Box ); | 64 | Hour_LCDNumber->setFrameShape( QLCDNumber::Box ); |
65 | Hour_LCDNumber->setFrameShadow( QLCDNumber::Plain ); | 65 | Hour_LCDNumber->setFrameShadow( QLCDNumber::Plain ); |
66 | Hour_LCDNumber->setSegmentStyle( QLCDNumber::Flat ); | 66 | Hour_LCDNumber->setSegmentStyle( QLCDNumber::Flat ); |
67 | 67 | ||
68 | Set_AlarmLayout->addWidget( Hour_LCDNumber, 1, 0 ); | 68 | Set_AlarmLayout->addWidget( Hour_LCDNumber, 1, 0 ); |
69 | 69 | ||
70 | Minute_Slider = new QSlider( this, "Minute_Slider" ); | 70 | Minute_Slider = new QSlider( this, "Minute_Slider" ); |
71 | Minute_Slider->setMaxValue( 59); | 71 | Minute_Slider->setMaxValue( 59); |
72 | Minute_Slider->setPageStep( 1); | ||
72 | Minute_Slider->setOrientation( QSlider::Horizontal ); | 73 | Minute_Slider->setOrientation( QSlider::Horizontal ); |
73 | connect(Minute_Slider, SIGNAL( valueChanged(int)),this,SLOT(slotChangeMinute(int))); | 74 | connect(Minute_Slider, SIGNAL( valueChanged(int)),this,SLOT(slotChangeMinute(int))); |
74 | 75 | ||
75 | Set_AlarmLayout->addMultiCellWidget( Minute_Slider, 2, 2, 1, 2 ); | 76 | Set_AlarmLayout->addMultiCellWidget( Minute_Slider, 2, 2, 1, 2 ); |
76 | 77 | ||
77 | Minute_LCDNumber = new QLCDNumber( this, "Minute_LCDNumber" ); | 78 | Minute_LCDNumber = new QLCDNumber( this, "Minute_LCDNumber" ); |
78 | Minute_LCDNumber->setFrameShape( QLCDNumber::Box ); | 79 | Minute_LCDNumber->setFrameShape( QLCDNumber::Box ); |
79 | Minute_LCDNumber->setFrameShadow( QLCDNumber::Plain ); | 80 | Minute_LCDNumber->setFrameShadow( QLCDNumber::Plain ); |
80 | Minute_LCDNumber->setSegmentStyle( QLCDNumber::Flat ); | 81 | Minute_LCDNumber->setSegmentStyle( QLCDNumber::Flat ); |
81 | 82 | ||
82 | Set_AlarmLayout->addMultiCellWidget( Minute_LCDNumber, 1, 1, 1, 2 ); | 83 | Set_AlarmLayout->addMultiCellWidget( Minute_LCDNumber, 1, 1, 1, 2 ); |
83 | 84 | ||
84 | Am_RadioButton = new QRadioButton( this, "Am_RadioButton" ); | 85 | Am_RadioButton = new QRadioButton( this, "Am_RadioButton" ); |
85 | Am_RadioButton->setText( tr( "AM" ) ); | 86 | Am_RadioButton->setText( tr( "AM" ) ); |
86 | Am_RadioButton->setChecked(TRUE); | 87 | Am_RadioButton->setChecked(TRUE); |
87 | connect( Am_RadioButton, SIGNAL(toggled(bool)),this,SLOT( amButtonToggled(bool))); | 88 | connect( Am_RadioButton, SIGNAL(toggled(bool)),this,SLOT( amButtonToggled(bool))); |