aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences/preferences_language.cpp
AgeCommit message (Collapse)Author
2020-12-29cleanup: remove getDivesInTrip() in qthelper.cppGravatar Berthold Stoeger
This function was not used anywhere. Moreover, remove a few unused includes from qthelper.h. Surprisingly, a number of users of qthelper.h depend on these, so readd them at the appropriate places. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-22desktop: refresh date/time format when switching to system defaultsGravatar Berthold Stoeger
When switching to system defaults, refresh the fields in the preferences UI so that the user can tell how the fields will be formatted. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-22cleanup: remove unnecessary <QDebug> includeGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-22cleanup: split uiLanguage() in two functionsGravatar Berthold Stoeger
The uiLanguage() function was used for two purposes: to initialize the language related preferences and to read the current language. To make things more easy to follow, split this function in two: one for initializing, one for getting the current language. Moreover, don't return the current locale in an out-parameter as there is already a function to do that [getLocale()]. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-25Preferences UI: add dive log tabGravatar willemferguson
This adds a tab for dive log - related preferences. A suitable test programs is still required. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-15desktop-widgets/preferences: reemove SettingsObjectWrapperGravatar jan Iversen
remove use of SettingsObjectWrapper:: remove include of SettingsObjectWrapper.h use qPrefFoo:: for setters and getters replace prefs.foo with qPrefXYZ::foo() where feasible (this expands to the same code, but gives us more control over the variable). Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-13core: activate qPrefLanguageGravatar jan Iversen
remove Language from SettingsObjectWrapper and reference qPrefLanguage update files using SettingsObjectWrapper/Language to use qPrefLanguage this activated qPrefLanguage and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-04Cleanup: fold core/helpers.h into core/qthelper.hGravatar Berthold Stoeger
helpers.h included qthelper.h and all functions declared in helpers.h were defined in qthelper.h. Therefore fold the former into the latter, since the split seems completely arbitrary. While doing so, change the return-type of get_dc_nichname from "const QString" to "QString". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-02Cleanup: Rename preferences ui file names according the standardGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-30Use better aliases for icons.Gravatar Martin Měřinský
Icon aliases were complete mess. Some icons had alias some didn't. Named with underscores vs. hyphens vs. camelCase. Lower vs. upper case. "ICON" prefix vs. suffix vs. nothing. With vs. without filename suffix. Some didn't make sence. Eg. mapwidget-marker-gray (I can see, it's grey, but what does it represent?) Some were duplicated, eg warning vs. warning-icon. Some were name after widget, which is wrong. Do not reinvent wheel. Use widely used naming scheme close to Freedesktop Icon Naming Specification. This will enable usage of common icons from current set in the future. Thus Subsurface will fit nicely to GUI. This changes icon aliases to one, easy grep-able style. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-30Use icons relative path.Gravatar Martin Měřinský
Icon paths are defined in one place only - application's embedded resources. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-29Revert "Use icons relative path."Gravatar Dirk Hohndel
This reverts commit b0d98f6e269be9560de1b9c140855c85fecf1dd1.
2017-11-29Revert "Use consistent aliases for all icons."Gravatar Dirk Hohndel
This reverts commit 92e9c6606f6ef3ad16d2e31f9f9a8f5fa14f2c1a.
2017-11-29Use consistent aliases for all icons.Gravatar Martin Měřinský
Icon aliases were inconsistent mess. Underscores vs. hyphens vs. camelCase. With vs. without filename suffix. Lower vs. upper case. "icon" suffix vs. prefix vs. nothing. Some were duplicated, eg warning vs. warning-icon. Some icons didn't have alias at all. This changes all icon aliases to one, easy grep-able style which complies to Freedesktop Icon Naming Specification (Guidelines). Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-29Use icons relative path.Gravatar Martin Měřinský
Icon paths are defined in one place only - application's embedded resources. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-10preferences: support a pre-defined list of time formatsGravatar Lubomir I. Ivanov
Add a combo-box that holds a list of pre-defined time formats in the Language preferences. The user is still allowed to enter a custom time format. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-10preferences: re-use a tr() string in _language.cppGravatar Lubomir I. Ivanov
Also, tell "in date format" instead of "in time format" for dates. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-10preferences: support a pre-defined list of date formatsGravatar Lubomir I. Ivanov
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>
2017-09-16Remove some very small marble leftoversGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-04googlemaps: clear the cache folder on language changeGravatar Lubomir I. Ivanov
Open the cache folder via QDir and call removeRecursively(). At that point the user needs to restart Subsurface to be able to use the map in another language properly. This change is triggered by the fact that the user might want to see the street map in his preferred language after he/she picks another language from Settings. But one problem here is that the cached files do not carry a language flag - e.g. they are in the lines of: googlemaps_100-1-9-445-245.png Which means that the only way to not mix tiles in different languages is to clear the cache and start downloading the new tiles in the newly picked language after Subsurface has restarted. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-04-29Add SPDX header to desktop widgetsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-28Warn user about wrong characters in date/time format stringsGravatar Robert C. Helling
fixes #1098 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20Language preference: store the locale name in the settingsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20Language preference: search for the locale instead of the language stringGravatar Dirk Hohndel
And make sure that you use the language / country delimiter that we use in the file system Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27Settings update: Fix missing groups and Language initializationGravatar Tomaz Canabrava
There's one function named uiLanguage() that should return the current uiLanguage() that subsurface is running, but it actually sets a whole lot of preferences, I think that the general idea of that function is okay, but it seems broken for me. still, I used it to load the correct language from the preferences since it's what this function is currently doing right now. Also, a lot of missing groups where added. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27Settings update: Remove uneeded includesGravatar Tomaz Canabrava
and comment out questionable code. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27Settings update: Fix "Language" settingsGravatar Tomaz Canabrava
Save the language settings using the SettingsObjectWrapper. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27Settings update: Use internal prefs structure to read preferencesGravatar Tomaz Canabrava
Don't use a QSettings to read properties, it's really easy to mispell something. Just use the internal prefs structure. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02Preferences: make apply workGravatar Dirk Hohndel
We didn't respond at all to that button. Also, the language settings didn't propagate without this explicit call. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02Preferences: hook up the UI page with the preferences structureGravatar Dirk Hohndel
With this the new date and time formats mostly work Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30Preferences: switch language preference to be a dropdownGravatar Dirk Hohndel
The list widget takes too much space and isn't really any better. The dropdown plus fliter is actually rather neat. Also added back the connections so the dropdown and filter get disabled when system default is selected (just as it was in the old preferences dialog). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30Code cleanupGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30Preferences: hook up the missing parts for the language prefs uiGravatar Tomaz Canabrava
And this actually made me find one memory leak on the old version: We are constantly creating / leaking a new QSortFilterProxyModel everytime a sync() is done on the settings. That's not a lot, maybe once per time a user changes its settings... but it's still a leak. And the code is more sanely separated this time. yey. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30Preferences: add a new page for languageGravatar Tomaz Canabrava
This is not hooked into anything - It's the bare minimum that I need to continue creating the new preferences dialog. But take a look at it... very simple. :) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>