diff options
| author | Tannin <devnull@localhost> | 2015-05-12 20:34:05 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-05-12 20:34:05 +0200 |
| commit | 9ea5086c4cd1acf6f462070a5c792a252aa176dd (patch) | |
| tree | 6fca89edbf75b79683260d651a318623b446fc75 /src | |
| parent | 4c1155a6ab2d81ceeab5af78e20873917f3072d0 (diff) | |
slight cleanup regarding steam log-in settings
Diffstat (limited to 'src')
| -rw-r--r-- | src/organizercore.cpp | 6 | ||||
| -rw-r--r-- | src/settings.cpp | 11 | ||||
| -rw-r--r-- | src/settingsdialog.ui | 146 |
3 files changed, 80 insertions, 83 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 2d1febea..ce0b8c5f 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -85,7 +85,7 @@ static void startSteam(QWidget *widget) QSettings steamSettings("HKEY_CURRENT_USER\\Software\\Valve\\Steam", QSettings::NativeFormat);
QString exe = steamSettings.value("SteamExe", "").toString();
if (!exe.isEmpty()) {
- QString temp = QString("\"%1\"").arg(exe);
+ exe = QString("\"%1\"").arg(exe);
//See if username and password supplied. If so, pass them into steam.
QStringList args;
QString username;
@@ -97,8 +97,8 @@ static void startSteam(QWidget *widget) args << password;
}
}
- if (!QProcess::startDetached(temp, args)) {
- reportError(QObject::tr("Failed to start \"%1\"").arg(temp));
+ if (!QProcess::startDetached(exe, args)) {
+ reportError(QObject::tr("Failed to start \"%1\"").arg(exe));
} else {
QMessageBox::information(widget, QObject::tr("Waiting"),
QObject::tr("Please press OK once you're logged into steam."));
diff --git a/src/settings.cpp b/src/settings.cpp index 57e422bb..71eb37d5 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -259,13 +259,10 @@ bool Settings::getNexusLogin(QString &username, QString &password) const bool Settings::getSteamLogin(QString &username, QString &password) const { - if (m_Settings.contains("Settings/steam_username")) { - username = m_Settings.value("Settings/steam_username", "").toString(); - if (m_Settings.contains("Settings/steam_password")) { - password = deObfuscate(m_Settings.value("Settings/steam_password", "").toString()); - } else { - password = ""; - } + if (m_Settings.contains("Settings/steam_username") + && m_Settings.contains("Settings/steam_password")) { + username = m_Settings.value("Settings/steam_username").toString(); + password = deObfuscate(m_Settings.value("Settings/steam_password").toString()); return true; } else { return false; diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index f2ab3908..b88885dc 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -455,6 +455,79 @@ p, li { white-space: pre-wrap; } </item>
</layout>
</widget>
+ <widget class="QWidget" name="steamTab">
+ <attribute name="title">
+ <string>Steam</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_19">
+ <property name="text">
+ <string>Username</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="steamUserEdit"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_20">
+ <property name="text">
+ <string>Password</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="steamPassEdit">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <spacer name="verticalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="0" colspan="2">
+ <widget class="QLabel" name="label_21">
+ <property name="text">
+ <string>If you save your steam user ID and password here, they will be used when logging into steam. Note, however, your password will be stored unencrypted, so make sure your computer is secure.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <spacer name="verticalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>232</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
<widget class="QWidget" name="pluginsTab">
<attribute name="title">
<string>Plugins</string>
@@ -811,79 +884,6 @@ For the other games this is not a sufficient replacement for AI!</string> </item>
</layout>
</widget>
- <widget class="QWidget" name="steamTab">
- <attribute name="title">
- <string>Steam</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="label_19">
- <property name="text">
- <string>Username</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="3">
- <widget class="QLabel" name="label_21">
- <property name="text">
- <string>If you save your steam user ID and password here, they will be used when logging into steam. Note, however, your password will be stored unencrypted, so make sure your computer is secure.</string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_20">
- <property name="text">
- <string>Password</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLineEdit" name="steamUserEdit"/>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="steamPassEdit">
- <property name="echoMode">
- <enum>QLineEdit::Password</enum>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <spacer name="verticalSpacer_4">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0">
- <spacer name="verticalSpacer_5">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Minimum</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
</widget>
</item>
<item>
|
