From 35615947e11575a61456c8483e7f6d67fe59d5ed Mon Sep 17 00:00:00 2001 From: mickeyl Date: Wed, 29 Oct 2003 17:22:08 +0000 Subject: merge noncore/settings/* except networksettings for which tille volunteered (thanks) --- (limited to 'noncore/settings/netsystemtime') diff --git a/noncore/settings/netsystemtime/main.cpp b/noncore/settings/netsystemtime/main.cpp index 4b20a61..da98eee 100644 --- a/noncore/settings/netsystemtime/main.cpp +++ b/noncore/settings/netsystemtime/main.cpp @@ -29,13 +29,7 @@ #include "mainwindow.h" #include +#include -int main( int argc, char ** argv ) -{ - QPEApplication a( argc, argv ); - MainWindow mw; - a.showMainWidget( &mw ); - - return a.exec(); -} +OPIE_EXPORT_APP( OApplicationFactory ) 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 @@ -39,6 +39,7 @@ #include #include #include +#include #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) #include @@ -50,7 +51,7 @@ #include #include -MainWindow::MainWindow() +MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f ) : QDialog( 0x0, 0x0, TRUE, 0 ) { setCaption( tr( "SystemTime" ) ); @@ -66,7 +67,7 @@ MainWindow::MainWindow() ntpProcess = 0x0; 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" ) ); mainWidget->addTab( settingsTab = new SettingsTabWidget( mainWidget ), "SettingsIcon", tr( "Settings" ) ); @@ -79,10 +80,9 @@ MainWindow::MainWindow() mainWidget->setCurrentTab( tr( "Time" ) ); 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 ntpSock = new QSocket( this ); @@ -110,7 +110,8 @@ MainWindow::MainWindow() slotCheckNtp( -1 ); // Display app - showMaximized(); + //showMaximized(); + (void)new QPEDialogListener(this); } MainWindow::~MainWindow() @@ -165,7 +166,7 @@ void MainWindow::runNTP() if ( !ntpDelayElapsed() && ntpInteractive ) { QString msg = tr( "You asked for a delay of %1 minutes, but only %2 minutes elapsed since last lookup.
Continue?" ).arg( QString::number( ntpDelay ) ).arg( QString::number( _lookupDiff / 60 ) ); - + switch ( QMessageBox::warning( this, tr( "Continue?" ), msg, QMessageBox::Yes, QMessageBox::No ) ) @@ -198,8 +199,8 @@ void MainWindow::runNTP() else ntpProcess->clearArguments(); - - *ntpProcess << "ntpdate" << srv; + + *ntpProcess << "ntpdate" << srv; bool ret = ntpProcess->start( OProcess::NotifyOnExit, OProcess::AllOutput ); if ( !ret ) { @@ -297,7 +298,7 @@ void MainWindow::slotNtpFinished( OProcess *p ) { QString output; QDateTime dt = QDateTime::currentDateTime(); - + // Verify run was successful if ( p->exitStatus() != 0 || !p->normalExit() ) { @@ -338,7 +339,7 @@ void MainWindow::slotNtpFinished( OProcess *p ) return; int secsSinceLast = time - lastLookup; output = tr( "%1 seconds").arg(QString::number( timeShift )); - + // Display information on time server tab if ( ntpTabEnabled ) { diff --git a/noncore/settings/netsystemtime/mainwindow.h b/noncore/settings/netsystemtime/mainwindow.h index fa94335..1cdbc1a 100644 --- a/noncore/settings/netsystemtime/mainwindow.h +++ b/noncore/settings/netsystemtime/mainwindow.h @@ -48,8 +48,9 @@ class MainWindow : public QDialog Q_OBJECT public: - MainWindow(); + MainWindow( QWidget *parent = 0, const char *name = 0, bool modal = FALSE,WFlags f = 0); ~MainWindow(); + static QString appName() { return QString::fromLatin1("systemtime"); } protected: void accept(); diff --git a/noncore/settings/netsystemtime/netsystemtime.pro b/noncore/settings/netsystemtime/netsystemtime.pro index 7a12dd1..2140f2e 100644 --- a/noncore/settings/netsystemtime/netsystemtime.pro +++ b/noncore/settings/netsystemtime/netsystemtime.pro @@ -1,6 +1,4 @@ -TEMPLATE = app -CONFIG = qt warn_on debug -#CONFIG = qt warn_on release +CONFIG = qt warn_on release quick-app HEADERS = mainwindow.h \ timetabwidget.h \ formattabwidget.h \ @@ -17,8 +15,7 @@ SOURCES = main.cpp \ INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopie -INTERFACES = -DESTDIR = $(OPIEDIR)/bin + TARGET = systemtime TRANSLATIONS = ../../../i18n/de/systemtime.ts \ -- cgit v0.9.0.2