QmlDesigner: Add import/export of workspaces

* Add import/export functionality to the workspace manager
* Remove checkFormat functionality
* Add utility functions for workspace and file name conversion
* Use workspace file name extension from DockManager
* Fix a few DockManager comments

Task-number: QDS-1553
Change-Id: I1fa99d3ad85e282b3b11be2425faa4458d8a7778
Reviewed-by: Aleksei German <aleksei.german@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Henning Gruendl
2020-05-06 12:45:15 +02:00
committed by Henning Gründl
parent 6d36db78aa
commit 95475156e3
9 changed files with 226 additions and 74 deletions

View File

@@ -170,6 +170,14 @@ WorkspaceDialog::WorkspaceDialog(DockManager *manager, QWidget *parent)
&WorkspaceView::selected,
this,
&WorkspaceDialog::updateActions);
connect(m_ui.btImport,
&QAbstractButton::clicked,
m_ui.workspaceView,
&WorkspaceView::importWorkspace);
connect(m_ui.btExport,
&QAbstractButton::clicked,
m_ui.workspaceView,
&WorkspaceView::exportCurrentWorkspace);
m_ui.whatsAWorkspaceLabel->setOpenExternalLinks(true);
@@ -199,6 +207,7 @@ void WorkspaceDialog::updateActions(const QStringList &workspaces)
m_ui.btClone->setEnabled(false);
m_ui.btReset->setEnabled(false);
m_ui.btSwitch->setEnabled(false);
m_ui.btExport->setEnabled(false);
return;
}
const bool presetIsSelected = Utils::anyOf(workspaces, [this](const QString &workspace) {
@@ -212,6 +221,7 @@ void WorkspaceDialog::updateActions(const QStringList &workspaces)
m_ui.btClone->setEnabled(workspaces.size() == 1);
m_ui.btReset->setEnabled(presetIsSelected);
m_ui.btSwitch->setEnabled(workspaces.size() == 1);
m_ui.btExport->setEnabled(workspaces.size() == 1);
}
} // namespace ADS