diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-03-23 10:16:53 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-03-25 06:11:56 +0000 |
commit | a6ece1976b95cd6742d10b9794b9266ffe067ebd (patch) | |
tree | 86e84dff1977a4992e4c53e9091617f6212d0edd /src/plugins/coreplugin/plugindialog.cpp | |
parent | cc02d8dd0d5a9a09ceda1905dcc59a9a9e9c4abe (diff) |
Add detailedText to CheckableMessageBox
QMessageBox creates dialogs that are not resizable, so extend our own
message box implementation with that feature and use it for the Plugin
install wizard.
Change-Id: I0e8a2d525894f8c2897b1e4d8ab546a856030c57
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/plugindialog.cpp')
-rw-r--r-- | src/plugins/coreplugin/plugindialog.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/plugins/coreplugin/plugindialog.cpp b/src/plugins/coreplugin/plugindialog.cpp index 2f22401102..7bca53412c 100644 --- a/src/plugins/coreplugin/plugindialog.cpp +++ b/src/plugins/coreplugin/plugindialog.cpp @@ -38,6 +38,7 @@ #include <extensionsystem/pluginview.h> #include <utils/algorithm.h> +#include <utils/checkablemessagebox.h> #include <utils/environment.h> #include <utils/fancylineedit.h> #include <utils/infolabel.h> @@ -372,13 +373,14 @@ static bool unzip(const FilePath &src, const FilePath &dest) QTC_ASSERT(tool, return false); const QString workingDirectory = dest.toFileInfo().absoluteFilePath(); QDir(workingDirectory).mkpath("."); - QMessageBox box(QMessageBox::Information, - PluginDialog::tr("Unzipping File"), - PluginDialog::tr("Unzipping \"%1\" to \"%2\".") - .arg(src.toUserOutput(), dest.toUserOutput()), - QMessageBox::Ok | QMessageBox::Cancel, - ICore::dialogParent()); - box.button(QMessageBox::Ok)->setEnabled(false); + CheckableMessageBox box(ICore::dialogParent()); + box.setIcon(QMessageBox::Information); + box.setWindowTitle(PluginDialog::tr("Unzipping File")); + box.setText(PluginDialog::tr("Unzipping \"%1\" to \"%2\".") + .arg(src.toUserOutput(), dest.toUserOutput())); + box.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + box.button(QDialogButtonBox::Ok)->setEnabled(false); + box.setCheckBoxVisible(false); box.setDetailedText( PluginDialog::tr("Running %1\nin \"%2\".\n\n", "Running <cmd> in <workingdirectory>") .arg(CommandLine(tool->executable, tool->arguments).toUserOutput(), workingDirectory)); @@ -390,8 +392,8 @@ static bool unzip(const FilePath &src, const FilePath &dest) QObject::connect(&process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), [&box](int, QProcess::ExitStatus) { - box.button(QMessageBox::Ok)->setEnabled(true); - box.button(QMessageBox::Cancel)->setEnabled(false); + box.button(QDialogButtonBox::Ok)->setEnabled(true); + box.button(QDialogButtonBox::Cancel)->setEnabled(false); }); QObject::connect(&box, &QMessageBox::rejected, &process, [&process] { SynchronousProcess::stopProcess(process); |