forked from qt-creator/qt-creator
Core: Enable starting of PluginInstallWizard with predefined archive
The wizard usually allows users to chose an archive file path on the first page. The ExtensionManager would like to first download that archive and then launch this wizard without said first page. This change implements such shortcut. Change-Id: Ifc7ffcc04a59be97bd389697977dbd38714237c7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -397,15 +397,19 @@ static bool copyPluginFile(const FilePath &src, const FilePath &dest)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PluginInstallWizard::exec()
|
bool PluginInstallWizard::exec(const FilePath &archive)
|
||||||
{
|
{
|
||||||
Wizard wizard(ICore::dialogParent());
|
Wizard wizard(ICore::dialogParent());
|
||||||
wizard.setWindowTitle(Tr::tr("Install Plugin"));
|
wizard.setWindowTitle(Tr::tr("Install Plugin"));
|
||||||
|
|
||||||
Data data;
|
Data data;
|
||||||
|
|
||||||
auto filePage = new SourcePage(&data, &wizard);
|
if (archive.isEmpty()) {
|
||||||
wizard.addPage(filePage);
|
auto filePage = new SourcePage(&data, &wizard);
|
||||||
|
wizard.addPage(filePage);
|
||||||
|
} else {
|
||||||
|
data.sourcePath = archive;
|
||||||
|
}
|
||||||
|
|
||||||
auto checkArchivePage = new CheckArchivePage(&data, &wizard);
|
auto checkArchivePage = new CheckArchivePage(&data, &wizard);
|
||||||
wizard.addPage(checkArchivePage);
|
wizard.addPage(checkArchivePage);
|
||||||
|
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <utils/filepath.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
@@ -11,7 +13,7 @@ namespace Internal {
|
|||||||
class PluginInstallWizard
|
class PluginInstallWizard
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static bool exec();
|
static bool exec(const Utils::FilePath &archive = {});
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user