-rw-r--r-- | noncore/settings/netsystemtime/timetabwidget.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/noncore/settings/netsystemtime/timetabwidget.cpp b/noncore/settings/netsystemtime/timetabwidget.cpp index 1ea460e..3cc127d 100644 --- a/noncore/settings/netsystemtime/timetabwidget.cpp +++ b/noncore/settings/netsystemtime/timetabwidget.cpp | |||
@@ -66,13 +66,13 @@ TimeTabWidget::TimeTabWidget( QWidget *parent ) | |||
66 | QScrollView *sv = new QScrollView( this ); | 66 | QScrollView *sv = new QScrollView( this ); |
67 | tmpvb->addWidget( sv, 0, 0 ); | 67 | tmpvb->addWidget( sv, 0, 0 ); |
68 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 68 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
69 | sv->setFrameStyle( QFrame::NoFrame ); | 69 | sv->setFrameStyle( QFrame::NoFrame ); |
70 | QWidget *container = new QWidget( sv->viewport() ); | 70 | QWidget *container = new QWidget( sv->viewport() ); |
71 | sv->addChild( container ); | 71 | sv->addChild( container ); |
72 | 72 | ||
73 | QGridLayout *layout = new QGridLayout( container ); | 73 | QGridLayout *layout = new QGridLayout( container ); |
74 | layout->setMargin( 2 ); | 74 | layout->setMargin( 2 ); |
75 | layout->setSpacing( 4 ); | 75 | layout->setSpacing( 4 ); |
76 | 76 | ||
77 | // Hours | 77 | // Hours |
78 | layout->addMultiCellWidget( new QLabel( tr( "Hour" ), container ), 1, 1, 0, 1 ); | 78 | layout->addMultiCellWidget( new QLabel( tr( "Hour" ), container ), 1, 1, 0, 1 ); |
@@ -184,13 +184,13 @@ void TimeTabWidget::setDateTime( const QDateTime &dt ) | |||
184 | } | 184 | } |
185 | else | 185 | else |
186 | { | 186 | { |
187 | sbHour->setValue( t.hour() ); | 187 | sbHour->setValue( t.hour() ); |
188 | } | 188 | } |
189 | sbMin->setValue( t.minute() ); | 189 | sbMin->setValue( t.minute() ); |
190 | 190 | ||
191 | // Set date | 191 | // Set date |
192 | btnDate->setDate( dt.date() ); | 192 | btnDate->setDate( dt.date() ); |
193 | } | 193 | } |
194 | 194 | ||
195 | void TimeTabWidget::setSystemTime( const QDateTime &dt ) | 195 | void TimeTabWidget::setSystemTime( const QDateTime &dt ) |
196 | { | 196 | { |
@@ -200,20 +200,26 @@ void TimeTabWidget::setSystemTime( const QDateTime &dt ) | |||
200 | struct timeval myTv; | 200 | struct timeval myTv; |
201 | int t = TimeConversion::toUTC( dt ); | 201 | int t = TimeConversion::toUTC( dt ); |
202 | myTv.tv_sec = t; | 202 | myTv.tv_sec = t; |
203 | myTv.tv_usec = 0; | 203 | myTv.tv_usec = 0; |
204 | 204 | ||
205 | if ( myTv.tv_sec != -1 ) | 205 | if ( myTv.tv_sec != -1 ) |
206 | ::settimeofday( &myTv, 0 ); | 206 | ::settimeofday( &myTv, 0 ); |
207 | |||
208 | /* | ||
209 | * Commit the datetime to the 'hardware' | ||
210 | * as Global::writeHWClock() is a NOOP with Opie Alarm | ||
211 | */ | ||
212 | system("/sbin/hwclock --systohc --utc"); | ||
207 | } | 213 | } |
208 | } | 214 | } |
209 | 215 | ||
210 | void TimeTabWidget::slotUse12HourTime( int i ) | 216 | void TimeTabWidget::slotUse12HourTime( int i ) |
211 | { | 217 | { |
212 | use12HourTime = (i == 1); | 218 | use12HourTime = (i == 1); |
213 | 219 | ||
214 | cbAmpm->setEnabled( use12HourTime ); | 220 | cbAmpm->setEnabled( use12HourTime ); |
215 | 221 | ||
216 | int show_hour = sbHour->value(); | 222 | int show_hour = sbHour->value(); |
217 | 223 | ||
218 | if ( use12HourTime ) | 224 | if ( use12HourTime ) |
219 | { | 225 | { |