summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/settime.cpp
Unidiff
Diffstat (limited to 'noncore/settings/netsystemtime/settime.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/settime.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/noncore/settings/netsystemtime/settime.cpp b/noncore/settings/netsystemtime/settime.cpp
index 01268c9..2cef6e8 100644
--- a/noncore/settings/netsystemtime/settime.cpp
+++ b/noncore/settings/netsystemtime/settime.cpp
@@ -57,12 +57,21 @@ SetDateTime::SetDateTime(QWidget *parent, const char *name, WFlags f )
57 // setCaption( tr("Set System Time") ); 57 // setCaption( tr("Set System Time") );
58 58
59// QVBoxLayout *vb = new QVBoxLayout( this, 5 ); 59// QVBoxLayout *vb = new QVBoxLayout( this, 5 );
60 QVBoxLayout *vb = new QVBoxLayout( FrameSystemTime, 5 ); 60 QVBoxLayout *vb = new QVBoxLayout( FrameSystemTime, 5 );
61 QVBoxLayout *vb2 = new QVBoxLayout( FrameSetTime, 5 ); 61 QVBoxLayout *vb2 = new QVBoxLayout( FrameSetTime, 5 );
62 62
63 TextLabelMainPredTime = new QLabel( FrameSystemTime );
64 vb->addWidget( TextLabelMainPredTime, 1, 0 );
65 ButtonSetTime = new QPushButton( FrameSystemTime );
66 vb->addWidget( ButtonSetTime, 1, 0 );
67
68 QFrame *hline = new QFrame( FrameSystemTime );
69 hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );
70 vb->addWidget( hline );
71
63 QHBoxLayout *hb = new QHBoxLayout( vb, -1, "timezone layout" ); 72 QHBoxLayout *hb = new QHBoxLayout( vb, -1, "timezone layout" );
64 73
65 QLabel *lblZone = new QLabel( tr( "Time Zone" ), FrameSystemTime, "timezone label" ); 74 QLabel *lblZone = new QLabel( tr( "Time Zone" ), FrameSystemTime, "timezone label" );
66 lblZone->setMaximumSize( lblZone->sizeHint() ); 75 lblZone->setMaximumSize( lblZone->sizeHint() );
67 hb->addWidget( lblZone ); 76 hb->addWidget( lblZone );
68 77
@@ -79,23 +88,22 @@ SetDateTime::SetDateTime(QWidget *parent, const char *name, WFlags f )
79 dateButton = new DateButton( TRUE, FrameSetTime ); 88 dateButton = new DateButton( TRUE, FrameSetTime );
80 db->addWidget( dateButton, 2 ); 89 db->addWidget( dateButton, 2 );
81 90
82 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 91 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
83 vb2->addItem( spacer ); 92 vb2->addItem( spacer );
84 93
85 QFrame *hline = new QFrame( FrameSystemTime ); 94 hline = new QFrame( FrameSystemTime );
86 hline->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 95 hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );
87 vb->addWidget( hline ); 96 vb->addWidget( hline );
88 97
89 Config config("qpe"); 98 Config config("qpe");
90 config.setGroup( "Time" ); 99 config.setGroup( "Time" );
91 100
92 QHBoxLayout *hb1 = new QHBoxLayout( vb ); 101 QHBoxLayout *hb1 = new QHBoxLayout( vb );
93 102
94 QLabel *l = new QLabel( tr("Time format"), FrameSystemTime ); 103 QLabel *l = new QLabel( tr("Time format"), FrameSystemTime );
95 // l->setAlignment( AlignRight | AlignVCenter );
96 hb1->addWidget( l, 1 ); 104 hb1->addWidget( l, 1 );
97 105
98 106
99 ampmCombo = new QComboBox( FrameSystemTime ); 107 ampmCombo = new QComboBox( FrameSystemTime );
100 ampmCombo->insertItem( tr("24 hour"), 0 ); 108 ampmCombo->insertItem( tr("24 hour"), 0 );
101 ampmCombo->insertItem( tr("12 hour"), 1 ); 109 ampmCombo->insertItem( tr("12 hour"), 1 );
@@ -174,22 +182,22 @@ SetDateTime::SetDateTime(QWidget *parent, const char *name, WFlags f )
174 hb4->addWidget( clockAppletCombo, 2 ); 182 hb4->addWidget( clockAppletCombo, 2 );
175 int clockApplet = config.readNumEntry("ClockApplet",0); 183 int clockApplet = config.readNumEntry("ClockApplet",0);
176 clockAppletCombo->setCurrentItem( clockApplet ); 184 clockAppletCombo->setCurrentItem( clockApplet );
177 185
178 vb->addStretch( 0 ); 186 vb->addStretch( 0 );
179 187
188 QObject::connect( PushButtonSetManualTime, SIGNAL(clicked()),
189 this, SLOT(commitTime()));
190
180 QObject::connect( tz, SIGNAL( signalNewTz( const QString& ) ), 191 QObject::connect( tz, SIGNAL( signalNewTz( const QString& ) ),
181 timeButton, SLOT( slotTzChange( const QString& ) ) ); 192 timeButton, SLOT( slotTzChange( const QString& ) ) );
182 QObject::connect( tz, SIGNAL( signalNewTz( const QString& ) ), 193 QObject::connect( tz, SIGNAL( signalNewTz( const QString& ) ),
183 SLOT( tzChange( const QString& ) ) ); 194 SLOT( tzChange( const QString& ) ) );
184 QObject::connect( PushButtonSetManualTime, SLOT(clicked()),
185 SLOT(commitTime()));
186// dl = new QPEDialogListener(this);
187} 195}
188 196
189void SetDateTime::accept() 197SetDateTime::~SetDateTime()
190{ 198{
191 199
192 Config config("qpe"); 200 Config config("qpe");
193 config.setGroup( "Time" ); 201 config.setGroup( "Time" );
194 config.writeEntry( "AMPM", ampmCombo->currentItem() ); 202 config.writeEntry( "AMPM", ampmCombo->currentItem() );
195 config.writeEntry( "MONDAY", weekStartCombo->currentItem() ); 203 config.writeEntry( "MONDAY", weekStartCombo->currentItem() );
@@ -261,19 +269,12 @@ void SetDateTime::setTime(QDateTime dt)
261 setDateFormat << date_formats[dateFormatCombo->currentItem()]; 269 setDateFormat << date_formats[dateFormatCombo->currentItem()];
262 270
263 // Restore screensaver 271 // Restore screensaver
264 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); 272 QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" );
265 enableScreenSaver << -1 << -1 << -1; 273 enableScreenSaver << -1 << -1 << -1;
266 274
267 // QDialog::accept();
268}
269
270void SetDateTime::done(int r)
271{
272// QDialog::done(r);
273 close();
274} 275}
275 276
276void SetDateTime::tzChange( const QString &tz ) 277void SetDateTime::tzChange( const QString &tz )
277{ 278{
278 // set the TZ get the time and leave gracefully... 279 // set the TZ get the time and leave gracefully...
279 QString strSave; 280 QString strSave;