Arbitration: rename a few methods

This commit is contained in:
Olivier Teulière 2013-01-15 20:18:11 +01:00
parent 9ad9b02d57
commit ab14c9a949
3 changed files with 15 additions and 15 deletions

View file

@ -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

View file

@ -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:

View file

@ -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