author | tille <tille> | 2002-06-27 11:05:15 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-27 11:05:15 (UTC) |
commit | 4301065a4e43b0860774dca358a8027790a42f4f (patch) (unidiff) | |
tree | 52e8abb5e859636b6b651727fb1dcf94350ba158 /noncore | |
parent | f2cd92301181f3bc895b0d1701183e4da7b52812 (diff) | |
download | opie-4301065a4e43b0860774dca358a8027790a42f4f.zip opie-4301065a4e43b0860774dca358a8027790a42f4f.tar.gz opie-4301065a4e43b0860774dca358a8027790a42f4f.tar.bz2 |
if postinst works, clicking on clockapplet should work too
5 files changed, 34 insertions, 13 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp index 083b50f..830c0c3 100644 --- a/noncore/settings/netsystemtime/ntp.cpp +++ b/noncore/settings/netsystemtime/ntp.cpp | |||
@@ -25,7 +25,6 @@ | |||
25 | Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) | 25 | Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) |
26 | : SetDateTime( parent, name, fl ) | 26 | : SetDateTime( parent, name, fl ) |
27 | { | 27 | { |
28 | qDebug("%s", QPEApplication::qpeDir().latin1()); | ||
29 | Config ntpSrvs(QPEApplication::qpeDir()+"etc/ntpservers",Config::File); | 28 | Config ntpSrvs(QPEApplication::qpeDir()+"etc/ntpservers",Config::File); |
30 | ntpSrvs.setGroup("servers"); | 29 | ntpSrvs.setGroup("servers"); |
31 | int srvCount = ntpSrvs.readNumEntry("count", 0 ); | 30 | int srvCount = ntpSrvs.readNumEntry("count", 0 ); |
@@ -199,8 +198,9 @@ void Ntp::readLookups() | |||
199 | TableLookups->horizontalHeader()->setLabel(1,tr("last [h]")); | 198 | TableLookups->horizontalHeader()->setLabel(1,tr("last [h]")); |
200 | TableLookups->horizontalHeader()->setLabel(2,tr("offset [s]")); | 199 | TableLookups->horizontalHeader()->setLabel(2,tr("offset [s]")); |
201 | TableLookups->horizontalHeader()->setLabel(0,tr("shift [s/h]")); | 200 | TableLookups->horizontalHeader()->setLabel(0,tr("shift [s/h]")); |
202 | int cw = 50;//TableLookups->width()/4; | 201 | int cw = TableLookups->width()/4; |
203 | qDebug("column width %i",cw); | 202 | qDebug("column width %i",cw); |
203 | cw = 50; | ||
204 | TableLookups->setColumnWidth( 0, cw+30 ); | 204 | TableLookups->setColumnWidth( 0, cw+30 ); |
205 | TableLookups->setColumnWidth( 1, cw ); | 205 | TableLookups->setColumnWidth( 1, cw ); |
206 | TableLookups->setColumnWidth( 2, cw ); | 206 | TableLookups->setColumnWidth( 2, cw ); |
@@ -215,12 +215,12 @@ void Ntp::readLookups() | |||
215 | // qDebug("%i shift %f",i,shift); | 215 | // qDebug("%i shift %f",i,shift); |
216 | shiftPerSec = shift / last; | 216 | shiftPerSec = shift / last; |
217 | _shiftPerSec += shiftPerSec; | 217 | _shiftPerSec += shiftPerSec; |
218 | TableLookups->setText( i,0,QString::number(shiftPerSec*60)); | 218 | TableLookups->setText( i,0,QString::number(shiftPerSec*60*60)); |
219 | TableLookups->setText( i,2,QString::number(shift)); | 219 | TableLookups->setText( i,2,QString::number(shift)); |
220 | TableLookups->setText( i,1,QString::number(last/60)); | 220 | TableLookups->setText( i,1,QString::number(last/(60*60))); |
221 | } | 221 | } |
222 | _shiftPerSec /= lookupCount+1; | 222 | _shiftPerSec /= lookupCount; |
223 | TextLabelShift->setText(QString::number(_shiftPerSec)+tr(" seconds")); | 223 | TextLabelShift->setText(QString::number(_shiftPerSec*60*60)+tr(" s/h")); |
224 | } | 224 | } |
225 | 225 | ||
226 | void Ntp::preditctTime() | 226 | void Ntp::preditctTime() |
diff --git a/noncore/settings/netsystemtime/opie-netsystemtime.control b/noncore/settings/netsystemtime/opie-netsystemtime.control index d3290e9..8fd7da5 100644 --- a/noncore/settings/netsystemtime/opie-netsystemtime.control +++ b/noncore/settings/netsystemtime/opie-netsystemtime.control | |||
@@ -1,3 +1,4 @@ | |||
1 | Packagename: opie-netsystemtime | ||
1 | Files: bin/netsystemtime apps/Settings/ntpdatetime.desktop etc/ntpservers | 2 | Files: bin/netsystemtime apps/Settings/ntpdatetime.desktop etc/ntpservers |
2 | Priority: optional | 3 | Priority: optional |
3 | Section: opie/settings | 4 | Section: opie/settings |
@@ -7,5 +8,5 @@ Maintainer: Patrick S. Vogt <tille@handhelds.org> | |||
7 | Architecture: arm | 8 | Architecture: arm |
8 | Version: $QPE_VERSION-$SUB_VERSION | 9 | Version: $QPE_VERSION-$SUB_VERSION |
9 | Depends: opie-base ($QPE_VERSION), ntpdate | 10 | Depends: opie-base ($QPE_VERSION), ntpdate |
10 | Description: ntp ( Network Time Protocol) gui | 11 | Description: ntp (Network Time Protocol) gui |
11 | This utility syncs system time with a atomic timerserver via internet | 12 | This utility syncs system time with a atomic timerserver via internet |
diff --git a/noncore/settings/netsystemtime/opie-netsystemtime.postinst b/noncore/settings/netsystemtime/opie-netsystemtime.postinst new file mode 100644 index 0000000..233cd31 --- a/dev/null +++ b/noncore/settings/netsystemtime/opie-netsystemtime.postinst | |||
@@ -0,0 +1,7 @@ | |||
1 | #!/bin/sh -v | ||
2 | |||
3 | systime=`ipkg status | grep Package | grep -i systemtime | sed "s/Package://"` | ||
4 | ipkg remove $pack | ||
5 | |||
6 | cd $QPEDIR/bin/ | ||
7 | ln -s netsystemtime systemtime | ||
diff --git a/noncore/settings/netsystemtime/opie-netsystemtime.postrm b/noncore/settings/netsystemtime/opie-netsystemtime.postrm new file mode 100644 index 0000000..4b2ab7c --- a/dev/null +++ b/noncore/settings/netsystemtime/opie-netsystemtime.postrm | |||
@@ -0,0 +1,4 @@ | |||
1 | #!/bin/sh -v | ||
2 | |||
3 | cd $QPEDIR/bin/ | ||
4 | rm systemtime | ||
diff --git a/noncore/settings/netsystemtime/settime.cpp b/noncore/settings/netsystemtime/settime.cpp index 93543cd..e7e604f 100644 --- a/noncore/settings/netsystemtime/settime.cpp +++ b/noncore/settings/netsystemtime/settime.cpp | |||
@@ -231,12 +231,6 @@ void SetDateTime::writeSettings() | |||
231 | void SetDateTime::commitTime() | 231 | void SetDateTime::commitTime() |
232 | { | 232 | { |
233 | tz->setFocus(); | 233 | tz->setFocus(); |
234 | // really turn off the screensaver before doing anything | ||
235 | { | ||
236 | // Needs to be encased in { } so that it deconstructs and sends | ||
237 | QCopEnvelope disableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); | ||
238 | disableScreenSaver << 0 << 0 << 0; | ||
239 | } | ||
240 | // Need to process the QCOP event generated above before proceeding | 234 | // Need to process the QCOP event generated above before proceeding |
241 | qApp->processEvents(); | 235 | qApp->processEvents(); |
242 | 236 | ||
@@ -250,6 +244,12 @@ void SetDateTime::commitTime() | |||
250 | 244 | ||
251 | void SetDateTime::setTime(QDateTime dt) | 245 | void SetDateTime::setTime(QDateTime dt) |
252 | { | 246 | { |
247 | // really turn off the screensaver before doing anything | ||
248 | { | ||
249 | // Needs to be encased in { } so that it deconstructs and sends | ||
250 | QCopEnvelope disableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); | ||
251 | disableScreenSaver << 0 << 0 << 0; | ||
252 | } | ||
253 | Config cfg("ntp",Config::User); | 253 | Config cfg("ntp",Config::User); |
254 | cfg.setGroup("correction"); | 254 | cfg.setGroup("correction"); |
255 | int t = TimeConversion::toUTC(dt); | 255 | int t = TimeConversion::toUTC(dt); |
@@ -265,10 +265,19 @@ void SetDateTime::setTime(QDateTime dt) | |||
265 | // to allow the alarm server to get a better grip on itself | 265 | // to allow the alarm server to get a better grip on itself |
266 | // (example re-trigger alarms for when we travel back in time) | 266 | // (example re-trigger alarms for when we travel back in time) |
267 | DateBookDB db; | 267 | DateBookDB db; |
268 | // Restore screensaver | ||
269 | QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); | ||
270 | enableScreenSaver << -1 << -1 << -1; | ||
268 | } | 271 | } |
269 | 272 | ||
270 | void SetDateTime::updateSystem(int i) | 273 | void SetDateTime::updateSystem(int i) |
271 | { | 274 | { |
275 | // really turn off the screensaver before doing anything | ||
276 | { | ||
277 | // Needs to be encased in { } so that it deconstructs and sends | ||
278 | QCopEnvelope disableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); | ||
279 | disableScreenSaver << 0 << 0 << 0; | ||
280 | } | ||
272 | qDebug("SetDateTime::updateSystem(int %i)",i); | 281 | qDebug("SetDateTime::updateSystem(int %i)",i); |
273 | writeSettings(); | 282 | writeSettings(); |
274 | 283 | ||