From dfc992f467eb841c91b04185b525842534820d40 Mon Sep 17 00:00:00 2001 From: LostDragonist Date: Wed, 6 Mar 2019 17:20:53 -0600 Subject: Add setting to hide the API counter --- src/mainwindow.cpp | 3 +++ src/settings.cpp | 9 ++++++++- src/settings.h | 6 ++++++ src/settingsdialog.cpp | 13 ------------- src/settingsdialog.ui | 13 +++++++++++++ 5 files changed, 30 insertions(+), 14 deletions(-) (limited to 'src') 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("preferredServersList")) , m_endorsementBox(dialog.findChild("endorsementBox")) + , m_hideAPICounterBox(dialog.findChild("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 @@ -276,6 +276,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 */ @@ -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("usernameEdit"); -// QLineEdit *passwordEdit = findChild("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; } + + + + <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> + + + <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> + + + Hide API Request Counter + + + -- cgit v1.3.1