2015-07-02 12:47:12 +00:00
|
|
|
#ifndef CSVWORLD_EXTENDEDCOMMANDCONFIGURATOR_HPP
|
|
|
|
#define CSVWORLD_EXTENDEDCOMMANDCONFIGURATOR_HPP
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#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;
|
2015-07-02 19:05:45 +00:00
|
|
|
class QLabel;
|
2015-07-02 12:47:12 +00:00
|
|
|
class QHBoxLayout;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum Mode { Mode_None, Mode_Delete, Mode_Revert };
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef std::map<QCheckBox *, CSMWorld::UniversalId> CheckBoxMap;
|
|
|
|
|
|
|
|
QPushButton *mPerformButton;
|
|
|
|
QPushButton *mCancelButton;
|
|
|
|
QGroupBox *mTypeGroup;
|
|
|
|
CheckBoxMap mTypeCheckBoxes;
|
|
|
|
int mNumUsedCheckBoxes;
|
2015-07-03 19:25:56 +00:00
|
|
|
int mNumChecked;
|
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;
|
2015-07-02 12:47:12 +00:00
|
|
|
|
2015-07-05 19:49:48 +00:00
|
|
|
bool mEditLock;
|
|
|
|
|
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);
|
2015-07-02 12:47:12 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
ExtendedCommandConfigurator(CSMDoc::Document &document,
|
|
|
|
const CSMWorld::UniversalId &id,
|
|
|
|
QWidget *parent = 0);
|
|
|
|
|
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);
|
2015-07-02 12:47:12 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void resizeEvent(QResizeEvent *event);
|
|
|
|
|
|
|
|
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();
|
2015-07-02 12:47:12 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void done();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|