summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/netsystemtime/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/mainwindow.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/noncore/settings/netsystemtime/mainwindow.cpp b/noncore/settings/netsystemtime/mainwindow.cpp
index 2d240ba..66e1ca3 100644
--- a/noncore/settings/netsystemtime/mainwindow.cpp
+++ b/noncore/settings/netsystemtime/mainwindow.cpp
@@ -40,4 +40,5 @@
#include <qpe/datebookdb.h>
#include <qpe/qpeapplication.h>
+#include <qpe/qpedialog.h>
#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
@@ -51,5 +52,5 @@
#include <qtimer.h>
-MainWindow::MainWindow()
+MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f )
: QDialog( 0x0, 0x0, TRUE, 0 )
{
@@ -67,5 +68,5 @@ MainWindow::MainWindow()
ntpTab = 0x0;
- // Add tab widgets
+ // Add tab widgets
mainWidget->addTab( timeTab = new TimeTabWidget( mainWidget ), "netsystemtime/DateTime", tr( "Time" ) );
mainWidget->addTab( formatTab = new FormatTabWidget( mainWidget ), "netsystemtime/formattab", tr( "Format" ) );
@@ -80,8 +81,7 @@ MainWindow::MainWindow()
layout->addWidget( mainWidget );
- // Create QCOP channel
- QCopChannel *channel = new QCopChannel( "QPE/Application/netsystemtime", this );
- connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(slotQCopReceive(const QCString&, const QByteArray&)) );
+ connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)),
+ this, SLOT(slotQCopReceive(const QCString&, const QByteArray&)) );
+
// Create NTP socket
@@ -111,5 +111,6 @@ MainWindow::MainWindow()
// Display app
- showMaximized();
+ //showMaximized();
+ (void)new QPEDialogListener(this);
}
@@ -166,5 +167,5 @@ void MainWindow::runNTP()
{
QString msg = tr( "You asked for a delay of %1 minutes, but only %2 minutes elapsed since last lookup.<br>Continue?" ).arg( QString::number( ntpDelay ) ).arg( QString::number( _lookupDiff / 60 ) );
-
+
switch (
QMessageBox::warning( this, tr( "Continue?" ), msg, QMessageBox::Yes, QMessageBox::No )
@@ -199,6 +200,6 @@ void MainWindow::runNTP()
else
ntpProcess->clearArguments();
-
- *ntpProcess << "ntpdate" << srv;
+
+ *ntpProcess << "ntpdate" << srv;
bool ret = ntpProcess->start( OProcess::NotifyOnExit, OProcess::AllOutput );
if ( !ret )
@@ -298,5 +299,5 @@ void MainWindow::slotNtpFinished( OProcess *p )
QString output;
QDateTime dt = QDateTime::currentDateTime();
-
+
// Verify run was successful
if ( p->exitStatus() != 0 || !p->normalExit() )
@@ -339,5 +340,5 @@ void MainWindow::slotNtpFinished( OProcess *p )
int secsSinceLast = time - lastLookup;
output = tr( "%1 seconds").arg(QString::number( timeShift ));
-
+
// Display information on time server tab
if ( ntpTabEnabled )