summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-29 01:32:53 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-29 01:32:53 +0300
commit6aed2d7d4c6a3cb181f053ba52488cb1a0ea232c (patch)
treeaf9a98a5f55bd9e180d4ed1b09eb261720745e95
parent6427fbb2b35b113965c4d3c9470cced433a70c6d (diff)
downloadplus-6aed2d7d4c6a3cb181f053ba52488cb1a0ea232c.tar.gz
plus-6aed2d7d4c6a3cb181f053ba52488cb1a0ea232c.tar.bz2
plus-6aed2d7d4c6a3cb181f053ba52488cb1a0ea232c.tar.xz
plus-6aed2d7d4c6a3cb181f053ba52488cb1a0ea232c.zip
Fix screenshot directory saving/loading.
-rw-r--r--src/client.cpp4
-rw-r--r--src/configuration.cpp2
-rw-r--r--src/defaults.cpp2
-rw-r--r--src/gui/widgets/setupitem.cpp24
-rw-r--r--src/gui/widgets/setupitem.h9
-rw-r--r--src/gui/widgets/tabs/setup_other.cpp2
6 files changed, 38 insertions, 5 deletions
diff --git a/src/client.cpp b/src/client.cpp
index afc2dd7e6..ea800468f 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2303,7 +2303,7 @@ void Client::initScreenshotDir()
else if (mScreenshotDir.empty())
{
mScreenshotDir = decodeBase64String(
- config.getStringValue("screenshotDirectory2"));
+ config.getStringValue("screenshotDirectory3"));
if (mScreenshotDir.empty())
{
#ifdef __ANDROID__
@@ -2330,7 +2330,7 @@ void Client::initScreenshotDir()
configScreenshotSuffix);
}
}
- config.setValue("screenshotDirectory2",
+ config.setValue("screenshotDirectory3",
encodeBase64String(mScreenshotDir));
}
}
diff --git a/src/configuration.cpp b/src/configuration.cpp
index ca4542155..d4b9f122b 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -202,6 +202,8 @@ const std::string unusedKeys[] =
"OutfitAwayIndex",
"playerHomes",
"remember",
+ "screenshotDirectory",
+ "screenshotDirectory2",
""
};
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 98ef24f7f..c343f9f11 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -152,7 +152,7 @@ DefaultsData* getConfigDefaults()
AddDEF("lastCharacter", "");
AddDEF("altfpslimit", 5);
AddDEF("updatehost", "");
- AddDEF("screenshotDirectory2", "");
+ AddDEF("screenshotDirectory3", "");
AddDEF("useScreenshotDirectorySuffix", true);
AddDEF("screenshotDirectorySuffix", "");
AddDEF("EnableSync", false);
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index 6ce8ce102..b9ea91f76 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -326,6 +326,30 @@ void SetupItemTextField::save()
}
}
+void SetupItemTextField::cancel(const std::string &eventName A_UNUSED)
+{
+ load();
+ if (mUseBase64)
+ mValue = decodeBase64String(mValue);
+ toWidget();
+}
+
+void SetupItemTextField::externalUpdated(const std::string &eventName A_UNUSED)
+{
+ load();
+ if (mUseBase64)
+ mValue = decodeBase64String(mValue);
+ toWidget();
+}
+
+void SetupItemTextField::rereadValue()
+{
+ load();
+ if (mUseBase64)
+ mValue = decodeBase64String(mValue);
+ toWidget();
+}
+
void SetupItemTextField::createControls()
{
load();
diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h
index 91547733f..689f62fdf 100644
--- a/src/gui/widgets/setupitem.h
+++ b/src/gui/widgets/setupitem.h
@@ -96,7 +96,7 @@ class SetupItem : public gcn::ActionListener,
void fixFirstItemSize(gcn::Widget *const widget);
- void rereadValue();
+ virtual void rereadValue();
void setValue(const std::string str)
{ mValue = str; }
@@ -214,6 +214,13 @@ class SetupItemTextField final : public SetupItem
void apply(const std::string &eventName) override final;
+ void cancel(const std::string &eventName A_UNUSED) override final;
+
+ void externalUpdated(const std::string &eventName A_UNUSED)
+ override final;
+
+ void rereadValue() override final;
+
void save() override final;
void setUseBase64(const bool b)
diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp
index 9f3c30dec..985baa744 100644
--- a/src/gui/widgets/tabs/setup_other.cpp
+++ b/src/gui/widgets/tabs/setup_other.cpp
@@ -374,7 +374,7 @@ Setup_Other::Setup_Other(const Widget2 *const widget) :
#ifndef WIN32
// TRANSLATORS: settings option
new SetupItemTextField(_("Screenshot directory"), "",
- "screenshotDirectory2", this, "screenshotDirectory2Event", true, true);
+ "screenshotDirectory3", this, "screenshotDirectory3Event", true, true);
#endif
// TRANSLATORS: settings option