diff options
author | Ken Moore <ken@ixsystems.com> | 2016-10-20 12:05:22 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2016-10-20 12:05:22 -0400 |
commit | 36df3d58e25beb06f16fdf821f18fe8a4bcce2ae (patch) | |
tree | 137dfbf9c48f0eba2f4a58d0f3d22f7e870f0c2a /src-qt5/desktop-utils/lumina-fm/MainUI.cpp | |
parent | Make sure all the translation files are synced to the sources. (diff) | |
download | lumina-36df3d58e25beb06f16fdf821f18fe8a4bcce2ae.tar.gz lumina-36df3d58e25beb06f16fdf821f18fe8a4bcce2ae.tar.bz2 lumina-36df3d58e25beb06f16fdf821f18fe8a4bcce2ae.zip |
Finish up the last couple buttons/actions related to the new Tray UI.
1) If closing the main window while an operation is running, hide it instead until the file operation is finished - then close.
2) Fix the icon on the show errors button
3) Hook up the show errors button to show a scroll dialog with the errors.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm/MainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/MainUI.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp index 02533271..128c4cd5 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp @@ -20,7 +20,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ //just to silence/fix some Qt connect warnings in QtConcurrent //qRegisterMetaType< QVector<int> >("QVector<int>"); //qRegisterMetaType< QList<QPersistentModelIndex> >("QList<QPersistentModelIndex>"); - + waitingToClose = false; ui->setupUi(this); ui->menuGit->setVisible( GIT::isAvailable() ); @@ -106,6 +106,7 @@ QSize orig = settings->value("preferences/MainWindowSize", QSize()).toSize(); RebuildDeviceMenu(); //Make sure we start on the browser page TRAY = new TrayUI(this); + connect(TRAY, SIGNAL(JobsFinished()), this, SLOT(TrayJobsFinished()) ); if(DEBUG){ qDebug() << " - Done with init"; } } @@ -187,7 +188,7 @@ void MainUI::OpenDirs(QStringList dirs){ //Double check that there is at least 1 dir loaded //qDebug() << "OpenDirs:" << DWLIST.length() << dirs << invalid << tabBar->currentIndex(); if(DWLIST.isEmpty()){ OpenDirs(QStringList()); } - + waitingToClose = false; } void MainUI::setupIcons(){ @@ -944,3 +945,23 @@ void MainUI::TabNameChanged(QString id, QString name){ } } } + +void MainUI::TrayJobsFinished(){ + if(waitingToClose){ this->close(); } +} + +//============= +// PROTECTED +//============= +void MainUI::closeEvent(QCloseEvent *ev){ + //See if the tray is active or not first + if(TRAY!=0){ + if(TRAY->isVisible() && !waitingToClose){ + this->hide(); + ev->ignore(); + waitingToClose = true; + return; + } + } + QMainWindow::closeEvent(ev); //continue normal close routine +} |