diff --git a/src/plugins/coreplugin/plugininstallwizard.cpp b/src/plugins/coreplugin/plugininstallwizard.cpp index 34be2ceedf3..bc69e66913e 100644 --- a/src/plugins/coreplugin/plugininstallwizard.cpp +++ b/src/plugins/coreplugin/plugininstallwizard.cpp @@ -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); diff --git a/src/plugins/coreplugin/plugininstallwizard.h b/src/plugins/coreplugin/plugininstallwizard.h index 6f9b80af8a5..076661b83cc 100644 --- a/src/plugins/coreplugin/plugininstallwizard.h +++ b/src/plugins/coreplugin/plugininstallwizard.h @@ -3,6 +3,8 @@ #pragma once +#include + #include namespace Core { @@ -11,7 +13,7 @@ namespace Internal { class PluginInstallWizard { public: - static bool exec(); + static bool exec(const Utils::FilePath &archive = {}); }; } // namespace Internal