PlayerDashboard::PlayerDashboard(DataStore *dataStore, QWidget *parent):
  QWidget(parent),
  dataStore(dataStore)
{
  setupUi();
  connect(
    dataStore,
    SIGNAL(playerCreated()),
    this,
    SLOT(setPlayerInfo()));
  connect(
    dataStore,
    SIGNAL(playerNameChanged(const QString&)),
    this,
    SLOT(setPlayerInfo()));
  connect(
    dataStore,
    SIGNAL(playerLocationSet()),
    this,
    SLOT(setPlayerInfo()));
  connect(
    dataStore,
    SIGNAL(playerPasswordSet()),
    this,
    SLOT(setPlayerInfo()));
  connect(
    dataStore,
    SIGNAL(playerPasswordRemoved()),
    this,
    SLOT(setPlayerInfo()));
}
Exemplo n.º 2
0
void DataStore::setPlayerPassword(const QString& newPassword){
  QSettings settings(QSettings::UserScope, getSettingsOrg(), getSettingsApp());
  settings.setValue(getHasPlayerPasswordSettingName(), true);
  serverConnection->setPlayerPassword(newPassword);
  emit playerPasswordSet();
}