mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 18:36:41 +00:00
added user settings option to toggle toolbars in single-record subviews
This commit is contained in:
parent
749eff5259
commit
fc6c14614b
5 changed files with 131 additions and 51 deletions
|
@ -217,6 +217,12 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
|
||||||
jumpToAdded->setDeclaredValues (jumpValues);
|
jumpToAdded->setDeclaredValues (jumpValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declareSection ("dialogues", "ID Dialogues");
|
||||||
|
{
|
||||||
|
Setting *toolbar = createSetting (Type_CheckBox, "toolbar", "Show toolbar");
|
||||||
|
toolbar->setDefaultValue ("true");
|
||||||
|
}
|
||||||
|
|
||||||
declareSection ("report-input", "Reports");
|
declareSection ("report-input", "Reports");
|
||||||
{
|
{
|
||||||
QString none ("None");
|
QString none ("None");
|
||||||
|
@ -310,6 +316,9 @@ void CSMSettings::UserSettings::buildSettingModelDefaults()
|
||||||
"<li>Strict: Promote warning to an error</li>"
|
"<li>Strict: Promote warning to an error</li>"
|
||||||
"</ul>");
|
"</ul>");
|
||||||
|
|
||||||
|
Setting *toolbar = createSetting (Type_CheckBox, "toolbar", "Show toolbar");
|
||||||
|
toolbar->setDefaultValue ("true");
|
||||||
|
|
||||||
Setting *formatInt = createSetting (Type_LineEdit, "colour-int", "Highlight Colour: Int");
|
Setting *formatInt = createSetting (Type_LineEdit, "colour-int", "Highlight Colour: Int");
|
||||||
formatInt->setDefaultValues (QStringList() << "Dark magenta");
|
formatInt->setDefaultValues (QStringList() << "Dark magenta");
|
||||||
formatInt->setToolTip ("(Default: Green) Use one of the following formats:" + tooltip);
|
formatInt->setToolTip ("(Default: Green) Use one of the following formats:" + tooltip);
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include "../../model/world/idtree.hpp"
|
#include "../../model/world/idtree.hpp"
|
||||||
#include "../../model/world/commands.hpp"
|
#include "../../model/world/commands.hpp"
|
||||||
#include "../../model/doc/document.hpp"
|
#include "../../model/doc/document.hpp"
|
||||||
|
#include "../../model/settings/usersettings.hpp"
|
||||||
|
|
||||||
#include "../widget/coloreditor.hpp"
|
#include "../widget/coloreditor.hpp"
|
||||||
#include "../widget/droplineedit.hpp"
|
#include "../widget/droplineedit.hpp"
|
||||||
|
@ -66,7 +67,7 @@ void CSVWorld::NotEditableSubDelegate::setEditorData (QWidget* editor, const QMo
|
||||||
|
|
||||||
CSMWorld::Columns::ColumnId columnId = static_cast<CSMWorld::Columns::ColumnId> (
|
CSMWorld::Columns::ColumnId columnId = static_cast<CSMWorld::Columns::ColumnId> (
|
||||||
mTable->getColumnId (index.column()));
|
mTable->getColumnId (index.column()));
|
||||||
|
|
||||||
if (QVariant::String == v.type())
|
if (QVariant::String == v.type())
|
||||||
{
|
{
|
||||||
label->setText(v.toString());
|
label->setText(v.toString());
|
||||||
|
@ -75,7 +76,7 @@ void CSVWorld::NotEditableSubDelegate::setEditorData (QWidget* editor, const QMo
|
||||||
{
|
{
|
||||||
int data = v.toInt();
|
int data = v.toInt();
|
||||||
std::vector<std::string> enumNames (CSMWorld::Columns::getEnums (columnId));
|
std::vector<std::string> enumNames (CSMWorld::Columns::getEnums (columnId));
|
||||||
|
|
||||||
label->setText(QString::fromUtf8(enumNames.at(data).c_str()));
|
label->setText(QString::fromUtf8(enumNames.at(data).c_str()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -324,11 +325,11 @@ CSVWorld::IdContextMenu::IdContextMenu(QWidget *widget, CSMWorld::ColumnBase::Di
|
||||||
Q_ASSERT(mWidget != NULL);
|
Q_ASSERT(mWidget != NULL);
|
||||||
Q_ASSERT(CSMWorld::ColumnBase::isId(display));
|
Q_ASSERT(CSMWorld::ColumnBase::isId(display));
|
||||||
Q_ASSERT(mIdType != CSMWorld::UniversalId::Type_None);
|
Q_ASSERT(mIdType != CSMWorld::UniversalId::Type_None);
|
||||||
|
|
||||||
mWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
mWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(mWidget,
|
connect(mWidget,
|
||||||
SIGNAL(customContextMenuRequested(const QPoint &)),
|
SIGNAL(customContextMenuRequested(const QPoint &)),
|
||||||
this,
|
this,
|
||||||
SLOT(showContextMenu(const QPoint &)));
|
SLOT(showContextMenu(const QPoint &)));
|
||||||
|
|
||||||
mEditIdAction = new QAction(this);
|
mEditIdAction = new QAction(this);
|
||||||
|
@ -352,7 +353,7 @@ void CSVWorld::IdContextMenu::excludeId(const std::string &id)
|
||||||
|
|
||||||
QString CSVWorld::IdContextMenu::getWidgetValue() const
|
QString CSVWorld::IdContextMenu::getWidgetValue() const
|
||||||
{
|
{
|
||||||
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(mWidget);
|
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(mWidget);
|
||||||
QLabel *label = qobject_cast<QLabel *>(mWidget);
|
QLabel *label = qobject_cast<QLabel *>(mWidget);
|
||||||
|
|
||||||
QString value = "";
|
QString value = "";
|
||||||
|
@ -411,7 +412,7 @@ void CSVWorld::IdContextMenu::showContextMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
removeEditIdActionFromMenu();
|
removeEditIdActionFromMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mContextMenu->actions().isEmpty())
|
if (!mContextMenu->actions().isEmpty())
|
||||||
{
|
{
|
||||||
mContextMenu->exec(mWidget->mapToGlobal(pos));
|
mContextMenu->exec(mWidget->mapToGlobal(pos));
|
||||||
|
@ -588,9 +589,9 @@ void CSVWorld::EditWidget::remake(int row)
|
||||||
tablesLayout->addWidget(label);
|
tablesLayout->addWidget(label);
|
||||||
tablesLayout->addWidget(table);
|
tablesLayout->addWidget(table);
|
||||||
|
|
||||||
connect(table,
|
connect(table,
|
||||||
SIGNAL(editRequest(const CSMWorld::UniversalId &, const std::string &)),
|
SIGNAL(editRequest(const CSMWorld::UniversalId &, const std::string &)),
|
||||||
this,
|
this,
|
||||||
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)));
|
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)));
|
||||||
}
|
}
|
||||||
else if (!(flags & CSMWorld::ColumnBase::Flag_Dialogue_List))
|
else if (!(flags & CSMWorld::ColumnBase::Flag_Dialogue_List))
|
||||||
|
@ -830,9 +831,28 @@ void CSVWorld::SimpleDialogueSubView::updateCurrentId()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CSVWorld::DialogueSubView::addButtonBar()
|
||||||
|
{
|
||||||
|
if (mButtons)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mButtons = new RecordButtonBar (getUniversalId(), getTable(), mBottom,
|
||||||
|
&getCommandDispatcher(), this);
|
||||||
|
|
||||||
|
getMainLayout().insertWidget (1, mButtons);
|
||||||
|
|
||||||
|
// connections
|
||||||
|
connect (mButtons, SIGNAL (showPreview()), this, SLOT (showPreview()));
|
||||||
|
connect (mButtons, SIGNAL (viewRecord()), this, SLOT (viewRecord()));
|
||||||
|
connect (mButtons, SIGNAL (switchToRow (int)), this, SLOT (switchToRow (int)));
|
||||||
|
|
||||||
|
connect (this, SIGNAL (universalIdChanged (const CSMWorld::UniversalId&)),
|
||||||
|
mButtons, SLOT (universalIdChanged (const CSMWorld::UniversalId&)));
|
||||||
|
}
|
||||||
|
|
||||||
CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id,
|
CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id,
|
||||||
CSMDoc::Document& document, const CreatorFactoryBase& creatorFactory, bool sorting)
|
CSMDoc::Document& document, const CreatorFactoryBase& creatorFactory, bool sorting)
|
||||||
: SimpleDialogueSubView (id, document)
|
: SimpleDialogueSubView (id, document), mButtons (0)
|
||||||
{
|
{
|
||||||
// bottom box
|
// bottom box
|
||||||
mBottom = new TableBottomBox (creatorFactory, document, id, this);
|
mBottom = new TableBottomBox (creatorFactory, document, id, this);
|
||||||
|
@ -843,32 +863,44 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id,
|
||||||
this, SLOT (requestFocus (const std::string&)));
|
this, SLOT (requestFocus (const std::string&)));
|
||||||
|
|
||||||
// button bar
|
// button bar
|
||||||
mButtons = new RecordButtonBar (id, getTable(), mBottom,
|
if (CSMSettings::UserSettings::instance().setting ("dialogues/toolbar", QString("true")) == "true")
|
||||||
&getCommandDispatcher(), this);
|
addButtonBar();
|
||||||
|
|
||||||
// layout
|
// layout
|
||||||
getMainLayout().addWidget (mButtons);
|
|
||||||
getMainLayout().addWidget (mBottom);
|
getMainLayout().addWidget (mBottom);
|
||||||
|
|
||||||
// connections
|
|
||||||
connect (mButtons, SIGNAL (showPreview()), this, SLOT (showPreview()));
|
|
||||||
connect (mButtons, SIGNAL (viewRecord()), this, SLOT (viewRecord()));
|
|
||||||
connect (mButtons, SIGNAL (switchToRow (int)), this, SLOT (switchToRow (int)));
|
|
||||||
|
|
||||||
connect (this, SIGNAL (universalIdChanged (const CSMWorld::UniversalId&)),
|
|
||||||
mButtons, SLOT (universalIdChanged (const CSMWorld::UniversalId&)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::DialogueSubView::setEditLock (bool locked)
|
void CSVWorld::DialogueSubView::setEditLock (bool locked)
|
||||||
{
|
{
|
||||||
SimpleDialogueSubView::setEditLock (locked);
|
SimpleDialogueSubView::setEditLock (locked);
|
||||||
mButtons->setEditLock (locked);
|
|
||||||
|
if (mButtons)
|
||||||
|
mButtons->setEditLock (locked);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::DialogueSubView::updateUserSetting (const QString& name, const QStringList& value)
|
void CSVWorld::DialogueSubView::updateUserSetting (const QString& name, const QStringList& value)
|
||||||
{
|
{
|
||||||
SimpleDialogueSubView::updateUserSetting (name, value);
|
SimpleDialogueSubView::updateUserSetting (name, value);
|
||||||
mButtons->updateUserSetting (name, value);
|
|
||||||
|
if (name=="dialogues/toolbar")
|
||||||
|
{
|
||||||
|
if (value.at(0)==QString ("true"))
|
||||||
|
{
|
||||||
|
addButtonBar();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (mButtons)
|
||||||
|
{
|
||||||
|
getMainLayout().removeWidget (mButtons);
|
||||||
|
delete mButtons;
|
||||||
|
mButtons = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mButtons)
|
||||||
|
mButtons->updateUserSetting (name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::DialogueSubView::showPreview ()
|
void CSVWorld::DialogueSubView::showPreview ()
|
||||||
|
@ -908,7 +940,7 @@ void CSVWorld::DialogueSubView::switchToRow (int row)
|
||||||
|
|
||||||
setUniversalId (CSMWorld::UniversalId (type, id));
|
setUniversalId (CSMWorld::UniversalId (type, id));
|
||||||
updateCurrentId();
|
updateCurrentId();
|
||||||
|
|
||||||
getEditWidget().remake (row);
|
getEditWidget().remake (row);
|
||||||
|
|
||||||
int stateColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Modification);
|
int stateColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Modification);
|
||||||
|
@ -923,5 +955,5 @@ void CSVWorld::DialogueSubView::requestFocus (const std::string& id)
|
||||||
QModelIndex index = getTable().getModelIndex (id, 0);
|
QModelIndex index = getTable().getModelIndex (id, 0);
|
||||||
|
|
||||||
if (index.isValid())
|
if (index.isValid())
|
||||||
switchToRow (index.row());
|
switchToRow (index.row());
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,8 +195,8 @@ namespace CSVWorld
|
||||||
CSMDoc::Document& mDocument;
|
CSMDoc::Document& mDocument;
|
||||||
std::vector<CSMWorld::NestedTableProxyModel*> mNestedModels; //Plain, raw C pointers, deleted in the dtor
|
std::vector<CSMWorld::NestedTableProxyModel*> mNestedModels; //Plain, raw C pointers, deleted in the dtor
|
||||||
|
|
||||||
void createEditorContextMenu(QWidget *editor,
|
void createEditorContextMenu(QWidget *editor,
|
||||||
CSMWorld::ColumnBase::Display display,
|
CSMWorld::ColumnBase::Display display,
|
||||||
int currentRow) const;
|
int currentRow) const;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ namespace CSVWorld
|
||||||
void updateCurrentId();
|
void updateCurrentId();
|
||||||
|
|
||||||
bool isLocked() const;
|
bool isLocked() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
SimpleDialogueSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
|
SimpleDialogueSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
|
||||||
|
@ -256,10 +256,14 @@ namespace CSVWorld
|
||||||
class DialogueSubView : public SimpleDialogueSubView
|
class DialogueSubView : public SimpleDialogueSubView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
TableBottomBox* mBottom;
|
TableBottomBox* mBottom;
|
||||||
RecordButtonBar *mButtons;
|
RecordButtonBar *mButtons;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void addButtonBar();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DialogueSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document,
|
DialogueSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document,
|
||||||
|
@ -268,14 +272,14 @@ namespace CSVWorld
|
||||||
virtual void setEditLock (bool locked);
|
virtual void setEditLock (bool locked);
|
||||||
|
|
||||||
virtual void updateUserSetting (const QString& name, const QStringList& value);
|
virtual void updateUserSetting (const QString& name, const QStringList& value);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void showPreview();
|
void showPreview();
|
||||||
|
|
||||||
void viewRecord();
|
void viewRecord();
|
||||||
|
|
||||||
void switchToRow (int row);
|
void switchToRow (int row);
|
||||||
|
|
||||||
void requestFocus (const std::string& id);
|
void requestFocus (const std::string& id);
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,19 +17,32 @@
|
||||||
#include "scriptedit.hpp"
|
#include "scriptedit.hpp"
|
||||||
#include "recordbuttonbar.hpp"
|
#include "recordbuttonbar.hpp"
|
||||||
|
|
||||||
|
void CSVWorld::ScriptSubView::addButtonBar()
|
||||||
|
{
|
||||||
|
if (mButtons)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mButtons = new RecordButtonBar (getUniversalId(), *mModel, 0, &mCommandDispatcher, this);
|
||||||
|
|
||||||
|
mLayout.insertWidget (1, mButtons);
|
||||||
|
|
||||||
|
connect (mButtons, SIGNAL (switchToRow (int)), this, SLOT (switchToRow (int)));
|
||||||
|
|
||||||
|
connect (this, SIGNAL (universalIdChanged (const CSMWorld::UniversalId&)),
|
||||||
|
mButtons, SLOT (universalIdChanged (const CSMWorld::UniversalId&)));
|
||||||
|
}
|
||||||
|
|
||||||
CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
||||||
: SubView (id), mDocument (document), mColumn (-1), mBottom(0), mStatus(0),
|
: SubView (id), mDocument (document), mColumn (-1), mBottom(0), mStatus(0), mButtons (0),
|
||||||
mCommandDispatcher (document, CSMWorld::UniversalId::getParentType (id.getType()))
|
mCommandDispatcher (document, CSMWorld::UniversalId::getParentType (id.getType()))
|
||||||
{
|
{
|
||||||
std::vector<std::string> selection (1, id.getId());
|
std::vector<std::string> selection (1, id.getId());
|
||||||
mCommandDispatcher.setSelection (selection);
|
mCommandDispatcher.setSelection (selection);
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
mLayout.addWidget (mEditor = new ScriptEdit (mDocument, ScriptHighlighter::Mode_General, this), 2);
|
||||||
|
|
||||||
layout->addWidget (mEditor = new ScriptEdit (mDocument, ScriptHighlighter::Mode_General, this), 2);
|
|
||||||
|
|
||||||
QWidget *widget = new QWidget (this);;
|
QWidget *widget = new QWidget (this);;
|
||||||
widget->setLayout (layout);
|
widget->setLayout (&mLayout);
|
||||||
setWidget (widget);
|
setWidget (widget);
|
||||||
|
|
||||||
mModel = &dynamic_cast<CSMWorld::IdTable&> (
|
mModel = &dynamic_cast<CSMWorld::IdTable&> (
|
||||||
|
@ -49,9 +62,8 @@ CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
||||||
mEditor->setPlainText (mModel->data (mModel->getModelIndex (id.getId(), mColumn)).toString());
|
mEditor->setPlainText (mModel->data (mModel->getModelIndex (id.getId(), mColumn)).toString());
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
mButtons = new RecordButtonBar (id, *mModel, 0, &mCommandDispatcher, this);
|
if (CSMSettings::UserSettings::instance().setting ("script-editor/toolbar", QString("true")) == "true")
|
||||||
|
addButtonBar();
|
||||||
layout->addWidget (mButtons);
|
|
||||||
|
|
||||||
// status bar
|
// status bar
|
||||||
QStatusBar *statusBar = new QStatusBar(mBottom);
|
QStatusBar *statusBar = new QStatusBar(mBottom);
|
||||||
|
@ -64,7 +76,7 @@ CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
||||||
bottmLayout->addWidget (statusBar);
|
bottmLayout->addWidget (statusBar);
|
||||||
mBottom->setLayout (bottmLayout);
|
mBottom->setLayout (bottmLayout);
|
||||||
|
|
||||||
layout->addWidget (mBottom, 0);
|
mLayout.addWidget (mBottom, 0);
|
||||||
|
|
||||||
// signals
|
// signals
|
||||||
connect (mEditor, SIGNAL (textChanged()), this, SLOT (textChanged()));
|
connect (mEditor, SIGNAL (textChanged()), this, SLOT (textChanged()));
|
||||||
|
@ -75,11 +87,6 @@ CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
||||||
connect (mModel, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
|
connect (mModel, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)),
|
||||||
this, SLOT (rowsAboutToBeRemoved (const QModelIndex&, int, int)));
|
this, SLOT (rowsAboutToBeRemoved (const QModelIndex&, int, int)));
|
||||||
|
|
||||||
connect (mButtons, SIGNAL (switchToRow (int)), this, SLOT (switchToRow (int)));
|
|
||||||
|
|
||||||
connect (this, SIGNAL (universalIdChanged (const CSMWorld::UniversalId&)),
|
|
||||||
mButtons, SLOT (universalIdChanged (const CSMWorld::UniversalId&)));
|
|
||||||
|
|
||||||
updateStatusBar();
|
updateStatusBar();
|
||||||
connect(mEditor, SIGNAL(cursorPositionChanged()), this, SLOT(updateStatusBar()));
|
connect(mEditor, SIGNAL(cursorPositionChanged()), this, SLOT(updateStatusBar()));
|
||||||
}
|
}
|
||||||
|
@ -88,16 +95,33 @@ void CSVWorld::ScriptSubView::updateUserSetting (const QString& name, const QStr
|
||||||
{
|
{
|
||||||
if (name == "script-editor/show-linenum")
|
if (name == "script-editor/show-linenum")
|
||||||
{
|
{
|
||||||
std::string showLinenum = value.at(0).toStdString();
|
std::string showLinenum = value.at(0).toUtf8().constData();
|
||||||
mEditor->showLineNum(showLinenum == "true");
|
mEditor->showLineNum(showLinenum == "true");
|
||||||
mBottom->setVisible(showLinenum == "true");
|
mBottom->setVisible(showLinenum == "true");
|
||||||
}
|
}
|
||||||
else if (name == "script-editor/mono-font")
|
else if (name == "script-editor/mono-font")
|
||||||
{
|
{
|
||||||
mEditor->setMonoFont(value.at(0).toStdString() == "true");
|
mEditor->setMonoFont (value.at(0)==QString ("true"));
|
||||||
|
}
|
||||||
|
else if (name=="script-editor/toolbar")
|
||||||
|
{
|
||||||
|
if (value.at(0)==QString ("true"))
|
||||||
|
{
|
||||||
|
addButtonBar();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (mButtons)
|
||||||
|
{
|
||||||
|
mLayout.removeWidget (mButtons);
|
||||||
|
delete mButtons;
|
||||||
|
mButtons = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mButtons->updateUserSetting (name, value);
|
if (mButtons)
|
||||||
|
mButtons->updateUserSetting (name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWorld::ScriptSubView::updateStatusBar ()
|
void CSVWorld::ScriptSubView::updateStatusBar ()
|
||||||
|
@ -113,7 +137,10 @@ void CSVWorld::ScriptSubView::updateStatusBar ()
|
||||||
void CSVWorld::ScriptSubView::setEditLock (bool locked)
|
void CSVWorld::ScriptSubView::setEditLock (bool locked)
|
||||||
{
|
{
|
||||||
mEditor->setReadOnly (locked);
|
mEditor->setReadOnly (locked);
|
||||||
mButtons->setEditLock (locked);
|
|
||||||
|
if (mButtons)
|
||||||
|
mButtons->setEditLock (locked);
|
||||||
|
|
||||||
mCommandDispatcher.setEditLock (locked);
|
mCommandDispatcher.setEditLock (locked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
#ifndef CSV_WORLD_SCRIPTSUBVIEW_H
|
#ifndef CSV_WORLD_SCRIPTSUBVIEW_H
|
||||||
#define CSV_WORLD_SCRIPTSUBVIEW_H
|
#define CSV_WORLD_SCRIPTSUBVIEW_H
|
||||||
|
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "../../model/world/commanddispatcher.hpp"
|
#include "../../model/world/commanddispatcher.hpp"
|
||||||
|
|
||||||
#include "../doc/subview.hpp"
|
#include "../doc/subview.hpp"
|
||||||
|
|
||||||
class QModelIndex;
|
class QModelIndex;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
class QVBoxLayout;
|
||||||
|
|
||||||
namespace CSMDoc
|
namespace CSMDoc
|
||||||
{
|
{
|
||||||
|
@ -35,6 +38,11 @@ namespace CSVWorld
|
||||||
QLabel *mStatus;
|
QLabel *mStatus;
|
||||||
RecordButtonBar *mButtons;
|
RecordButtonBar *mButtons;
|
||||||
CSMWorld::CommandDispatcher mCommandDispatcher;
|
CSMWorld::CommandDispatcher mCommandDispatcher;
|
||||||
|
QVBoxLayout mLayout;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void addButtonBar();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue