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