2015-06-27 10:49:56 +00:00
|
|
|
#ifndef CSV_WORLD_RECORDBUTTONBAR_H
|
|
|
|
#define CSV_WORLD_RECORDBUTTONBAR_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
2015-06-27 11:47:07 +00:00
|
|
|
#include "../../model/world/universalid.hpp"
|
|
|
|
|
2015-06-27 12:25:48 +00:00
|
|
|
class QToolButton;
|
2015-06-27 14:57:45 +00:00
|
|
|
class QModelIndex;
|
2015-06-27 12:25:48 +00:00
|
|
|
|
2015-06-27 10:49:56 +00:00
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class IdTable;
|
|
|
|
class CommandDispatcher;
|
|
|
|
}
|
|
|
|
|
2015-12-14 16:38:33 +00:00
|
|
|
namespace CSMPrefs
|
|
|
|
{
|
|
|
|
class Setting;
|
|
|
|
}
|
|
|
|
|
2015-06-27 10:49:56 +00:00
|
|
|
namespace CSVWorld
|
|
|
|
{
|
|
|
|
class TableBottomBox;
|
|
|
|
|
|
|
|
/// \brief Button bar for use in dialogue-type subviews
|
|
|
|
///
|
|
|
|
/// Contains the following buttons:
|
|
|
|
/// - next/prev
|
|
|
|
/// - clone
|
|
|
|
/// - add
|
|
|
|
/// - delete
|
|
|
|
/// - revert
|
|
|
|
/// - preview (optional)
|
|
|
|
/// - view (optional)
|
|
|
|
class RecordButtonBar : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2015-06-27 11:47:07 +00:00
|
|
|
CSMWorld::UniversalId mId;
|
2015-06-27 10:49:56 +00:00
|
|
|
CSMWorld::IdTable& mTable;
|
|
|
|
TableBottomBox *mBottom;
|
|
|
|
CSMWorld::CommandDispatcher *mCommandDispatcher;
|
2015-06-27 14:57:45 +00:00
|
|
|
QToolButton *mPrevButton;
|
|
|
|
QToolButton *mNextButton;
|
2015-06-27 12:25:48 +00:00
|
|
|
QToolButton *mCloneButton;
|
|
|
|
QToolButton *mAddButton;
|
|
|
|
QToolButton *mDeleteButton;
|
|
|
|
QToolButton *mRevertButton;
|
|
|
|
bool mLocked;
|
|
|
|
|
|
|
|
private:
|
2015-06-27 10:49:56 +00:00
|
|
|
|
2015-06-27 12:25:48 +00:00
|
|
|
void updateModificationButtons();
|
2015-06-27 14:57:45 +00:00
|
|
|
|
|
|
|
void updatePrevNextButtons();
|
2015-12-14 16:38:33 +00:00
|
|
|
|
2015-06-27 10:49:56 +00:00
|
|
|
public:
|
|
|
|
|
2015-06-27 11:47:07 +00:00
|
|
|
RecordButtonBar (const CSMWorld::UniversalId& id,
|
|
|
|
CSMWorld::IdTable& table, TableBottomBox *bottomBox = 0,
|
2015-06-27 10:49:56 +00:00
|
|
|
CSMWorld::CommandDispatcher *commandDispatcher = 0, QWidget *parent = 0);
|
|
|
|
|
2015-06-27 12:25:48 +00:00
|
|
|
void setEditLock (bool locked);
|
2015-06-27 14:57:45 +00:00
|
|
|
|
2015-06-27 11:47:07 +00:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
void universalIdChanged (const CSMWorld::UniversalId& id);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
2015-12-14 16:38:33 +00:00
|
|
|
void settingChanged (const CSMPrefs::Setting *setting);
|
|
|
|
|
2015-06-27 11:47:07 +00:00
|
|
|
void cloneRequest();
|
2015-06-27 12:42:22 +00:00
|
|
|
|
|
|
|
void nextId();
|
|
|
|
|
|
|
|
void prevId();
|
2015-06-27 14:57:45 +00:00
|
|
|
|
|
|
|
void rowNumberChanged (const QModelIndex& parent, int start, int end);
|
2015-12-14 16:38:33 +00:00
|
|
|
|
2015-06-27 10:49:56 +00:00
|
|
|
signals:
|
|
|
|
|
|
|
|
void showPreview();
|
|
|
|
|
|
|
|
void viewRecord();
|
|
|
|
|
2015-06-27 12:42:22 +00:00
|
|
|
void switchToRow (int row);
|
2015-06-27 10:49:56 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|