mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 12:06:43 +00:00
hooked up script subview buttons to bottom box (enables add and clone)
This commit is contained in:
parent
cf1fb76bb4
commit
df027b3498
2 changed files with 11 additions and 6 deletions
|
@ -23,7 +23,7 @@ void CSVWorld::ScriptSubView::addButtonBar()
|
||||||
if (mButtons)
|
if (mButtons)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mButtons = new RecordButtonBar (getUniversalId(), *mModel, 0, &mCommandDispatcher, this);
|
mButtons = new RecordButtonBar (getUniversalId(), *mModel, mBottom, &mCommandDispatcher, this);
|
||||||
|
|
||||||
mLayout.insertWidget (1, mButtons);
|
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");
|
throw std::logic_error ("Can't find script column");
|
||||||
|
|
||||||
mEditor->setPlainText (mModel->data (mModel->getModelIndex (id.getId(), mColumn)).toString());
|
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")
|
if (CSMSettings::UserSettings::instance().setting ("script-editor/toolbar", QString("true")) == "true")
|
||||||
addButtonBar();
|
addButtonBar();
|
||||||
|
|
||||||
// bottom box
|
|
||||||
mBottom = new TableBottomBox (CreatorFactory<GenericCreator>(), document, id, this);
|
|
||||||
|
|
||||||
connect (mBottom, SIGNAL (requestFocus (const std::string&)),
|
connect (mBottom, SIGNAL (requestFocus (const std::string&)),
|
||||||
this, SLOT (requestFocus (const std::string&)));
|
this, SLOT (switchToId (const std::string&)));
|
||||||
|
|
||||||
mLayout.addWidget (mBottom);
|
mLayout.addWidget (mBottom);
|
||||||
|
|
||||||
|
@ -216,3 +214,8 @@ void CSVWorld::ScriptSubView::switchToRow (int row)
|
||||||
std::vector<std::string> selection (1, id);
|
std::vector<std::string> selection (1, id);
|
||||||
mCommandDispatcher.setSelection (selection);
|
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 updateStatusBar();
|
||||||
|
|
||||||
void switchToRow (int row);
|
void switchToRow (int row);
|
||||||
|
|
||||||
|
void switchToId (const std::string& id);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue