-rw-r--r-- | noncore/settings/netsystemtime/mainwindow.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/noncore/settings/netsystemtime/mainwindow.cpp b/noncore/settings/netsystemtime/mainwindow.cpp index 85a46b7..2d240ba 100644 --- a/noncore/settings/netsystemtime/mainwindow.cpp +++ b/noncore/settings/netsystemtime/mainwindow.cpp | |||
@@ -135,70 +135,64 @@ void MainWindow::accept() | |||
135 | 135 | ||
136 | // Save settings options | 136 | // Save settings options |
137 | settingsTab->saveSettings(); | 137 | settingsTab->saveSettings(); |
138 | 138 | ||
139 | // Since time has changed quickly load in the DateBookDB to allow the alarm server to get a better | 139 | // Since time has changed quickly load in the DateBookDB to allow the alarm server to get a better |
140 | // grip on itself (example re-trigger alarms for when we travel back in time). | 140 | // grip on itself (example re-trigger alarms for when we travel back in time). |
141 | DateBookDB db; | 141 | DateBookDB db; |
142 | 142 | ||
143 | // Turn back on the screensaver | 143 | // Turn back on the screensaver |
144 | QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); | 144 | QCopEnvelope enableScreenSaver( "QPE/System", "setScreenSaverIntervals(int,int,int)" ); |
145 | enableScreenSaver << -1 << -1 << -1; | 145 | enableScreenSaver << -1 << -1 << -1; |
146 | 146 | ||
147 | // Exit app | 147 | // Exit app |
148 | qApp->quit(); | 148 | qApp->quit(); |
149 | } | 149 | } |
150 | 150 | ||
151 | void MainWindow::reject() | 151 | void MainWindow::reject() |
152 | { | 152 | { |
153 | // Reset time settings | 153 | // Reset time settings |
154 | timeTab->saveSettings( FALSE ); | 154 | timeTab->saveSettings( FALSE ); |
155 | 155 | ||
156 | // Send notifications but do not save settings | 156 | // Send notifications but do not save settings |
157 | formatTab->saveSettings( FALSE ); | 157 | formatTab->saveSettings( FALSE ); |
158 | 158 | ||
159 | // Exit app | 159 | // Exit app |
160 | qApp->quit(); | 160 | qApp->quit(); |
161 | } | 161 | } |
162 | 162 | ||
163 | void MainWindow::runNTP() | 163 | void MainWindow::runNTP() |
164 | { | 164 | { |
165 | if ( !ntpDelayElapsed() && ntpInteractive ) | 165 | if ( !ntpDelayElapsed() && ntpInteractive ) |
166 | { | 166 | { |
167 | QString msg = tr( "You asked for a delay of " ); | ||
168 | msg.append( QString::number( ntpDelay ) ); | ||
169 | msg.append( tr( " minutes, but only " ) ); | ||
170 | msg.append( QString::number( _lookupDiff / 60 ) ); | ||
171 | msg.append( tr(" minutes elapsed since last lookup.<br>Continue?") ); | ||
172 | |||
173 | 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 ) ); | 167 | 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 ) ); |
174 | 168 | ||
175 | switch ( | 169 | switch ( |
176 | QMessageBox::warning( this, tr( "Continue?" ), msg, QMessageBox::Yes, QMessageBox::No ) | 170 | QMessageBox::warning( this, tr( "Continue?" ), msg, QMessageBox::Yes, QMessageBox::No ) |
177 | ) | 171 | ) |
178 | { | 172 | { |
179 | case QMessageBox::Yes: break; | 173 | case QMessageBox::Yes: break; |
180 | case QMessageBox::No: return; | 174 | case QMessageBox::No: return; |
181 | default: return; | 175 | default: return; |
182 | } | 176 | } |
183 | } | 177 | } |
184 | 178 | ||
185 | QString srv = settingsTab->ntpServer(); | 179 | QString srv = settingsTab->ntpServer(); |
186 | 180 | ||
187 | // Send information to time server tab if enabled | 181 | // Send information to time server tab if enabled |
188 | if ( ntpTabEnabled ) | 182 | if ( ntpTabEnabled ) |
189 | { | 183 | { |
190 | ntpTab->setStartTime( QDateTime::currentDateTime().toString() ); | 184 | ntpTab->setStartTime( QDateTime::currentDateTime().toString() ); |
191 | QString output = tr( "Running:\nntpdate " ); | 185 | QString output = tr( "Running:\nntpdate " ); |
192 | output.append( srv ); | 186 | output.append( srv ); |
193 | ntpTab->addNtpOutput( output ); | 187 | ntpTab->addNtpOutput( output ); |
194 | } | 188 | } |
195 | 189 | ||
196 | if ( !ntpProcess ) | 190 | if ( !ntpProcess ) |
197 | { | 191 | { |
198 | ntpProcess = new OProcess(); | 192 | ntpProcess = new OProcess(); |
199 | connect( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), | 193 | connect( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), |
200 | this, SLOT(slotNtpOutput(OProcess*,char*,int)) ); | 194 | this, SLOT(slotNtpOutput(OProcess*,char*,int)) ); |
201 | connect( ntpProcess, SIGNAL(processExited(OProcess*)), | 195 | connect( ntpProcess, SIGNAL(processExited(OProcess*)), |
202 | this, SLOT(slotNtpFinished(OProcess*)) ); | 196 | this, SLOT(slotNtpFinished(OProcess*)) ); |
203 | } | 197 | } |
204 | 198 | ||