コード例 #1
0
ファイル: DataStore.hpp プロジェクト: UDJ/UDJ-Desktop-Client
 /**
  * \brief Retrieves a string describing the location of the player.
  *
  * @return A string describing the locaiton of the player.
  */
 inline QString getLocationString() const{
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return 
     settings.value(getAddressSettingName()).toString() + " " + 
     settings.value(getCitySettingName()).toString() + " " +
     settings.value(getStateSettingName()).toString() + ", " +
     settings.value(getZipCodeSettingName()).toString();
 }
コード例 #2
0
ファイル: DataStore.cpp プロジェクト: UDJ/UDJ-Desktop-Client
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();
}
コード例 #3
0
ファイル: DataStore.hpp プロジェクト: UDJ/UDJ-Desktop-Client
 /**
  * \brief Determines whether or not this player has a player id.
  *
  * \return True if the player has an id, false otherwise.
  */
 static bool hasPlayerId(){
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return -1 != settings.value(getPlayerIdSettingName(), -1);
 }
コード例 #4
0
ファイル: DataStore.hpp プロジェクト: UDJ/UDJ-Desktop-Client
 /**
  * \brief Retrieves the state of the player.
  *
  * @return The state of the player.
  */
 const QString getPlayerState() const{
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return settings.value(getPlayerStateSettingName()).toString();
 }
コード例 #5
0
ファイル: DataStore.hpp プロジェクト: UDJ/UDJ-Desktop-Client
 /**
  * \brief Gets the set location zipcode. If no zipcode is currently set,
  * 0 is returned.
  *
  * \return The set location zipcode or 0 if no address is set.
  */
 inline int getLocationZipcode() const{
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return settings.value(getZipCodeSettingName()).toInt();
 }
コード例 #6
0
ファイル: DataStore.hpp プロジェクト: UDJ/UDJ-Desktop-Client
 /**
  * \brief Gets the set location state. If no location is currently set,
  * an empty string is returned.
  *
  * \return The set location state or an empty string if no address is set.
  */
 inline QString getLocationState() const{
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return settings.value(getStateSettingName()).toString();
 }
コード例 #7
0
ファイル: DataStore.hpp プロジェクト: UDJ/UDJ-Desktop-Client
 /**
  * \brief Determines whether or not the player has a password.
  *
  * @return True if the player has a password, false otherwise.
  */
 inline bool hasPlayerPassword() const{
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return settings.value(getHasPlayerPasswordSettingName(), false).toBool();
 }
コード例 #8
0
ファイル: DataStore.hpp プロジェクト: UDJ/UDJ-Desktop-Client
 /**
  * \brief Determines whether or not the player's location has been set.
  *
  * @return True if the player's location is set, false otherwise.
  */
 inline bool hasLocation() const{
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return settings.contains(getAddressSettingName());
 }
コード例 #9
0
ファイル: DataStore.hpp プロジェクト: UDJ/UDJ-Desktop-Client
 /**
  * \brief Gets the volume of the player.
  *
  * @return The volume of the player.
  */
 inline qreal getPlayerVolume() const{
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return settings.value(getPlayerVolumeSettingName()).value<qreal>();
 }
コード例 #10
0
ファイル: DataStore.cpp プロジェクト: UDJ/UDJ-Desktop-Client
void DataStore::setPlayerState(const QString& newState){
  QSettings settings(QSettings::UserScope, getSettingsOrg(), getSettingsApp());
  settings.setValue(getPlayerStateSettingName(), newState);
  changingPlayerState = true;
  serverConnection->setPlayerState(newState);
}
コード例 #11
0
ファイル: DataStore.cpp プロジェクト: UDJ/UDJ-Desktop-Client
void DataStore::setPlayerPassword(const QString& newPassword){
  QSettings settings(QSettings::UserScope, getSettingsOrg(), getSettingsApp());
  settings.setValue(getHasPlayerPasswordSettingName(), true);
  serverConnection->setPlayerPassword(newPassword);
  emit playerPasswordSet();
}
コード例 #12
0
ファイル: DataStore.cpp プロジェクト: UDJ/UDJ-Desktop-Client
void DataStore::removePlayerPassword(){
  QSettings settings(QSettings::UserScope, getSettingsOrg(), getSettingsApp());
  settings.setValue(getHasPlayerPasswordSettingName(), false);
  serverConnection->removePlayerPassword();
  emit playerPasswordRemoved();
}
コード例 #13
0
 /**
  * \brief Retreives the password for the player.
  *
  * @return The password for the player, if none is set a blank string is returned.
  */
 inline QString getPlayerPassword() const{
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return settings.value(getPlayerPasswordSettingName()).toString();
 }
コード例 #14
0
 /**
  * \brief Determines whether or not the player has a password.
  *
  * @return True if the player has a password, false otherwise.
  */
 inline bool hasPlayerPassword() const{
   QSettings settings(
     QSettings::UserScope, getSettingsOrg(), getSettingsApp());
   return settings.contains(getPlayerPasswordSettingName());
 }