|
|
|
@ -3,11 +3,15 @@
|
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
|
|
#include "../../model/doc/document.hpp"
|
|
|
|
|
#include "../../model/doc/state.hpp"
|
|
|
|
|
#include "../../model/tools/search.hpp"
|
|
|
|
|
#include "../../model/tools/reportmodel.hpp"
|
|
|
|
|
#include "../../model/world/idtablebase.hpp"
|
|
|
|
|
#include "../../model/prefs/state.hpp"
|
|
|
|
|
|
|
|
|
|
#include "../world/tablebottombox.hpp"
|
|
|
|
|
#include "../world/creator.hpp"
|
|
|
|
|
|
|
|
|
|
#include "reporttable.hpp"
|
|
|
|
|
#include "searchbox.hpp"
|
|
|
|
|
|
|
|
|
@ -73,6 +77,9 @@ CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
|
|
|
|
|
|
|
|
|
layout->addWidget (mTable = new ReportTable (document, id, true), 2);
|
|
|
|
|
|
|
|
|
|
layout->addWidget (mBottom =
|
|
|
|
|
new CSVWorld::TableBottomBox (CSVWorld::NullCreatorFactory(), document, id, this), 0);
|
|
|
|
|
|
|
|
|
|
QWidget *widget = new QWidget;
|
|
|
|
|
|
|
|
|
|
widget->setLayout (layout);
|
|
|
|
@ -93,6 +100,15 @@ CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
|
|
|
|
this, SLOT (startSearch (const CSMTools::Search&)));
|
|
|
|
|
|
|
|
|
|
connect (&mSearchBox, SIGNAL (replaceAll()), this, SLOT (replaceAllRequest()));
|
|
|
|
|
|
|
|
|
|
connect (document.getReport (id), SIGNAL (rowsRemoved (const QModelIndex&, int, int)),
|
|
|
|
|
this, SLOT (tableSizeUpdate()));
|
|
|
|
|
|
|
|
|
|
connect (document.getReport (id), SIGNAL (rowsInserted (const QModelIndex&, int, int)),
|
|
|
|
|
this, SLOT (tableSizeUpdate()));
|
|
|
|
|
|
|
|
|
|
connect (&document, SIGNAL (operationDone (int, bool)),
|
|
|
|
|
this, SLOT (operationDone (int, bool)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVTools::SearchSubView::setEditLock (bool locked)
|
|
|
|
@ -101,6 +117,11 @@ void CSVTools::SearchSubView::setEditLock (bool locked)
|
|
|
|
|
mSearchBox.setEditLock (locked);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVTools::SearchSubView::setStatusBar (bool show)
|
|
|
|
|
{
|
|
|
|
|
mBottom->setStatusBar(show);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVTools::SearchSubView::stateChanged (int state, CSMDoc::Document *document)
|
|
|
|
|
{
|
|
|
|
|
mSearchBox.setSearchMode (!(state & CSMDoc::State_Searching));
|
|
|
|
@ -126,3 +147,17 @@ void CSVTools::SearchSubView::replaceAllRequest()
|
|
|
|
|
{
|
|
|
|
|
replace (false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVTools::SearchSubView::tableSizeUpdate()
|
|
|
|
|
{
|
|
|
|
|
mBottom->tableSizeChanged (mDocument.getReport (getUniversalId())->rowCount(), 0, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVTools::SearchSubView::operationDone (int type, bool failed)
|
|
|
|
|
{
|
|
|
|
|
if (type==CSMDoc::State_Searching && !failed &&
|
|
|
|
|
!mDocument.getReport (getUniversalId())->rowCount())
|
|
|
|
|
{
|
|
|
|
|
mBottom->setStatusMessage ("No Results");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|