diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2019-03-06 17:20:53 -0600 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2019-03-06 17:20:53 -0600 |
| commit | dfc992f467eb841c91b04185b525842534820d40 (patch) | |
| tree | 369c2e18a49a2682b6923a68e7079bb0d4dd6608 /src | |
| parent | fa44740193e510df569441016d40e74b8dc6fca1 (diff) | |
Add setting to hide the API counter
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 3 | ||||
| -rw-r--r-- | src/settings.cpp | 9 | ||||
| -rw-r--r-- | src/settings.h | 6 | ||||
| -rw-r--r-- | src/settingsdialog.cpp | 13 | ||||
| -rw-r--r-- | src/settingsdialog.ui | 13 |
5 files changed, 30 insertions, 14 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index bb1a9ec5..58c80b87 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -369,6 +369,7 @@ MainWindow::MainWindow(QSettings &initSettings palette.setColor(ui->apiRequests->backgroundRole(), Qt::darkGreen); palette.setColor(ui->apiRequests->foregroundRole(), Qt::white); ui->apiRequests->setPalette(palette); + ui->apiRequests->setVisible(!m_OrganizerCore.settings().hideAPICounter()); connect(ui->savegameList, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(saveSelectionChanged(QListWidgetItem*))); @@ -4912,6 +4913,8 @@ void MainWindow::on_actionSettings_triggered() activateProxy(settings.useProxy()); } + ui->apiRequests->setVisible(!settings.hideAPICounter()); + updateDownloadView(); m_OrganizerCore.updateVFSParams(settings.logLevel(), settings.crashDumpsType(), settings.executablesBlacklist()); diff --git a/src/settings.cpp b/src/settings.cpp index 942005f8..1e932e49 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -506,6 +506,11 @@ bool Settings::endorsementIntegration() const return m_Settings.value("Settings/endorsement_integration", true).toBool(); } +bool Settings::hideAPICounter() const +{ + return m_Settings.value("Settings/hide_api_counter", false).toBool(); +} + bool Settings::displayForeign() const { return m_Settings.value("Settings/display_foreign", true).toBool(); @@ -1025,6 +1030,7 @@ Settings::NexusTab::NexusTab(Settings *parent, SettingsDialog &dialog) , m_preferredServersList( dialog.findChild<QListWidget *>("preferredServersList")) , m_endorsementBox(dialog.findChild<QCheckBox *>("endorsementBox")) + , m_hideAPICounterBox(dialog.findChild<QCheckBox *>("hideAPICounterBox")) { if (!deObfuscate("APIKEY").isEmpty()) { m_nexusConnect->setText("Nexus API Key Stored"); @@ -1034,7 +1040,7 @@ Settings::NexusTab::NexusTab(Settings *parent, SettingsDialog &dialog) m_offlineBox->setChecked(parent->offlineMode()); m_proxyBox->setChecked(parent->useProxy()); m_endorsementBox->setChecked(parent->endorsementIntegration()); - + m_hideAPICounterBox->setChecked(parent->hideAPICounter()); // display server preferences m_Settings.beginGroup("Servers"); @@ -1079,6 +1085,7 @@ void Settings::NexusTab::update() m_Settings.setValue("Settings/offline_mode", m_offlineBox->isChecked()); m_Settings.setValue("Settings/use_proxy", m_proxyBox->isChecked()); m_Settings.setValue("Settings/endorsement_integration", m_endorsementBox->isChecked()); + m_Settings.setValue("Settings/hide_api_counter", m_hideAPICounterBox->isChecked()); // store server preference m_Settings.beginGroup("Servers"); diff --git a/src/settings.h b/src/settings.h index 3744a493..324fa0b6 100644 --- a/src/settings.h +++ b/src/settings.h @@ -277,6 +277,11 @@ public: bool endorsementIntegration() const; /** + * @return true if the API counter should be hidden + */ + bool hideAPICounter() const; + + /** * @return true if the user wants to see non-official plugins installed outside MO in his mod list */ bool displayForeign() const; @@ -481,6 +486,7 @@ private: QListWidget *m_knownServersList; QListWidget *m_preferredServersList; QCheckBox *m_endorsementBox; + QCheckBox *m_hideAPICounterBox; }; /** Display/store the configuration in the 'steam' tab of the settings dialogue */ diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index ee7edead..f9f4f255 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -131,19 +131,6 @@ bool SettingsDialog::getResetGeometries() return ui->resetGeometryBtn->isChecked(); } -//void SettingsDialog::on_loginCheckBox_toggled(bool checked) -//{ -// QLineEdit *usernameEdit = findChild<QLineEdit*>("usernameEdit"); -// QLineEdit *passwordEdit = findChild<QLineEdit*>("passwordEdit"); -// if (checked) { -// passwordEdit->setEnabled(true); -// usernameEdit->setEnabled(true); -// } else { -// passwordEdit->setEnabled(false); -// usernameEdit->setEnabled(false); -// } -//} - void SettingsDialog::on_categoriesBtn_clicked() { CategoriesDialog dialog(this); diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index e56b3435..d6ac76a8 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -578,6 +578,19 @@ p, li { white-space: pre-wrap; } </property> </widget> </item> + <item row="1" column="1"> + <widget class="QCheckBox" name="hideAPICounterBox"> + <property name="toolTip"> + <string><html><head/><body><p>By default, a counter is displayed under the mod list. This informs the user of their remaining API requests. The Nexus API becomes unusable once these API requests run out. Checking this option will hide that counter.</p></body></html></string> + </property> + <property name="whatsThis"> + <string><html><head/><body><p>By default, a counter is displayed under the mod list. This informs the user of their remaining API requests. The Nexus API becomes unusable once these API requests run out. Checking this option will hide that counter.</p></body></html></string> + </property> + <property name="text"> + <string>Hide API Request Counter</string> + </property> + </widget> + </item> </layout> </item> <item> |
