Mercurial > trustbridge
comparison ui/mainwindow.cpp @ 1061:db831a204a6b
(issue38) Show error message as messagebox if the window is visible
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 10 Sep 2014 11:05:34 +0200 |
parents | c7db2cc97bad |
children | 51b97ebc5b06 |
comparison
equal
deleted
inserted
replaced
1060:317ee9dc4684 | 1061:db831a204a6b |
---|---|
473 | 473 |
474 void MainWindow::downloaderError(const QString &message, SSLConnection::ErrorCode error) | 474 void MainWindow::downloaderError(const QString &message, SSLConnection::ErrorCode error) |
475 { | 475 { |
476 /* TODO logging and handle error according to a plan */ | 476 /* TODO logging and handle error according to a plan */ |
477 syslog_error_printf ("Failed to check for updates: %s", message.toUtf8().constData()); | 477 syslog_error_printf ("Failed to check for updates: %s", message.toUtf8().constData()); |
478 mCurMessage = message; | 478 if (!isVisible()) { |
479 mTrayIcon->show(); | 479 mCurMessage = message; |
480 showMessage(); | 480 mTrayIcon->show(); |
481 showMessage(); | |
482 } else { | |
483 showErrorMessage(tr("Failed to check for updates:") + "\n" + message); | |
484 } | |
481 setState(TransferError); | 485 setState(TransferError); |
482 } | 486 } |
483 | 487 |
484 void MainWindow::createActions() | 488 void MainWindow::createActions() |
485 { | 489 { |
1463 QDesktopServices::openUrl(QUrl(fiHelp.absoluteFilePath())); | 1467 QDesktopServices::openUrl(QUrl(fiHelp.absoluteFilePath())); |
1464 #endif | 1468 #endif |
1465 free (inst_dir); | 1469 free (inst_dir); |
1466 return; | 1470 return; |
1467 } | 1471 } |
1472 | |
1473 void MainWindow::showErrorMessage(const QString &msg) | |
1474 { | |
1475 QMessageBox::warning(this, tr("TrustBridge error"), msg); | |
1476 } |