diff --git a/src/blackgui/CMakeLists.txt b/src/blackgui/CMakeLists.txt index 0288753ca..3544c3360 100644 --- a/src/blackgui/CMakeLists.txt +++ b/src/blackgui/CMakeLists.txt @@ -341,7 +341,6 @@ add_library(gui SHARED components/loginoverviewcomponent.h components/updateinfodialog.ui components/aircraftpartshistory.ui - components/copyconfigurationdialog.ui components/autopublishdialog.ui components/logincomponent.h components/audionotificationcomponent.ui @@ -358,7 +357,6 @@ add_library(gui SHARED components/autopublishcomponent.h components/audioadvanceddistributeddialog.ui components/settingsadvancedcomponent.h - components/copyconfigurationcomponent.h components/airportdialog.h components/settingsmatchingdialog.cpp components/modelmatcherlogcomponent.h @@ -693,7 +691,6 @@ add_library(gui SHARED components/logindialog.ui components/cockpitcomcomponent.cpp components/logcomponent.cpp - components/copyconfigurationdialog.cpp components/configurationwizard.cpp components/downloadcomponent.ui components/dbquickmappingwizard.cpp @@ -725,7 +722,6 @@ add_library(gui SHARED components/interpolationlogdisplaydialog.ui components/installxswiftbusdialog.h components/settingssimulatorbasicscomponent.ui - components/copyconfigurationdialog.h components/scalescreenfactor.cpp components/downloadcomponent.h components/audioadvanceddistributeddialog.cpp @@ -774,7 +770,6 @@ add_library(gui SHARED components/loginadvcomponent.ui components/datasettingscomponent.ui components/cockpitcomtransmissioncomponent.cpp - components/copyconfigurationcomponent.cpp components/firstmodelsetcomponent.ui components/settingsnetworkcomponent.ui components/cgsourceselector.cpp @@ -794,7 +789,6 @@ add_library(gui SHARED components/datainfoareacomponent.h components/dbownmodelscomponent.cpp components/marginsinput.h - components/copyconfigurationcomponent.ui components/registercomponent.cpp components/statusmessageform.cpp components/settingsxswiftbuscomponent.h diff --git a/src/blackgui/components/copyconfigurationcomponent.cpp b/src/blackgui/components/copyconfigurationcomponent.cpp deleted file mode 100644 index 8c519fa68..000000000 --- a/src/blackgui/components/copyconfigurationcomponent.cpp +++ /dev/null @@ -1,461 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "ui_copyconfigurationcomponent.h" -#include "copyconfigurationcomponent.h" -#include "blackgui/components/configurationwizard.h" -#include "blackcore/data/globalsetup.h" -#include "blackgui/guiapplication.h" -#include "blackconfig/buildconfig.h" -#include "blackmisc/swiftdirectories.h" -#include "blackmisc/directoryutils.h" -#include "blackmisc/settingscache.h" -#include "blackmisc/datacache.h" -#include "blackmisc/logmessage.h" -#include "blackmisc/slot.h" - -#include -#include -#include -#include -#include -#include - -using namespace BlackMisc; -using namespace BlackMisc::Simulation; -using namespace BlackMisc::Simulation::Data; -using namespace BlackConfig; -using namespace BlackGui; -using namespace BlackCore; -using namespace BlackCore::Data; - -namespace BlackGui::Components -{ - const QStringList &CCopyConfigurationComponent::getLogCategories() - { - static const QStringList cats { CLogCategories::guiComponent() }; - return cats; - } - - CCopyConfigurationComponent::CCopyConfigurationComponent(QWidget *parent) : QFrame(parent), - ui(new Ui::CCopyConfigurationComponent) - { - ui->setupUi(this); - this->initOtherSwiftVersions(); - this->setWidths(); - m_hasOtherSwiftVersions = CApplicationInfoList::hasOtherSwiftDataDirectories(); - - ui->cb_ShowAll->setChecked(m_nameFilterDisables); - connect(ui->rb_Cache, &QRadioButton::toggled, [=](bool) { this->initCurrentDirectories(true); }); - connect(ui->cb_OtherVersions, &QComboBox::currentTextChanged, [=] { this->initCurrentDirectories(true); }); - connect(ui->pb_SelectAll, &QPushButton::clicked, ui->tv_Source, &QTreeView::selectAll); - connect(ui->pb_ClearSelection, &QPushButton::clicked, ui->tv_Source, &QTreeView::clearSelection); - connect(ui->pb_CopyOver, &QPushButton::clicked, this, &CCopyConfigurationComponent::copySelectedFiles); - connect(ui->cb_ShowAll, &QCheckBox::released, this, &CCopyConfigurationComponent::changeNameFilterDisables); - connect(ui->tb_OpenOtherVersionsDir, &QToolButton::clicked, this, &CCopyConfigurationComponent::openOtherVersionsSelectedDirectory); - connect(ui->tb_OpenThisVersionDir, &QToolButton::clicked, this, &CCopyConfigurationComponent::openOtherVersionsSelectedDirectory); - - // create default caches with timestamps on disk - // possible for small caches, but not the large model sets (too slow) - m_modelSetCurrentSimulator.synchronize(); - m_modelSetCurrentSimulator.set(m_modelSetCurrentSimulator.get()); - m_modelsCurrentSimulator.synchronize(); - m_modelsCurrentSimulator.set(m_modelsCurrentSimulator.get()); - m_launcherSetup.synchronize(); - m_launcherSetup.set(m_launcherSetup.get()); - m_vatsimSetup.synchronize(); - m_vatsimSetup.set(m_vatsimSetup.get()); - } - - CCopyConfigurationComponent::~CCopyConfigurationComponent() - {} - - void CCopyConfigurationComponent::setCacheMode() - { - ui->rb_Cache->setChecked(true); - } - - void CCopyConfigurationComponent::setSettingsMode() - { - ui->rb_Settings->setChecked(true); - } - - int CCopyConfigurationComponent::copySelectedFiles() - { - const QStringList files = this->getSelectedFiles(); - if (files.isEmpty()) { return 0; } - - const QString destinationDir = this->getThisVersionDirectory(); - const QString sourceDir = this->getOtherVersionsSelectedDirectory(); - if (destinationDir.isEmpty()) { return 0; } - const QDir source(sourceDir); - const QDir destination(destinationDir); - if (!destination.exists()) { return 0; } - - // init model caches if applicable (.rev file entries) - this->initCaches(files); - - int c = 0; - QStringList copied; - QStringList skipped; - for (const QString &file : files) - { - const QString relativePath = source.relativeFilePath(file); - const QString target = CFileUtils::appendFilePaths(destinationDir, relativePath); - if (relativePath.contains('/')) - { - const QString targetDir = CFileUtils::stripFileFromPath(target); - const bool dirOk = destination.mkpath(targetDir); - if (!dirOk) { continue; } - } - QFile::remove(target); // copy does not overwrite - const bool s = QFile::copy(file, target); - if (s) - { - c++; - copied << target; - } - else - { - skipped << target; - } - } - - if (m_logCopiedFiles) - { - if (!copied.isEmpty()) - { - CLogMessage(this).info(u"Copied %1 files, list: '%2'") << copied.size() << copied.join(", "); - } - if (!skipped.isEmpty()) - { - CLogMessage(this).info(u"Skipped %1 files, list: '%2'") << skipped.size() << skipped.join(", "); - } - } - - // bye - return c; - } - - void CCopyConfigurationComponent::preselectMissingOrOutdated() - { - const QString dirOther = this->getOtherVersionsSelectedDirectory(); - const QString dirCurrent = this->getThisVersionDirectory(); - - ui->tv_Source->clearSelection(); - ui->tv_Destination->clearSelection(); - - const CDirectoryUtils::DirComparison comp = CDirectoryUtils::compareTwoDirectories(dirOther, dirCurrent, true); - const QFileSystemModel *sourceModel = qobject_cast(ui->tv_Source->model()); - if (!sourceModel) { return; } - - QStringList select = comp.missingInTarget.values(); - select.append(comp.newerInSource.values()); - for (const QString &file : std::as_const(comp.missingInTarget)) - { - const QModelIndex index = sourceModel->index(file); - if (!index.isValid()) continue; - ui->tv_Source->setCurrentIndex(index); - } - } - - const QStringList &CCopyConfigurationComponent::getSourceFileFilter() - { - if (ui->rb_Cache->isChecked()) - { - // only copy setup and model caches - static const QStringList cacheFilter = [=] { - QStringList cf({ m_modelSetCurrentSimulator.getFilename(), - m_modelsCurrentSimulator.getFilename(), - m_launcherSetup.getFilename(), - m_vatsimSetup.getFilename(), - m_lastVatsimServer.getFilename(), - m_lastServer.getFilename(), - m_lastAircraftModel.getFilename() }); - cf.append(m_modelSetCaches.getAllFilenames()); - cf.append(m_modelCaches.getAllFilenames()); - return CFileUtils::getFileNamesOnly(cf); - }(); - if (!m_withBootstrapFile) { return cacheFilter; } - - static const QStringList cacheFilterBs = [=] { - QStringList f(cacheFilter); - f.push_back(CSwiftDirectories::bootstrapFileName()); - return f; - }(); - return cacheFilterBs; - } - else - { - static const QStringList settingsFilter({ "*.json" }); - return settingsFilter; - } - } - - void CCopyConfigurationComponent::initCurrentDirectories(bool preselectMissingOrOutdated) - { - const QString destinationDir = this->getThisVersionDirectory(); // cache or settings dir - - QFileSystemModel *destinationModel = qobject_cast(ui->tv_Destination->model()); - QFileSystemModel *sourceModel = qobject_cast(ui->tv_Source->model()); - - if (!destinationModel || m_initializedDestinationDir != destinationDir) - { - m_initializedDestinationDir = destinationDir; - const QDir thisVersionDirectory(destinationDir); - if (!thisVersionDirectory.exists()) - { - const bool hasDir = thisVersionDirectory.mkpath(destinationDir); - if (!hasDir) - { - ui->le_CurrentVersion->setText("No swift target dir"); - return; - } - } - ui->le_CurrentVersion->setText(destinationDir); - - // destination - if (!destinationModel) - { - destinationModel = new QFileSystemModel(this); - destinationModel->setFilter(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs); - ui->tv_Destination->setModel(destinationModel); - ui->tv_Destination->setSortingEnabled(true); - - // 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); - ui->tv_Destination->expandAll(); - }); - } - const QModelIndex destinationIndex = destinationModel->setRootPath(destinationDir); - ui->tv_Destination->setRootIndex(destinationIndex); - } - destinationModel->setNameFilters(this->getSourceFileFilter()); - destinationModel->setNameFilterDisables(m_nameFilterDisables); - - // source - const QString sourceDir = this->getOtherVersionsSelectedDirectory(); - if (!m_hasOtherSwiftVersions) - { - // no ther versions - return; - } - else if (!sourceModel || m_initializedSourceDir != sourceDir) - { - m_initializedSourceDir = sourceDir; - if (!sourceModel) - { - sourceModel = new QFileSystemModel(this); - sourceModel->setFilter(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs); - ui->tv_Source->setModel(sourceModel); - ui->tv_Source->setSortingEnabled(true); // hide/disable only - connectOnce(sourceModel, &QFileSystemModel::directoryLoaded, this, [=](const QString &path) { - Q_UNUSED(path); - ui->tv_Source->resizeColumnToContents(0); - ui->tv_Source->expandAll(); - if (preselectMissingOrOutdated) - { - this->preselectMissingOrOutdated(); - } - }); - } - const QModelIndex sourceIndex = sourceModel->setRootPath(sourceDir); - ui->tv_Source->setRootIndex(sourceIndex); - } - sourceModel->setNameFilters(this->getSourceFileFilter()); - sourceModel->setNameFilterDisables(m_nameFilterDisables); - } - - bool CCopyConfigurationComponent::hasOtherVersionData() const - { - return !m_otherVersionDirs.isEmpty(); - } - - void CCopyConfigurationComponent::allowToggleCacheSettings(bool allow) - { - ui->rb_Cache->setEnabled(allow); - ui->rb_Settings->setEnabled(allow); - } - - void CCopyConfigurationComponent::selectAll() - { - ui->tv_Source->selectAll(); - } - - void CCopyConfigurationComponent::setNameFilterDisables(bool disable) - { - if (m_nameFilterDisables == disable) { return; } - m_nameFilterDisables = disable; - this->initCurrentDirectories(true); - } - - void CCopyConfigurationComponent::resizeEvent(QResizeEvent *event) - { - this->setWidths(); - QFrame::resizeEvent(event); - } - - void CCopyConfigurationComponent::currentVersionChanged(const QString &text) - { - Q_UNUSED(text); - this->initCurrentDirectories(); - } - - const QString &CCopyConfigurationComponent::getThisVersionDirectory() const - { - return ui->rb_Cache->isChecked() ? CDataCache::persistentStore() : CSettingsCache::persistentStore(); - } - - QString CCopyConfigurationComponent::getOtherVersionsSelectedDirectory() const - { - if (ui->cb_OtherVersions->count() < 1) { return {}; } - const QFileInfoList dirs(CSwiftDirectories::applicationDataDirectories()); - if (dirs.isEmpty()) { return {}; } - const QString otherVersionDir = m_otherVersionDirs.at(ui->cb_OtherVersions->currentIndex()); - QString dir; - for (const QFileInfo &info : dirs) - { - if (info.absoluteFilePath().contains(otherVersionDir)) - { - dir = info.absoluteFilePath(); - break; - } - } - if (dir.isEmpty()) { return {}; } - dir = CFileUtils::appendFilePaths(dir, ui->rb_Cache->isChecked() ? - CDataCache::relativeFilePath() : - CSettingsCache::relativeFilePath()); - return dir; - } - - void CCopyConfigurationComponent::openOtherVersionsSelectedDirectory() - { - const QObject *s = sender(); - const QString d = (s == ui->tb_OpenOtherVersionsDir) ? - this->getOtherVersionsSelectedDirectory() : - this->getThisVersionDirectory(); - if (d.isEmpty()) { return; } - QDir dir(d); - if (!dir.exists()) { return; } - const QUrl url = QUrl::fromLocalFile(dir.path()); - QDesktopServices::openUrl(url); - } - - QStringList CCopyConfigurationComponent::getSelectedFiles() const - { - if (!m_hasOtherSwiftVersions) { return QStringList(); } - const QModelIndexList indexes = ui->tv_Source->selectionModel()->selectedIndexes(); - if (indexes.isEmpty()) { return QStringList(); } - const QFileSystemModel *sourceModel = qobject_cast(ui->tv_Source->model()); - - QStringList files; - for (const QModelIndex &index : indexes) - { - if (!index.isValid()) continue; - const QString file = sourceModel->filePath(index); - if (!files.contains(file)) - { - files.push_back(file); - } - } - return files; - } - - void CCopyConfigurationComponent::initCaches(const QStringList &files) - { - if (files.isEmpty()) { return; } - if (!ui->rb_Cache->isChecked()) { return; } - for (const QString &file : files) - { - if (file.contains("modelset", Qt::CaseInsensitive)) - { - this->initMultiSimulatorCache(&m_modelSetCaches, file); - } - else if (file.contains("modelcache", Qt::CaseInsensitive)) - { - this->initMultiSimulatorCache(&m_modelCaches, file); - } - } - - // allow the cache files to be generated before we will override them - CGuiApplication::processEventsFor(2500); - } - - void CCopyConfigurationComponent::initMultiSimulatorCache(IMultiSimulatorModelCaches *cache, const QString &fileName) - { - const CSimulatorInfo info = cache->getSimulatorForFilename(fileName); - if (info.isNoSimulator()) { return; } - if (cache->isSaved(info)) { return; } // already a file and hence in .rev - const QFileInfo fi(fileName); - const CStatusMessage msg = cache->setCacheTimestamp(fi.lastModified(), info); // create cache file and timestamp in .rev - if (msg.isFailure()) - { - CLogMessage(this).preformatted(msg); - } - } - - void CCopyConfigurationComponent::initOtherSwiftVersions() - { - ui->cb_OtherVersions->clear(); - const QMap otherVersions = CApplicationInfoList::currentApplicationDataDirectoryMapWithoutCurrentVersion(); - for (const auto [dir, info] : makePairsRange(otherVersions)) - { - if (info.isNull()) - { - const QString infoString = CDirectoryUtils::decodeNormalizedDirectory(dir); - ui->cb_OtherVersions->addItem(infoString); - } - else - { - ui->cb_OtherVersions->addItem(QStringLiteral("swift %1 (%2)").arg(info.getVersionString(), info.getPlatform())); - } - m_otherVersionDirs.push_back(dir); - } - } - - void CCopyConfigurationComponent::changeNameFilterDisables() - { - this->setNameFilterDisables(ui->cb_ShowAll->isChecked()); - } - - void CCopyConfigurationComponent::setWidths() - { - const int w = this->width(); - const int wCb = qRound(0.45 * w); - const int wView = qRound(0.4 * w); - ui->cb_OtherVersions->setMaximumWidth(wCb); - ui->tv_Destination->setMinimumWidth(wView); - ui->tv_Source->setMinimumWidth(wView); - } - - const QStringList &CCopyConfigurationWizardPage::getLogCategories() - { - static const QStringList cats { CLogCategories::wizard(), CLogCategories::guiComponent() }; - return cats; - } - - void CCopyConfigurationWizardPage::initializePage() - { - Q_ASSERT_X(m_config, Q_FUNC_INFO, "Missing config"); - const QString name = m_config->objectName().toLower(); - if (name.contains("setting", Qt::CaseInsensitive)) - { - m_config->setSettingsMode(); - } - else - { - m_config->setCacheMode(); - } - m_config->allowToggleCacheSettings(false); - m_config->initCurrentDirectories(true); - } - - bool CCopyConfigurationWizardPage::validatePage() - { - if (CConfigurationWizard::lastWizardStepSkipped(this->wizard())) { return true; } - m_config->copySelectedFiles(); - return true; - } -} // ns diff --git a/src/blackgui/components/copyconfigurationcomponent.h b/src/blackgui/components/copyconfigurationcomponent.h deleted file mode 100644 index 9dc84d001..000000000 --- a/src/blackgui/components/copyconfigurationcomponent.h +++ /dev/null @@ -1,167 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef BLACKGUI_COMPONENTS_COPYCONFIGURATION_H -#define BLACKGUI_COMPONENTS_COPYCONFIGURATION_H - -#include "blackgui/blackguiexport.h" -#include "blackcore/data/launchersetup.h" -#include "blackcore/data/vatsimsetup.h" -#include "blackmisc/simulation/data/modelcaches.h" -#include "blackmisc/simulation/data/lastmodel.h" -#include "blackmisc/network/data/lastserver.h" -#include -#include -#include - -namespace Ui -{ - class CCopyConfigurationComponent; -} -namespace BlackGui::Components -{ - //! Copy configuration (i.e. settings and cache files) - //! \deprecated replaced by CCopySettingsAndCachesComponent - class BLACKGUI_EXPORT CCopyConfigurationComponent : public QFrame - { - Q_OBJECT - - public: - //! Log.categories - static const QStringList &getLogCategories(); - - //! Constructor - explicit CCopyConfigurationComponent(QWidget *parent = nullptr); - - //! Destructor - virtual ~CCopyConfigurationComponent() override; - - //! Cache mode - void setCacheMode(); - - //! Settings mode - void setSettingsMode(); - - //! Selected files are copied - int copySelectedFiles(); - - //! Init file content - void initCurrentDirectories(bool preselectMissingOrOutdated = false); - - //! Are there other versions to copy from? - bool hasOtherVersionData() const; - - //! Allow to toggle cache and settings - void allowToggleCacheSettings(bool allow); - - //! Log copied files - void logCopiedFiles(bool log) { m_logCopiedFiles = log; } - - //! Select all - void selectAll(); - - //! \copydoc QFileSystemModel::setNameFilterDisables - void setNameFilterDisables(bool disable); - - //! Show bootstrap file? - void setWithBootstrapFile(bool withBootstrapFile) { m_withBootstrapFile = withBootstrapFile; } - - protected: - //! \copydoc QWidget::resizeEvent - virtual void resizeEvent(QResizeEvent *event) override; - - private: - //! Preselect newer files - void preselectMissingOrOutdated(); - - //! Filter out items from preselection - //! \remark formally newer files are preselected - bool preselectActiveFiles(const QString &file) const; - - //! Source file filter - const QStringList &getSourceFileFilter(); - - //! The current version changed - void currentVersionChanged(const QString &text); - - //! This version's directory (cache or setting) - const QString &getThisVersionDirectory() const; - - //! Get the selected directory - QString getOtherVersionsSelectedDirectory() const; - - //! Other the directory of that other version - void openOtherVersionsSelectedDirectory(); - - //! Get the selected files - QStringList getSelectedFiles() const; - - //! Init caches if required (create .rev entries with high level functions) - void initCaches(const QStringList &files); - - //! Init a multi simulator cache (modelset/models) - void initMultiSimulatorCache(BlackMisc::Simulation::Data::IMultiSimulatorModelCaches *cache, const QString &fileName); - - //! Init the other swift versions - void initOtherSwiftVersions(); - - //! Set name filter disables from ui - void changeNameFilterDisables(); - - //! Set widths - void setWidths(); - - QScopedPointer ui; - QStringList m_otherVersionDirs; - QString m_initializedSourceDir; - QString m_initializedDestinationDir; - bool m_logCopiedFiles = true; - bool m_nameFilterDisables = false; //!< name filter disables or hides - bool m_withBootstrapFile = false; - bool m_hasOtherSwiftVersions = false; - - // caches will be explicitly initialized in initCaches - BlackMisc::Simulation::Data::CModelCaches m_modelCaches { false, this }; - BlackMisc::Simulation::Data::CModelSetCaches m_modelSetCaches { false, this }; - - // caches will be initialized so they can be overriden - // those caches do not harm if they exists default initialized - //! \fixme this is a workaround, as it creates files on disk even if those are not copied. It was much nicer if the cache would init themself if the file appears - BlackMisc::CData m_lastServer { this }; //!< recently used server (VATSIM, other) - BlackMisc::CData m_modelSetCurrentSimulator { this }; - BlackMisc::CData m_modelsCurrentSimulator { this }; - BlackMisc::CData m_lastAircraftModel { this }; //!< recently used aircraft model - BlackMisc::CData m_launcherSetup { this }; - BlackMisc::CData m_vatsimSetup { this }; - BlackMisc::CData m_lastVatsimServer { this }; //!< recently used VATSIM server - }; - - /*! - * Wizard page for CCopyConfigurationComponent - */ - class CCopyConfigurationWizardPage : public QWizardPage - { - public: - //! Constructors - using QWizardPage::QWizardPage; - - //! Log.categories - static const QStringList &getLogCategories(); - - //! Set config - void setConfigComponent(CCopyConfigurationComponent *config) { m_config = config; } - - //! \copydoc QWizardPage::initializePage - virtual void initializePage() override; - - //! \copydoc QWizardPage::validatePage - virtual bool validatePage() override; - - private: - CCopyConfigurationComponent *m_config = nullptr; - }; -} // ns - -#endif // guard diff --git a/src/blackgui/components/copyconfigurationcomponent.ui b/src/blackgui/components/copyconfigurationcomponent.ui deleted file mode 100644 index bfb4f1b6f..000000000 --- a/src/blackgui/components/copyconfigurationcomponent.ui +++ /dev/null @@ -1,274 +0,0 @@ - - - CCopyConfigurationComponent - - - - 0 - 0 - 640 - 480 - - - - Frame - - - QFrame::Plain - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - - - 0 - - - 0 - - - - - Settings - - - true - - - - - - - Cache - - - - - - - select all - - - - - - - clear selection - - - - - - - copy over - - - - - - - show all - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Source (other versions) - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - false - - - - - - - open this directory - - - ... - - - - - - - - - - true - - - QAbstractItemView::MultiSelection - - - true - - - true - - - - - - - - - - Destination (this version) - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - true - - - - - - - ... - - - - - - - - - - true - - - QAbstractItemView::NoSelection - - - true - - - true - - - - - - - - - - - - - - diff --git a/src/blackgui/components/copyconfigurationdialog.cpp b/src/blackgui/components/copyconfigurationdialog.cpp deleted file mode 100644 index 3a0bd93fd..000000000 --- a/src/blackgui/components/copyconfigurationdialog.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -#include "copyconfigurationdialog.h" -#include "ui_copyconfigurationdialog.h" -#include "blackgui/guiapplication.h" - -namespace BlackGui::Components -{ - CCopyConfigurationDialog::CCopyConfigurationDialog(QWidget *parent) : QDialog(parent), - ui(new Ui::CCopyConfigurationDialog) - { - ui->setupUi(this); - this->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - } - - CCopyConfigurationDialog::~CCopyConfigurationDialog() - {} - - void CCopyConfigurationDialog::setCacheMode() - { - ui->comp_CopyConfiguration->setCacheMode(); - } - - void CCopyConfigurationDialog::setSettingsMode() - { - ui->comp_CopyConfiguration->setSettingsMode(); - } - - void CCopyConfigurationDialog::selectAll() - { - ui->comp_CopyConfiguration->selectAll(); - } - - void CCopyConfigurationDialog::setNameFilterDisables(bool disable) - { - ui->comp_CopyConfiguration->setNameFilterDisables(disable); - } - - bool CCopyConfigurationDialog::event(QEvent *event) - { - if (CGuiApplication::triggerShowHelp(this, event)) { return true; } - return QDialog::event(event); - } -} // ns diff --git a/src/blackgui/components/copyconfigurationdialog.h b/src/blackgui/components/copyconfigurationdialog.h deleted file mode 100644 index c7a1dd973..000000000 --- a/src/blackgui/components/copyconfigurationdialog.h +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef BLACKGUI_COMPONENTS_COPYCONFIGURATIONDIALOG_H -#define BLACKGUI_COMPONENTS_COPYCONFIGURATIONDIALOG_H - -#include "blackgui/blackguiexport.h" -#include -#include - -namespace Ui -{ - class CCopyConfigurationDialog; -} -namespace BlackGui::Components -{ - //! Dialog to copy cache and settings - //! \deprecated replaced by CCopySettingsAndCachesComponent - class BLACKGUI_EXPORT CCopyConfigurationDialog : public QDialog - { - Q_OBJECT - - public: - //! Constructor - explicit CCopyConfigurationDialog(QWidget *parent = nullptr); - - //! Destructor - virtual ~CCopyConfigurationDialog() override; - - //! For cache data - void setCacheMode(); - - //! For settings - void setSettingsMode(); - - //! Select all settings or caches - void selectAll(); - - //! \copydoc QFileSystemModel::setNameFilterDisables - void setNameFilterDisables(bool disable); - - protected: - //! \copydoc QObject::event - virtual bool event(QEvent *event) override; - - private: - QScopedPointer ui; - }; -} // ns -#endif // guard diff --git a/src/blackgui/components/copyconfigurationdialog.ui b/src/blackgui/components/copyconfigurationdialog.ui deleted file mode 100644 index 65853748a..000000000 --- a/src/blackgui/components/copyconfigurationdialog.ui +++ /dev/null @@ -1,88 +0,0 @@ - - - CCopyConfigurationDialog - - - - 0 - 0 - 640 - 480 - - - - - 600 - 400 - - - - Copy configuration component - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - - - BlackGui::Components::CCopyConfigurationComponent - QFrame -
blackgui/components/copyconfigurationcomponent.h
- 1 -
-
- - - - bb_CopyConfigurationDialog - accepted() - CCopyConfigurationDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - bb_CopyConfigurationDialog - rejected() - CCopyConfigurationDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - -
diff --git a/src/blackgui/share/qss/stdwidget.qss b/src/blackgui/share/qss/stdwidget.qss index 4ad2a50da..9cacc9e5d 100644 --- a/src/blackgui/share/qss/stdwidget.qss +++ b/src/blackgui/share/qss/stdwidget.qss @@ -82,15 +82,6 @@ QDialog::separator:hover { background: transparent; } -/* selector QWizard not working, so using individual components */ -/* the wizard pages are currently hardcoded */ -/* -BlackGui--Components--CCopyConfigurationComponent { - background: black; - background-image: url(:/textures/icons/textures/texture-inner.jpg); -} -*/ - /* setup load dialog details frame */ /* BlackGui--Components--CSetupLoadingDialog #fr_Details {