summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2019-01-27 03:43:18 -0600
committerSilarn <jrim@rimpo.org>2019-02-18 21:27:32 -0600
commit7de78b6697b60ac20add32b5b9140b04da973be8 (patch)
tree44664f89b93a416cafe39fa5c114ba50cdf81431 /src/settings.cpp
parent9fe2f6126dc7b9396d188b57ccb097f0035f57b7 (diff)
Several Nexus API-related changes
* Added 30-second ping so Nexus doesn't close our connection * Set an overall 5 minute timeout before we give up listening for auth * Fixed some old signal and slot connections * Added a button to revoke the current API authorization * Updated bulk endorsement function with new API changes
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 7a1d6737..fdc767bf 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -674,6 +674,13 @@ void Settings::processApiKey(const QString &apiKey)
m_Settings.setValue("Settings/nexus_api_key", obfuscate(apiKey));
}
+void Settings::clearApiKey(QPushButton *nexusButton)
+{
+ m_Settings.remove("Settings/nexus_api_key");
+ nexusButton->setEnabled(true);
+ nexusButton->setText("Connect to Nexus");
+}
+
void Settings::checkApiKey(QPushButton *nexusButton)
{
if (m_Settings.value("Settings/nexus_api_key", "").toString().isEmpty()) {
@@ -692,6 +699,7 @@ void Settings::query(PluginContainer *pluginContainer, QWidget *parent)
connect(&dialog, SIGNAL(resetDialogs()), this, SLOT(resetDialogs()));
connect(&dialog, SIGNAL(processApiKey(const QString &)), this, SLOT(processApiKey(const QString &)));
connect(&dialog, SIGNAL(closeApiConnection(QPushButton *)), this, SLOT(checkApiKey(QPushButton *)));
+ connect(&dialog, SIGNAL(revokeApiKey(QPushButton *)), this, SLOT(clearApiKey(QPushButton *)));
std::vector<std::unique_ptr<SettingsTab>> tabs;