From ac76e913d1930cdf7903fed344bd7bcc1b7545c0 Mon Sep 17 00:00:00 2001 From: tille Date: Sat, 06 Jul 2002 13:53:48 +0000 Subject: clockapplet uses qcop call to open settime dialog --- (limited to 'noncore/settings/netsystemtime/ntp.cpp') 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 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,8 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) SpinBoxNtpDelay->setValue( cfg.readNumEntry("ntpRefreshFreq",42) ); ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); + makeChannel(); + ntpTimer = new QTimer(this); ntpProcess = new OProcess( ); @@ -215,14 +218,14 @@ void Ntp::readLookups() TableLookups->setColumnWidth( 2, cw ); TableLookups->sortColumn(0, false, true ); // TableLookups->setSorting( true ); + _shiftPerSec = 0; for (int i=0; i < lookupCount; i++) { cfg.setGroup("lookup_"+QString::number(i)); 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)); TableLookups->setText( i,2,QString::number(shift)); @@ -295,3 +298,28 @@ void Ntp::ntpOutPut(QString out) MultiLineEditntpOutPut->setCursorPosition(MultiLineEditntpOutPut->numLines() + 1,0,FALSE); } + +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 -- cgit v0.9.0.2