void Settings::setPlayerName(const QString& newPlayerName)
{
    if (playerName() != newPlayerName) {
        setValue(PLAYERNAME_KEY, newPlayerName);
        emit playerNameChanged(newPlayerName);
    }
}
Esempio n. 2
0
GlobalUISession::GlobalUISession() :
   localHuman_(0), localEngine_(0), localHuman1_(0), localHuman2_(0),
   gameSession_(0), keyRemapIdx_(-1), menuType_(menuNone)
{
   initialize();
   //
   initialPosition_ = ChessPosition::fromString(toStdString(g_settings.initialPositionFen()));
   initialPosition_.setChess960(g_settings.isChess960());
   //
   QObject::connect(&g_settings, SIGNAL(playerNameChanged()), this, SLOT(playerNameChanged()), Qt::UniqueConnection);
   QObject::connect(&g_settings, SIGNAL(engineChanged()), this, SLOT(engineChanged()), Qt::UniqueConnection);
   QObject::connect(&g_settings, SIGNAL(ponderingChanged()), this, SLOT(ponderingChanged()), Qt::UniqueConnection);
   QObject::connect(&g_settings, SIGNAL(localeChanged()), this, SLOT(localeChanged()), Qt::UniqueConnection);
   QObject::connect(&g_localChessGui, SIGNAL(keyPressed(Qt::Key,Qt::KeyboardModifiers)), this, SLOT(keyPressed(Qt::Key, Qt::KeyboardModifiers)), Qt::UniqueConnection);
   QObject::connect(&g_localChessGui, SIGNAL(isExiting()), this, SLOT(isExiting()));
}
Esempio n. 3
0
// Setter
void Battleships::setPlayerName(const QString name)
{
    if (m_playerName != name) {
        m_playerName = name;
        emit playerNameChanged();
    }
}
Esempio n. 4
0
void K3ChessSettings::setPlayerName(const QString& name)
{
   if(name==playerName()) return;
   settings_.setValue("PlayerName", name);
   emit playerNameChanged();
}