mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-06 00:40:04 +00:00
hooked up script subview buttons to bottom box (enables add and clone)
This commit is contained in:
parent
2064a3979b
commit
ecbdd7d753
@ -23,7 +23,7 @@ void CSVWorld::ScriptSubView::addButtonBar()
|
||||
if (mButtons)
|
||||
return;
|
||||
|
||||
mButtons = new RecordButtonBar (getUniversalId(), *mModel, 0, &mCommandDispatcher, this);
|
||||
mButtons = new RecordButtonBar (getUniversalId(), *mModel, mBottom, &mCommandDispatcher, this);
|
||||
|
||||
mLayout.insertWidget (1, mButtons);
|
||||
|
||||
@ -61,16 +61,14 @@ CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
||||
throw std::logic_error ("Can't find script column");
|
||||
|
||||
mEditor->setPlainText (mModel->data (mModel->getModelIndex (id.getId(), mColumn)).toString());
|
||||
// bottom box and buttons
|
||||
mBottom = new TableBottomBox (CreatorFactory<GenericCreator>(), document, id, this);
|
||||
|
||||
// buttons
|
||||
if (CSMSettings::UserSettings::instance().setting ("script-editor/toolbar", QString("true")) == "true")
|
||||
addButtonBar();
|
||||
|
||||
// bottom box
|
||||
mBottom = new TableBottomBox (CreatorFactory<GenericCreator>(), document, id, this);
|
||||
|
||||
connect (mBottom, SIGNAL (requestFocus (const std::string&)),
|
||||
this, SLOT (requestFocus (const std::string&)));
|
||||
this, SLOT (switchToId (const std::string&)));
|
||||
|
||||
mLayout.addWidget (mBottom);
|
||||
|
||||
@ -216,3 +214,8 @@ void CSVWorld::ScriptSubView::switchToRow (int row)
|
||||
std::vector<std::string> selection (1, id);
|
||||
mCommandDispatcher.setSelection (selection);
|
||||
}
|
||||
|
||||
void CSVWorld::ScriptSubView::switchToId (const std::string& id)
|
||||
{
|
||||
switchToRow (mModel->getModelIndex (id, 0).row());
|
||||
}
|
||||
|
@ -69,6 +69,8 @@ namespace CSVWorld
|
||||
void updateStatusBar();
|
||||
|
||||
void switchToRow (int row);
|
||||
|
||||
void switchToId (const std::string& id);
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user