mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-29 20:34:56 +01:00
Arbitration: a click on the master move previews it on the board
This commit is contained in:
parent
35acc7b7a3
commit
e77923674f
3 changed files with 24 additions and 1 deletions
|
@ -145,6 +145,9 @@ ArbitrationWidget::ArbitrationWidget(QWidget *parent,
|
|||
QObject::connect(treeViewResults->selectionModel(),
|
||||
SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
|
||||
this, SLOT(showPreview(const QItemSelection&)));
|
||||
// Display a preview of the master word when clicked
|
||||
QObject::connect(labelMasterMove, SIGNAL(clicked()),
|
||||
this, SLOT(showMasterPreview()));
|
||||
|
||||
// Dynamic filter for search results
|
||||
QObject::connect(lineEditFilter, SIGNAL(textChanged(const QString&)),
|
||||
|
@ -747,6 +750,18 @@ void ArbitrationWidget::showPreview(const QItemSelection &iSelected)
|
|||
}
|
||||
|
||||
|
||||
void ArbitrationWidget::showMasterPreview()
|
||||
{
|
||||
const Move &move = m_game->duplicateGetMasterMove();
|
||||
if (move.getType() == Move::VALID_ROUND)
|
||||
{
|
||||
treeViewResults->clearSelection();
|
||||
m_game->setTestRound(move.getRound());
|
||||
}
|
||||
emit gameUpdated();
|
||||
}
|
||||
|
||||
|
||||
Rack ArbitrationWidget::getRack() const
|
||||
{
|
||||
return m_game->getHistory().getCurrentRack().getRack();
|
||||
|
|
|
@ -67,6 +67,7 @@ private slots:
|
|||
void enableAssignmentButtons();
|
||||
void clearResults();
|
||||
void showPreview(const QItemSelection &);
|
||||
void showMasterPreview();
|
||||
void updateCoordText(const Coord&, const Coord&);
|
||||
void updateCoordModel(const QString&);
|
||||
void populateResultsMenu(QMenu &iMenu, const QPoint &iPoint);
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelMasterMove">
|
||||
<widget class="ClickableLabel" name="labelMasterMove">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -290,6 +290,13 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ClickableLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header location="global">misc_helpers.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>lineEditRack</tabstop>
|
||||
<tabstop>buttonRandom</tabstop>
|
||||
|
|
Loading…
Add table
Reference in a new issue