1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-23 20:53:54 +00:00
openmw/apps/opencs/view/world/extendedcommandconfigurator.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
1.7 KiB
C++
Raw Normal View History

#ifndef CSVWORLD_EXTENDEDCOMMANDCONFIGURATOR_HPP
#define CSVWORLD_EXTENDEDCOMMANDCONFIGURATOR_HPP
#include <map>
2022-10-19 17:02:00 +00:00
#include <vector>
#include <QWidget>
2015-07-03 23:02:22 +00:00
#include "../../model/world/universalid.hpp"
class QPushButton;
class QGroupBox;
class QCheckBox;
2022-10-19 17:02:00 +00:00
class QResizeEvent;
namespace CSMDoc
{
class Document;
}
namespace CSMWorld
{
class CommandDispatcher;
class Data;
}
namespace CSVWorld
{
class ExtendedCommandConfigurator : public QWidget
{
Q_OBJECT
2022-09-22 18:26:05 +00:00
public:
enum Mode
{
Mode_None,
Mode_Delete,
Mode_Revert
};
2022-09-22 18:26:05 +00:00
private:
typedef std::map<QCheckBox*, CSMWorld::UniversalId> CheckBoxMap;
2022-09-22 18:26:05 +00:00
QPushButton* mPerformButton;
QPushButton* mCancelButton;
QGroupBox* mTypeGroup;
CheckBoxMap mTypeCheckBoxes;
int mNumUsedCheckBoxes;
int mNumChecked;
2022-09-22 18:26:05 +00:00
Mode mMode;
CSMWorld::CommandDispatcher* mCommandDispatcher;
CSMWorld::Data& mData;
std::vector<std::string> mSelectedIds;
2022-09-22 18:26:05 +00:00
bool mEditLock;
2022-09-22 18:26:05 +00:00
void setupGroupLayout();
void setupCheckBoxes(const std::vector<CSMWorld::UniversalId>& types);
void lockWidgets(bool locked);
2022-09-22 18:26:05 +00:00
public:
ExtendedCommandConfigurator(
CSMDoc::Document& document, const CSMWorld::UniversalId& id, QWidget* parent = nullptr);
2022-09-22 18:26:05 +00:00
void configure(Mode mode, const std::vector<std::string>& selectedIds);
void setEditLock(bool locked);
2022-09-22 18:26:05 +00:00
protected:
void resizeEvent(QResizeEvent* event) override;
2022-09-22 18:26:05 +00:00
private slots:
void performExtendedCommand();
void checkBoxStateChanged(int state);
void dataIdListChanged();
2022-09-22 18:26:05 +00:00
signals:
void done();
};
}
#endif