diff options
| author | Seth Riley <17361645+Qudix@users.noreply.github.com> | 2020-12-01 15:55:50 -0600 |
|---|---|---|
| committer | Seth Riley <17361645+Qudix@users.noreply.github.com> | 2020-12-01 15:55:50 -0600 |
| commit | 852d8745a1ac3ef2aaa83ae21d473d20428d7d30 (patch) | |
| tree | 7ff242377cd3ec72571cd96cd631c28bbaac6470 /src/disableproxyplugindialog.cpp | |
| parent | 60688ecf5bc6e44795472cb22888ec5994a904a8 (diff) | |
| parent | 1ec3ab2b8a845f75495b4cacbeb17c86ea137a01 (diff) | |
Merge https://github.com/ModOrganizer2/modorganizer into ignore_alt
Diffstat (limited to 'src/disableproxyplugindialog.cpp')
| -rw-r--r-- | src/disableproxyplugindialog.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/disableproxyplugindialog.cpp b/src/disableproxyplugindialog.cpp new file mode 100644 index 00000000..c05e30e3 --- /dev/null +++ b/src/disableproxyplugindialog.cpp @@ -0,0 +1,30 @@ +#include "disableproxyplugindialog.h" + +#include "ui_disableproxyplugindialog.h" + +using namespace MOBase; + +DisableProxyPluginDialog::DisableProxyPluginDialog( + MOBase::IPlugin* proxyPlugin, std::vector<MOBase::IPlugin*> const& required, QWidget* parent) + : QDialog(parent), ui(new Ui::DisableProxyPluginDialog) +{ + ui->setupUi(this); + + ui->topLabel->setText(QObject::tr( + "Disabling the '%1' plugin will prevent the following %2 plugin(s) from working:", "", required.size()) + .arg(proxyPlugin->localizedName()) + .arg(required.size())); + + connect(ui->noBtn, &QPushButton::clicked, this, &QDialog::reject); + connect(ui->yesBtn, &QPushButton::clicked, this, &QDialog::accept); + + ui->requiredPlugins->setSelectionMode(QAbstractItemView::NoSelection); + ui->requiredPlugins->setRowCount(required.size()); + for (int i = 0; i < required.size(); ++i) { + ui->requiredPlugins->setItem(i, 0, new QTableWidgetItem(required[i]->localizedName())); + ui->requiredPlugins->setItem(i, 1, new QTableWidgetItem(required[i]->description())); + ui->requiredPlugins->setRowHeight(i, 9); + } + ui->requiredPlugins->verticalHeader()->setVisible(false); + ui->requiredPlugins->sortByColumn(0, Qt::AscendingOrder); +} |
