void Settings::setPlayerName(const QString& newPlayerName) { if (playerName() != newPlayerName) { setValue(PLAYERNAME_KEY, newPlayerName); emit playerNameChanged(newPlayerName); } }
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())); }
// Setter void Battleships::setPlayerName(const QString name) { if (m_playerName != name) { m_playerName = name; emit playerNameChanged(); } }
void K3ChessSettings::setPlayerName(const QString& name) { if(name==playerName()) return; settings_.setValue("PlayerName", name); emit playerNameChanged(); }