summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/setAlarm.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/tools/clock/setAlarm.cpp b/noncore/tools/clock/setAlarm.cpp
index bd964e0..990ff81 100644
--- a/noncore/tools/clock/setAlarm.cpp
+++ b/noncore/tools/clock/setAlarm.cpp
@@ -15,48 +15,49 @@
#include "setAlarm.h"
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
#include <qstring.h>
#include <qlabel.h>
#include <qlcdnumber.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qslider.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qbuttongroup.h>
Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "Set_Alarm" );
resize( 240, 101 );
setMaximumSize( QSize( 240, 320 ) );
+ move(0,48);
setCaption( tr( "Set Alarm" ) );
connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
Set_AlarmLayout = new QGridLayout( this );
Set_AlarmLayout->setSpacing( 6 );
Set_AlarmLayout->setMargin( 11 );
TextLabel1 = new QLabel( this, "TextLabel1" );
TextLabel1->setText( tr( "Hour" ) );
Set_AlarmLayout->addWidget( TextLabel1, 0, 0 );
TextLabel2 = new QLabel( this, "TextLabel2" );
TextLabel2->setText( tr( "Minute" ) );
Set_AlarmLayout->addMultiCellWidget( TextLabel2, 0, 0, 1, 2 );
Hour_Slider = new QSlider( this, "Hour_Slider" );
Hour_Slider->setPageStep( 1);
Hour_Slider->setOrientation( QSlider::Horizontal );
connect(Hour_Slider, SIGNAL( valueChanged(int)),this,SLOT(slotChangeHour(int)));
Set_AlarmLayout->addWidget( Hour_Slider, 2, 0 );
@@ -112,50 +113,50 @@ Set_Alarm::Set_Alarm( QWidget* parent, const char* name, bool modal, WFlags fl
SnoozeSlider->setMaxValue( 60 );
SnoozeSlider->setOrientation( QSlider::Horizontal );
connect(SnoozeSlider, SIGNAL( valueChanged(int)),this,SLOT(slotChangeSnooze(int)));
Set_AlarmLayout->addMultiCellWidget( SnoozeSlider, 3, 3, 3, 4 );
Config config( "qpe" );
config.setGroup("Time");
bool ok;
bool ampm = config.readBoolEntry( "AMPM", TRUE );
QString alarmHour=config.readEntry("clockAlarmHour","8");
int i_alarmHour = alarmHour.toInt(&ok,10);
QString alarmMinute=config.readEntry("clockAlarmMinute","0");
QString snoozeTime=config.readEntry("clockAlarmSnooze","0");
if(ampm) {
Hour_Slider->setMaxValue( 12);
Hour_Slider->setMinValue( 1);
if( i_alarmHour > 12) {
i_alarmHour = i_alarmHour - 12;
Pm_RadioButton->setChecked(TRUE);
}
else if ( i_alarmHour == 0 ) {
- i_alarmHour = 12;
- }
+ i_alarmHour = 12;
+ }
Hour_Slider->setValue( i_alarmHour );
Minute_Slider->setValue( alarmMinute.toInt(&ok,10) );
SnoozeSlider->setValue( snoozeTime.toInt(&ok,10) );
} else {
Hour_Slider->setMaxValue( 23);
Hour_Slider->setMinValue( 0);
Hour_Slider->setValue( i_alarmHour);
Minute_Slider->setValue( alarmMinute.toInt(&ok,10) );
SnoozeSlider->setValue( snoozeTime.toInt(&ok,10) );
Am_RadioButton->hide();
Pm_RadioButton->hide();
}
// signals and slots connections
}
Set_Alarm::~Set_Alarm()
{
}
void Set_Alarm::slotChangeHour(int hour)
{
Hour_LCDNumber->display(hour);
}