mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Show error messages during start up as soon as the main window is shown
When the user has setup cloud storage as their default file but didn't store the cloud storage password an error is created but not shown until another error happens - that's very confusing for the user. This patch fixes that. Fixes #938 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
05f4f9b533
commit
d567859e87
3 changed files with 9 additions and 1 deletions
4
main.cpp
4
main.cpp
|
@ -69,11 +69,13 @@ int main(int argc, char **argv)
|
|||
files.push_back(cloudURL);
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow *m = MainWindow::instance();
|
||||
m->setLoadedWithFiles(!files.isEmpty() || !importedFiles.isEmpty());
|
||||
m->loadFiles(files);
|
||||
m->importFiles(importedFiles);
|
||||
// in case something has gone wrong make sure we show the error message
|
||||
m->showError();
|
||||
|
||||
if (verbose > 0)
|
||||
print_files();
|
||||
if (!quit)
|
||||
|
|
|
@ -1511,6 +1511,11 @@ NotificationWidget *MainWindow::getNotificationWidget()
|
|||
return ui.mainErrorMessage;
|
||||
}
|
||||
|
||||
void MainWindow::showError()
|
||||
{
|
||||
getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error);
|
||||
}
|
||||
|
||||
QString MainWindow::displayedFilename(QString fullFilename)
|
||||
{
|
||||
QFile f(fullFilename);
|
||||
|
|
|
@ -98,6 +98,7 @@ public:
|
|||
QUndoStack *undoStack;
|
||||
NotificationWidget *getNotificationWidget();
|
||||
void enableDisableCloudActions();
|
||||
void showError();
|
||||
private
|
||||
slots:
|
||||
/* file menu action */
|
||||
|
|
Loading…
Reference in a new issue