From 88872f9f3aa771e0beb44569fb76c061e58cb309 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 3 Nov 2017 16:46:08 +0100 Subject: [PATCH] Ref T180, setup loading dialog * UI adjustments, style sheet * use connectOnce for QFileSystemModel::directoryLoaded --- .../components/copyconfigurationcomponent.cpp | 15 +++-- .../components/setuploadingdialog.cpp | 1 + src/blackgui/components/setuploadingdialog.ui | 64 +++++++++++++------ src/blackgui/share/qss/stdwidget.qss | 14 ++++ 4 files changed, 68 insertions(+), 26 deletions(-) diff --git a/src/blackgui/components/copyconfigurationcomponent.cpp b/src/blackgui/components/copyconfigurationcomponent.cpp index 9e89e676c..5f0d14b4d 100644 --- a/src/blackgui/components/copyconfigurationcomponent.cpp +++ b/src/blackgui/components/copyconfigurationcomponent.cpp @@ -16,6 +16,7 @@ #include "blackmisc/settingscache.h" #include "blackmisc/datacache.h" #include "blackmisc/logmessage.h" +#include "blackmisc/slot.h" #include #include @@ -179,9 +180,9 @@ namespace BlackGui void CCopyConfigurationComponent::initCurrentDirectories(bool preselectMissingOrOutdated) { const QString destinationDir = this->getThisVersionDirectory(); // cache or settings dir - if (this->m_initializedDestinationDir != destinationDir) + if (m_initializedDestinationDir != destinationDir) { - this->m_initializedDestinationDir = destinationDir; + m_initializedDestinationDir = destinationDir; const QDir thisVersionDirectory(destinationDir); if (!thisVersionDirectory.exists()) { @@ -204,7 +205,9 @@ namespace BlackGui destinationModel->setNameFilters(this->getSourceFileFilter()); ui->tv_Destination->setModel(destinationModel); ui->tv_Destination->setSortingEnabled(true); - connect(destinationModel, &QFileSystemModel::directoryLoaded, this, [ = ](const QString & path) + + // disconnect when done, there have been problems that the lambda was called when the view was already destroyed + connectOnce(destinationModel, &QFileSystemModel::directoryLoaded, this, [ = ](const QString & path) { Q_UNUSED(path); ui->tv_Destination->resizeColumnToContents(0); @@ -217,9 +220,9 @@ namespace BlackGui // source const QString sourceDir = this->getOtherVersionsSelectedDirectory(); - if (this->m_initializedSourceDir != sourceDir) + if (m_initializedSourceDir != sourceDir) { - this->m_initializedSourceDir = sourceDir; + m_initializedSourceDir = sourceDir; QFileSystemModel *sourceModel = qobject_cast(ui->tv_Source->model()); if (!sourceModel) { @@ -229,7 +232,7 @@ namespace BlackGui sourceModel->setNameFilters(this->getSourceFileFilter()); ui->tv_Source->setModel(sourceModel); ui->tv_Source->setSortingEnabled(true); // hide/disable only - connect(sourceModel, &QFileSystemModel::directoryLoaded, this, [ = ](const QString & path) + connectOnce(sourceModel, &QFileSystemModel::directoryLoaded, this, [ = ](const QString & path) { Q_UNUSED(path); ui->tv_Source->resizeColumnToContents(0); diff --git a/src/blackgui/components/setuploadingdialog.cpp b/src/blackgui/components/setuploadingdialog.cpp index 69c7026a6..d993b2046 100644 --- a/src/blackgui/components/setuploadingdialog.cpp +++ b/src/blackgui/components/setuploadingdialog.cpp @@ -105,6 +105,7 @@ namespace BlackGui if (!sApp || sApp->isShuttingDown()) { return; } if (!this->hasSetupReader()) { return; } sApp->getSetupReader()->prefillCacheWithLocalResourceBootstrapFile(); + this->displaySetupCacheInfo(); } void CSetupLoadingDialog::displaySetupCacheInfo() diff --git a/src/blackgui/components/setuploadingdialog.ui b/src/blackgui/components/setuploadingdialog.ui index 940d712c6..fa986ba36 100644 --- a/src/blackgui/components/setuploadingdialog.ui +++ b/src/blackgui/components/setuploadingdialog.ui @@ -36,7 +36,10 @@ 6 - + + + Setup and caches + 6 @@ -49,18 +52,14 @@ + + Timestamp of the setup cache. + true - - - - load from disk - - - @@ -70,6 +69,9 @@ + + <html><head/><body><p>The mode, implicit means no URL is provided and the value is obtained from an existing setup.</p></body></html> + true @@ -77,6 +79,9 @@ + + The command line. + true @@ -101,6 +106,9 @@ + + <html><head/><body><p>The bootstrap URL provided by command line options. This is where the setup data are loaded from.</p></body></html> + true @@ -133,23 +141,39 @@ + + + + load from disk + + + - - - - 0 - 0 - - - - - 0 - 200 - + + + Log messages + + + + + + 0 + 0 + + + + + 0 + 200 + + + + + diff --git a/src/blackgui/share/qss/stdwidget.qss b/src/blackgui/share/qss/stdwidget.qss index bd94234d5..4ca825dc3 100644 --- a/src/blackgui/share/qss/stdwidget.qss +++ b/src/blackgui/share/qss/stdwidget.qss @@ -77,6 +77,20 @@ BlackGui--Components--CCopyConfigurationComponent { } */ +/* setup load dialog */ +BlackGui--Components--CSetupLoadingDialog { + background: black; /* background is background color here */ + background-image: url(:/textures/icons/textures/texture-inner.jpg); +} + +/* setup load dialog details frame */ +/* +BlackGui--Components--CSetupLoadingDialog #fr_Details { + background-image: url(:/textures/icons/textures/texture-outer.jpg); + background-color: darkslategray; +} +*/ + QFileDialog #sidebar { background: black; }