summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences/preferences_language.h
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-11-10 16:52:12 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-11-10 09:21:47 -0800
commit2c06cb027f20eee42769fb3a56e41c87b1a4d252 (patch)
treef10ca05b6a01ebfb020c53ae740efc1e01a0a7af /desktop-widgets/preferences/preferences_language.h
parentf1437cfec7978929a09ff7b1f5ad3a013dd0c713 (diff)
downloadsubsurface-2c06cb027f20eee42769fb3a56e41c87b1a4d252.tar.gz
preferences: support a pre-defined list of date formats
Add a combo-box in place of the single line text field and support some pre-defined date formats, such as: MM/dd/yyyy Each long format has a corresponding short variant stored in the QMap dateFormatShortMap and it's updated automatically once the user selects a combo box item for the long format. The regex for dates is slighly modified: [^dMy/\\s:;\\.,\\-] The user is still allowed to enter custom long / short date foramats. Fixes #276 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'desktop-widgets/preferences/preferences_language.h')
-rw-r--r--desktop-widgets/preferences/preferences_language.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop-widgets/preferences/preferences_language.h b/desktop-widgets/preferences/preferences_language.h
index aaff67eed..4ff268b87 100644
--- a/desktop-widgets/preferences/preferences_language.h
+++ b/desktop-widgets/preferences/preferences_language.h
@@ -2,6 +2,7 @@
#ifndef PREFERENCES_LANGUAGE_H
#define PREFERENCES_LANGUAGE_H
+#include <QMap>
#include "abstractpreferenceswidget.h"
namespace Ui {
@@ -17,6 +18,9 @@ public:
virtual void syncSettings();
private:
Ui::PreferencesLanguage *ui;
+ QMap<QString, QString> dateFormatShortMap;
+public slots:
+ void dateFormatChanged(const QString&);
};
#endif