|
|
|
@ -16,7 +16,7 @@ void CSVTools::SearchSubView::replace (bool selection)
|
|
|
|
|
{
|
|
|
|
|
if (mLocked)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<int> indices = mTable->getReplaceIndices (selection);
|
|
|
|
|
|
|
|
|
|
std::string replace = mSearchBox.getReplaceText();
|
|
|
|
@ -29,7 +29,7 @@ void CSVTools::SearchSubView::replace (bool selection)
|
|
|
|
|
|
|
|
|
|
CSMTools::Search search (mSearch);
|
|
|
|
|
CSMWorld::IdTableBase *currentTable = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// We are running through the indices in reverse order to avoid messing up multiple results
|
|
|
|
|
// in a single string.
|
|
|
|
|
for (std::vector<int>::const_reverse_iterator iter (indices.rbegin()); iter!=indices.rend(); ++iter)
|
|
|
|
@ -46,7 +46,7 @@ void CSVTools::SearchSubView::replace (bool selection)
|
|
|
|
|
search.configure (table);
|
|
|
|
|
currentTable = table;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string hint = model.getHint (*iter);
|
|
|
|
|
|
|
|
|
|
if (search.verify (mDocument, table, id, hint))
|
|
|
|
@ -63,7 +63,7 @@ void CSVTools::SearchSubView::replace (bool selection)
|
|
|
|
|
void CSVTools::SearchSubView::showEvent (QShowEvent *event)
|
|
|
|
|
{
|
|
|
|
|
CSVDoc::SubView::showEvent (event);
|
|
|
|
|
mSearchBox.focus();
|
|
|
|
|
mSearchBox.focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
|
|
|
@ -71,25 +71,23 @@ CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
|
|
|
|
{
|
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout;
|
|
|
|
|
|
|
|
|
|
layout->setContentsMargins (QMargins (0, 0, 0, 0));
|
|
|
|
|
|
|
|
|
|
layout->addWidget (&mSearchBox);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
layout->addWidget (mTable = new ReportTable (document, id, true), 2);
|
|
|
|
|
|
|
|
|
|
QWidget *widget = new QWidget;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
widget->setLayout (layout);
|
|
|
|
|
|
|
|
|
|
setWidget (widget);
|
|
|
|
|
|
|
|
|
|
stateChanged (document.getState(), &document);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect (mTable, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)),
|
|
|
|
|
SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)));
|
|
|
|
|
|
|
|
|
|
connect (mTable, SIGNAL (replaceRequest()), this, SLOT (replaceRequest()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect (&document, SIGNAL (stateChanged (int, CSMDoc::Document *)),
|
|
|
|
|
this, SLOT (stateChanged (int, CSMDoc::Document *)));
|
|
|
|
|
|
|
|
|
@ -124,7 +122,7 @@ void CSVTools::SearchSubView::startSearch (const CSMTools::Search& search)
|
|
|
|
|
|
|
|
|
|
mSearch = search;
|
|
|
|
|
mSearch.setPadding (paddingBefore, paddingAfter);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mTable->clear();
|
|
|
|
|
mDocument.runSearch (getUniversalId(), mSearch);
|
|
|
|
|
}
|
|
|
|
|