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()));
}
Esempio n. 2
0
void DataStore::setPlayerLocation(
  const QString& streetAddress,
  const QString& city,
  const QString& state,
  const QString& zipcode
)
{
  QSettings settings(QSettings::UserScope, getSettingsOrg(), getSettingsApp());
  settings.setValue(getAddressSettingName(), streetAddress);
  settings.setValue(getCitySettingName(), city);
  settings.setValue(getStateSettingName(), state);
  settings.setValue(getZipCodeSettingName(), zipcode);
  serverConnection->setPlayerLocation(streetAddress, city, state, zipcode);
  emit playerLocationSet();
}