mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-30 20:34:27 +01:00
Arbitration: new search filter, filtering points
This commit is contained in:
parent
487dd213ce
commit
19387540cd
3 changed files with 54 additions and 8 deletions
|
@ -166,9 +166,11 @@ ArbitrationWidget::ArbitrationWidget(QWidget *parent,
|
||||||
SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
|
SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
|
||||||
this, SLOT(showPreview(const QItemSelection&)));
|
this, SLOT(showPreview(const QItemSelection&)));
|
||||||
|
|
||||||
// Dynamic filter for search results
|
// Dynamic filters for search results
|
||||||
QObject::connect(lineEditFilter, SIGNAL(textChanged(const QString&)),
|
QObject::connect(lineEditFilterWord, SIGNAL(textChanged(const QString&)),
|
||||||
this, SLOT(resultsFilterChanged(const QString&)));
|
this, SLOT(resultsFilterWordChanged(const QString&)));
|
||||||
|
QObject::connect(lineEditFilterPoints, SIGNAL(textChanged(const QString&)),
|
||||||
|
this, SLOT(resultsFilterPointsChanged(const QString&)));
|
||||||
|
|
||||||
// Enable the assignment buttons according to the selections in trees
|
// Enable the assignment buttons according to the selections in trees
|
||||||
QObject::connect(treeViewResults->selectionModel(),
|
QObject::connect(treeViewResults->selectionModel(),
|
||||||
|
@ -440,9 +442,29 @@ void ArbitrationWidget::rackChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ArbitrationWidget::resultsFilterChanged(const QString &iFilter)
|
void ArbitrationWidget::resultsFilterWordChanged(const QString &iFilter)
|
||||||
{
|
{
|
||||||
|
// Clear the points filter
|
||||||
|
lineEditFilterPoints->blockSignals(true);
|
||||||
|
lineEditFilterPoints->clear();
|
||||||
|
lineEditFilterPoints->blockSignals(false);
|
||||||
|
|
||||||
treeViewResults->clearSelection();
|
treeViewResults->clearSelection();
|
||||||
|
m_proxyResultsModel->setFilterKeyColumn(0);
|
||||||
|
m_proxyResultsModel->setFilterFixedString(iFilter);
|
||||||
|
emit gameUpdated();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ArbitrationWidget::resultsFilterPointsChanged(const QString &iFilter)
|
||||||
|
{
|
||||||
|
// Clear the word filter
|
||||||
|
lineEditFilterWord->blockSignals(true);
|
||||||
|
lineEditFilterWord->clear();
|
||||||
|
lineEditFilterWord->blockSignals(false);
|
||||||
|
|
||||||
|
treeViewResults->clearSelection();
|
||||||
|
m_proxyResultsModel->setFilterKeyColumn(2);
|
||||||
m_proxyResultsModel->setFilterFixedString(iFilter);
|
m_proxyResultsModel->setFilterFixedString(iFilter);
|
||||||
emit gameUpdated();
|
emit gameUpdated();
|
||||||
}
|
}
|
||||||
|
@ -476,7 +498,8 @@ void ArbitrationWidget::searchResults()
|
||||||
{
|
{
|
||||||
m_game->removeTestRound();
|
m_game->removeTestRound();
|
||||||
emit notifyInfo(_q("Searching with rack '%1'...").arg(lineEditRack->text()));
|
emit notifyInfo(_q("Searching with rack '%1'...").arg(lineEditRack->text()));
|
||||||
lineEditFilter->clear();
|
lineEditFilterWord->clear();
|
||||||
|
lineEditFilterPoints->clear();
|
||||||
m_results.clear();
|
m_results.clear();
|
||||||
m_game->arbitrationSearch(m_results);
|
m_game->arbitrationSearch(m_results);
|
||||||
emit notifyInfo(_q("Search done"));
|
emit notifyInfo(_q("Search done"));
|
||||||
|
|
|
@ -65,7 +65,8 @@ private slots:
|
||||||
void rackEdited(const QString &);
|
void rackEdited(const QString &);
|
||||||
void rackChanged();
|
void rackChanged();
|
||||||
void searchResults();
|
void searchResults();
|
||||||
void resultsFilterChanged(const QString &);
|
void resultsFilterWordChanged(const QString &);
|
||||||
|
void resultsFilterPointsChanged(const QString &);
|
||||||
void enableCheckWordButton();
|
void enableCheckWordButton();
|
||||||
void checkWord();
|
void checkWord();
|
||||||
void updateSelectedMove();
|
void updateSelectedMove();
|
||||||
|
|
|
@ -77,9 +77,31 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="lineEditFilter">
|
<widget class="QLineEdit" name="lineEditFilterWord">
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>_("Filter")</string>
|
<string>_("Word")</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEditFilterPoints">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>_("Points")</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Add table
Reference in a new issue