mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 09:23:51 +00:00
ExtendedCommandConfigurator: the perform button takes the name of the command that is executed
This commit is contained in:
parent
05cc130212
commit
e664ef7578
2 changed files with 2 additions and 23 deletions
|
@ -9,20 +9,6 @@
|
||||||
#include "../../model/world/commanddispatcher.hpp"
|
#include "../../model/world/commanddispatcher.hpp"
|
||||||
#include "../../model/world/universalid.hpp"
|
#include "../../model/world/universalid.hpp"
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
QString getTypeGroupTitle(CSVWorld::ExtendedCommandConfigurator::Mode mode)
|
|
||||||
{
|
|
||||||
static const QString title = "Tables affected by ";
|
|
||||||
QString titleSuffix = "Extended Delete";
|
|
||||||
if (mode == CSVWorld::ExtendedCommandConfigurator::Mode_Revert)
|
|
||||||
{
|
|
||||||
titleSuffix = "Extended Revert";
|
|
||||||
}
|
|
||||||
return title + titleSuffix;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CSVWorld::ExtendedCommandConfigurator::ExtendedCommandConfigurator(CSMDoc::Document &document,
|
CSVWorld::ExtendedCommandConfigurator::ExtendedCommandConfigurator(CSMDoc::Document &document,
|
||||||
const CSMWorld::UniversalId &id,
|
const CSMWorld::UniversalId &id,
|
||||||
QWidget *parent)
|
QWidget *parent)
|
||||||
|
@ -33,7 +19,7 @@ CSVWorld::ExtendedCommandConfigurator::ExtendedCommandConfigurator(CSMDoc::Docum
|
||||||
{
|
{
|
||||||
mCommandDispatcher = new CSMWorld::CommandDispatcher(document, id, this);
|
mCommandDispatcher = new CSMWorld::CommandDispatcher(document, id, this);
|
||||||
|
|
||||||
mPerformButton = new QPushButton("Perform", this);
|
mPerformButton = new QPushButton(this);
|
||||||
mPerformButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
mPerformButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
connect(mPerformButton, SIGNAL(clicked(bool)), this, SLOT(performExtendedCommand()));
|
connect(mPerformButton, SIGNAL(clicked(bool)), this, SLOT(performExtendedCommand()));
|
||||||
|
|
||||||
|
@ -41,9 +27,6 @@ CSVWorld::ExtendedCommandConfigurator::ExtendedCommandConfigurator(CSMDoc::Docum
|
||||||
mCancelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
mCancelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
connect(mCancelButton, SIGNAL(clicked(bool)), this, SIGNAL(done()));
|
connect(mCancelButton, SIGNAL(clicked(bool)), this, SIGNAL(done()));
|
||||||
|
|
||||||
mCommandTitle = new QLabel(this);
|
|
||||||
mCommandTitle->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
||||||
|
|
||||||
mTypeGroup = new QGroupBox(this);
|
mTypeGroup = new QGroupBox(this);
|
||||||
|
|
||||||
QGridLayout *groupLayout = new QGridLayout(mTypeGroup);
|
QGridLayout *groupLayout = new QGridLayout(mTypeGroup);
|
||||||
|
@ -52,7 +35,6 @@ CSVWorld::ExtendedCommandConfigurator::ExtendedCommandConfigurator(CSMDoc::Docum
|
||||||
|
|
||||||
QHBoxLayout *mainLayout = new QHBoxLayout(this);
|
QHBoxLayout *mainLayout = new QHBoxLayout(this);
|
||||||
mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
|
mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
|
||||||
mainLayout->addWidget(mCommandTitle);
|
|
||||||
mainLayout->addWidget(mTypeGroup);
|
mainLayout->addWidget(mTypeGroup);
|
||||||
mainLayout->addWidget(mPerformButton);
|
mainLayout->addWidget(mPerformButton);
|
||||||
mainLayout->addWidget(mCancelButton);
|
mainLayout->addWidget(mCancelButton);
|
||||||
|
@ -64,9 +46,7 @@ void CSVWorld::ExtendedCommandConfigurator::configure(CSVWorld::ExtendedCommandC
|
||||||
mMode = mode;
|
mMode = mode;
|
||||||
if (mMode != Mode_None)
|
if (mMode != Mode_None)
|
||||||
{
|
{
|
||||||
QString title = (mMode == Mode_Delete) ? "Extended Delete" : "Extended Revert";
|
mPerformButton->setText((mMode == Mode_Delete) ? "Extended Delete" : "Extended Revert");
|
||||||
title.append(" from:");
|
|
||||||
mCommandTitle->setText(title);
|
|
||||||
mCommandDispatcher->setSelection(selectedIds);
|
mCommandDispatcher->setSelection(selectedIds);
|
||||||
setupCheckBoxes(mCommandDispatcher->getExtendedTypes());
|
setupCheckBoxes(mCommandDispatcher->getExtendedTypes());
|
||||||
setupGroupLayout();
|
setupGroupLayout();
|
||||||
|
|
|
@ -36,7 +36,6 @@ namespace CSVWorld
|
||||||
|
|
||||||
QPushButton *mPerformButton;
|
QPushButton *mPerformButton;
|
||||||
QPushButton *mCancelButton;
|
QPushButton *mCancelButton;
|
||||||
QLabel *mCommandTitle;
|
|
||||||
QGroupBox *mTypeGroup;
|
QGroupBox *mTypeGroup;
|
||||||
CheckBoxMap mTypeCheckBoxes;
|
CheckBoxMap mTypeCheckBoxes;
|
||||||
int mNumUsedCheckBoxes;
|
int mNumUsedCheckBoxes;
|
||||||
|
|
Loading…
Reference in a new issue