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;
|
||||
}
|
||||
|
||||
bool PluginInstallWizard::exec()
|
||||
bool PluginInstallWizard::exec(const FilePath &archive)
|
||||
{
|
||||
Wizard wizard(ICore::dialogParent());
|
||||
wizard.setWindowTitle(Tr::tr("Install Plugin"));
|
||||
|
||||
Data data;
|
||||
|
||||
auto filePage = new SourcePage(&data, &wizard);
|
||||
wizard.addPage(filePage);
|
||||
if (archive.isEmpty()) {
|
||||
auto filePage = new SourcePage(&data, &wizard);
|
||||
wizard.addPage(filePage);
|
||||
} else {
|
||||
data.sourcePath = archive;
|
||||
}
|
||||
|
||||
auto checkArchivePage = new CheckArchivePage(&data, &wizard);
|
||||
wizard.addPage(checkArchivePage);
|
||||
|
@@ -3,6 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <utils/filepath.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
namespace Core {
|
||||
@@ -11,7 +13,7 @@ namespace Internal {
|
||||
class PluginInstallWizard
|
||||
{
|
||||
public:
|
||||
static bool exec();
|
||||
static bool exec(const Utils::FilePath &archive = {});
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user