From ab14c9a9497c527ce1e7acee8d11e98bade503eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Tue, 15 Jan 2013 20:18:11 +0100 Subject: [PATCH] Arbitration: rename a few methods --- qt/arbit_assignments.cpp | 16 ++++++++-------- qt/arbit_assignments.h | 6 +++--- qt/arbitration_widget.cpp | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/qt/arbit_assignments.cpp b/qt/arbit_assignments.cpp index de63157..db76745 100644 --- a/qt/arbit_assignments.cpp +++ b/qt/arbit_assignments.cpp @@ -118,7 +118,7 @@ ArbitAssignments::ArbitAssignments(QWidget *parent, PublicGame *iGame) // Move assignment QObject::connect(buttonSelectMaster, SIGNAL(clicked()), - this, SLOT(assignMasterMove())); + this, SLOT(setMasterMove())); QObject::connect(buttonSuppressMove, SIGNAL(clicked()), this, SLOT(suppressMove())); QObject::connect(buttonAssign, SIGNAL(clicked()), @@ -162,7 +162,7 @@ void ArbitAssignments::refresh() setEnabled(!m_game->isFinished()); enableAssignmentButtons(); - buttonSelectMaster->setEnabled(isAssignMasterAllowed()); + buttonSelectMaster->setEnabled(isSetMasterAllowed()); buttonEndTurn->setEnabled(isEndTurnAllowed()); } @@ -269,7 +269,7 @@ void ArbitAssignments::enableAssignmentButtons() .arg(formatMove(move))); } buttonSuppressMove->setEnabled(isSuppressMoveAllowed()); - buttonSelectMaster->setEnabled(isAssignMasterAllowed()); + buttonSelectMaster->setEnabled(isSetMasterAllowed()); } @@ -414,7 +414,7 @@ void ArbitAssignments::showMasterPreview() const Move &move = m_game->duplicateGetMasterMove(); if (move.isValid()) { - // TODO: deselect move in the Results? + // TODO: deselect move in the Results? or reselect the master move? m_game->setTestRound(move.getRound()); emit gameUpdated(); } @@ -428,16 +428,16 @@ void ArbitAssignments::selectAllPlayers() } -bool ArbitAssignments::isAssignMasterAllowed() const +bool ArbitAssignments::isSetMasterAllowed() const { return m_game->isLastTurn() && m_selectedMove.isValid() && !m_game->hasMasterGame(); } -void ArbitAssignments::assignMasterMove() +void ArbitAssignments::setMasterMove() { - if (!isAssignMasterAllowed()) + if (!isSetMasterAllowed()) return; const Move &masterMove = m_game->duplicateGetMasterMove(); @@ -505,7 +505,7 @@ void ArbitAssignments::assignMasterMove() } -void ArbitAssignments::assignDefaultMasterMove() +void ArbitAssignments::setDefaultMasterMove() { const Move &currMove = m_game->duplicateGetMasterMove(); // Do not overwrite an existing move diff --git a/qt/arbit_assignments.h b/qt/arbit_assignments.h index 3213207..95526f6 100644 --- a/qt/arbit_assignments.h +++ b/qt/arbit_assignments.h @@ -53,7 +53,7 @@ public: */ bool selectPlayerByTable(unsigned tabNb, QString *oName); - bool isAssignMasterAllowed() const; + bool isSetMasterAllowed() const; bool isAssignMoveAllowed() const; bool isSuppressMoveAllowed() const; bool isEndTurnAllowed() const; @@ -69,9 +69,9 @@ public slots: void refresh(); void enableAssignmentButtons(); void selectAllPlayers(); - void assignMasterMove(); + void setMasterMove(); + void setDefaultMasterMove(); void assignSelectedMove(); - void assignDefaultMasterMove(); void selectedMoveChanged(const Move&); private slots: diff --git a/qt/arbitration_widget.cpp b/qt/arbitration_widget.cpp index 0404795..2a27046 100644 --- a/qt/arbitration_widget.cpp +++ b/qt/arbitration_widget.cpp @@ -120,7 +120,7 @@ ArbitrationWidget::ArbitrationWidget(QWidget *parent, shortcut = new QShortcut(QString("Shift+M"), treeViewResults); shortcut->setContext(Qt::WidgetWithChildrenShortcut); QObject::connect(shortcut, SIGNAL(activated()), - m_assignmentsWidget, SLOT(assignMasterMove())); + m_assignmentsWidget, SLOT(setMasterMove())); shortcut = new QShortcut(QString("Shift+A"), treeViewResults); shortcut->setContext(Qt::WidgetWithChildrenShortcut); @@ -510,7 +510,7 @@ void ArbitrationWidget::searchResults() QSettings settings; if (settings.value(PrefsDialog::kARBIT_AUTO_MASTER, false).toBool()) { - m_assignmentsWidget->assignDefaultMasterMove(); + m_assignmentsWidget->setDefaultMasterMove(); } // Set the focus to the first result @@ -541,9 +541,9 @@ void ArbitrationWidget::populateResultsMenu(QMenu &iMenu, const QPoint &iPoint) .arg(formatMove(move))); setAsMasterAction->setShortcut(Qt::SHIFT + Qt::Key_M); QObject::connect(setAsMasterAction, SIGNAL(triggered()), - m_assignmentsWidget, SLOT(assignMasterMove())); + m_assignmentsWidget, SLOT(setMasterMove())); iMenu.addAction(setAsMasterAction); - if (!m_assignmentsWidget->isAssignMasterAllowed()) + if (!m_assignmentsWidget->isSetMasterAllowed()) setAsMasterAction->setEnabled(false); // Action to select all the players