summaryrefslogtreecommitdiff
authortille <tille>2002-07-06 13:53:48 (UTC)
committer tille <tille>2002-07-06 13:53:48 (UTC)
commitac76e913d1930cdf7903fed344bd7bcc1b7545c0 (patch) (side-by-side diff)
tree8c71a16a7bc80eccbe1affbc976b795be6807b62
parent02b8c37db8d3fd197c8c730451bd7819e65817a1 (diff)
downloadopie-ac76e913d1930cdf7903fed344bd7bcc1b7545c0.zip
opie-ac76e913d1930cdf7903fed344bd7bcc1b7545c0.tar.gz
opie-ac76e913d1930cdf7903fed344bd7bcc1b7545c0.tar.bz2
clockapplet uses qcop call to open settime dialog
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/main.cpp6
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp32
-rw-r--r--noncore/settings/netsystemtime/ntp.h9
-rw-r--r--noncore/settings/netsystemtime/opie-netsystemtime.control2
-rw-r--r--noncore/settings/netsystemtime/opie-netsystemtime.postinst7
-rw-r--r--noncore/settings/netsystemtime/opie-netsystemtime.postrm4
6 files changed, 42 insertions, 18 deletions
diff --git a/noncore/settings/netsystemtime/main.cpp b/noncore/settings/netsystemtime/main.cpp
index 5b01408..c6d5f9a 100644
--- a/noncore/settings/netsystemtime/main.cpp
+++ b/noncore/settings/netsystemtime/main.cpp
@@ -1,3 +1,3 @@
-//#include "settime.h"
+#include <stdio.h>
#include "ntp.h"
#include <qpe/qpeapplication.h>
@@ -5,7 +5,9 @@
int main( int argc, char ** argv )
{
+ printf("This is netsystemtime\n");
+ printf("$Id$\n");
+
QPEApplication a( argc, argv );
- // SetDateTime mw;
Ntp mw;
a.showMainWidget( &mw );
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 0b13b6d..2b779fa 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -19,4 +19,5 @@
#include <qpe/qpedialog.h>
#include <qpe/datebookdb.h>
+#include <qpe/qcopenvelope_qws.h>
#include <sys/time.h>
#include <time.h>
@@ -43,4 +44,6 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) );
+ makeChannel();
+
ntpTimer = new QTimer(this);
@@ -216,4 +219,5 @@ void Ntp::readLookups()
TableLookups->sortColumn(0, false, true );
// TableLookups->setSorting( true );
+ _shiftPerSec = 0;
for (int i=0; i < lookupCount; i++)
{
@@ -221,7 +225,6 @@ void Ntp::readLookups()
last = cfg.readEntry("secsSinceLast",0).toFloat();
shift = QString(cfg.readEntry("timeShift",0)).toFloat();
-// qDebug("%i last %f",i,last);
-// qDebug("%i shift %f",i,shift);
shiftPerSec = shift / last;
+ qDebug("%i shift %f",i,shiftPerSec);
_shiftPerSec += shiftPerSec;
TableLookups->setText( i,0,QString::number(shiftPerSec*60*60));
@@ -296,2 +299,27 @@ void Ntp::ntpOutPut(QString out)
}
+
+void Ntp::makeChannel()
+{
+ channel = new QCopChannel( "QPE/Application/netsystemtime", this );
+ connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
+ this, SLOT(receive(const QCString&, const QByteArray&)) );
+}
+
+
+
+void Ntp::receive(const QCString &msg, const QByteArray &arg)
+{
+ qDebug("QCop "+msg+" "+QCString(arg));
+ if ( msg == "open(QString)" )
+ {
+ // qApp->exec();
+ }else{
+ qDebug("Ntp::receive: Huh what do ya want");
+ }
+}
+
+void Ntp::setDocument(const QString &fileName)
+{
+
+} \ No newline at end of file
diff --git a/noncore/settings/netsystemtime/ntp.h b/noncore/settings/netsystemtime/ntp.h
index c78dc55..56e0131 100644
--- a/noncore/settings/netsystemtime/ntp.h
+++ b/noncore/settings/netsystemtime/ntp.h
@@ -8,4 +8,5 @@ class QString;
class QTimer;
class QSocket;
+class QCopChannel;
class Ntp : public SetDateTime
@@ -17,8 +18,11 @@ public:
~Ntp();
+public slots:
+ void setDocument (const QString &);
protected:
QDateTime predictedTime;
-
-
+ void makeChannel();
+protected slots:
+ void receive(const QCString &msg, const QByteArray &arg);
private:
QString _ntpOutput;
@@ -28,4 +32,5 @@ private:
QTimer *ntpTimer;
QSocket *ntpSock;
+ QCopChannel *channel;
float getTimeShift();
diff --git a/noncore/settings/netsystemtime/opie-netsystemtime.control b/noncore/settings/netsystemtime/opie-netsystemtime.control
index 9251e5c..e4b744d 100644
--- a/noncore/settings/netsystemtime/opie-netsystemtime.control
+++ b/noncore/settings/netsystemtime/opie-netsystemtime.control
@@ -1,4 +1,4 @@
Packagename: opie-netsystemtime
-Files: bin/netsystemtime apps/Settings/ntpdatetime.desktop etc/ntpservers
+Files: bin/netsystemtime apps/Settings/netsystemtime.desktop etc/ntpservers
Priority: optional
Section: opie/settings
diff --git a/noncore/settings/netsystemtime/opie-netsystemtime.postinst b/noncore/settings/netsystemtime/opie-netsystemtime.postinst
deleted file mode 100644
index 233cd31..0000000
--- a/noncore/settings/netsystemtime/opie-netsystemtime.postinst
+++ b/dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh -v
-
-systime=`ipkg status | grep Package | grep -i systemtime | sed "s/Package://"`
-ipkg remove $pack
-
-cd $QPEDIR/bin/
-ln -s netsystemtime systemtime
diff --git a/noncore/settings/netsystemtime/opie-netsystemtime.postrm b/noncore/settings/netsystemtime/opie-netsystemtime.postrm
deleted file mode 100644
index 4b2ab7c..0000000
--- a/noncore/settings/netsystemtime/opie-netsystemtime.postrm
+++ b/dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh -v
-
-cd $QPEDIR/bin/
-rm systemtime