summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-08-17 07:42:37 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-08-17 07:42:37 -0400
commitd9cb15f1d117b91f0d75c1b7702696f7da93d3d2 (patch)
tree7f1a242efb2dc56265edd4f72552695f46dc944c /src/settings.cpp
parent965eccb328a0a2b0cb4d1945a0382df9f0f91147 (diff)
put endorsement state and first start in settings
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 40f4dd95..882984f3 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -489,6 +489,11 @@ bool Settings::getFirstStart() const
return getOptional<bool>(m_Settings, "first_start").value_or(true);
}
+void Settings::setFirstStart(bool b)
+{
+ m_Settings.setValue("first_start", b);
+}
+
std::optional<QColor> Settings::getPreviousSeparatorColor() const
{
const auto c = getOptional<QColor>(m_Settings, "previousSeparatorColor");
@@ -689,6 +694,19 @@ bool Settings::endorsementIntegration() const
return m_Settings.value("Settings/endorsement_integration", true).toBool();
}
+EndorsementState Settings::endorsementState() const
+{
+ const auto v = getOptional<QString>(m_Settings, "endorse_state");
+
+ if (!v) {
+ return EndorsementState::NoDecision;
+ } else if (*v == "Abstained") {
+ return EndorsementState::Refused;
+ } else {
+ return EndorsementState::Accepted;
+ }
+}
+
bool Settings::hideAPICounter() const
{
return m_Settings.value("Settings/hide_api_counter", false).toBool();