hooked up script subview buttons to bottom box (enables add and clone)

sceneinput
Marc Zinnschlag 10 years ago
parent cf1fb76bb4
commit df027b3498

@ -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…
Cancel
Save