From d2ca97846d74e58ebae55d698b0079c7361e0f31 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 20 Nov 2018 03:07:25 +0100 Subject: [PATCH] Allow to reload other swift versions UI --- .../copymodelsfromotherswiftversionscomponent.cpp | 2 +- .../components/otherswiftversionscomponent.cpp | 11 +++++++++++ src/blackgui/components/otherswiftversionscomponent.h | 3 +++ src/blackgui/views/applicationinfoview.cpp | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp index 8db411774..57ccc8daa 100644 --- a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp +++ b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp @@ -117,7 +117,7 @@ namespace BlackGui if (sets > 0 || caches > 0) { const CStatusMessage m = CStatusMessage(this).validationInfo("Copied %1 sets and %2 caches for '%3'") << sets << caches << selectedSimulators.toQString(true); - this->showOverlayMessage(m); + this->showOverlayHTMLMessage(m, 7500); } } diff --git a/src/blackgui/components/otherswiftversionscomponent.cpp b/src/blackgui/components/otherswiftversionscomponent.cpp index 7b0b85773..7df9080ae 100644 --- a/src/blackgui/components/otherswiftversionscomponent.cpp +++ b/src/blackgui/components/otherswiftversionscomponent.cpp @@ -26,11 +26,17 @@ namespace BlackGui ui(new Ui::COtherSwiftVersionsComponent) { ui->setupUi(this); + + ui->tvp_ApplicationInfo->menuRemoveItems(CApplicationInfoView::MenuClear); + ui->tvp_ApplicationInfo->menuAddItems(CApplicationInfoView::MenuRefresh); + ui->tvp_ApplicationInfo->otherSwiftVersionsFromDataDirectories(); ui->le_ThisVersion->setText(sGui->getApplicationInfo().asOtherSwiftVersionString()); ui->le_ThisVersion->home(false); + connect(ui->tb_DataDir, &QToolButton::clicked, this, &COtherSwiftVersionsComponent::openDataDirectory); connect(ui->tvp_ApplicationInfo, &CApplicationInfoView::objectSelected, this, &COtherSwiftVersionsComponent::onObjectSelected); + connect(ui->tvp_ApplicationInfo, &CApplicationInfoView::requestUpdate, this, &COtherSwiftVersionsComponent::reloadVersions); } COtherSwiftVersionsComponent::~COtherSwiftVersionsComponent() @@ -47,6 +53,11 @@ namespace BlackGui return ui->tvp_ApplicationInfo->selectedObject(); } + void COtherSwiftVersionsComponent::reloadVersions() + { + ui->tvp_ApplicationInfo->otherSwiftVersionsFromDataDirectories(); + } + void COtherSwiftVersionsComponent::openDataDirectory() { const QString dir = CDirectoryUtils::applicationDataDirectory(); diff --git a/src/blackgui/components/otherswiftversionscomponent.h b/src/blackgui/components/otherswiftversionscomponent.h index a70dc94e0..695c58834 100644 --- a/src/blackgui/components/otherswiftversionscomponent.h +++ b/src/blackgui/components/otherswiftversionscomponent.h @@ -48,6 +48,9 @@ namespace BlackGui private: QScopedPointer ui; + //! Reload versions + void reloadVersions(); + //! Data directory void openDataDirectory(); diff --git a/src/blackgui/views/applicationinfoview.cpp b/src/blackgui/views/applicationinfoview.cpp index 8e6c8c26a..1ce0f05ae 100644 --- a/src/blackgui/views/applicationinfoview.cpp +++ b/src/blackgui/views/applicationinfoview.cpp @@ -25,7 +25,7 @@ namespace BlackGui { const CApplicationInfoList others = CApplicationInfoList::fromOtherSwiftVersionsFromDataDirectories(); this->updateContainer(others); - m_acceptRowSelection = others.size() > 0; + m_acceptRowSelection = (others.size() > 0); return others.size(); } } // namespace