aboutsummaryrefslogtreecommitdiffstats
path: root/core/qt-init.cpp
AgeCommit message (Collapse)Author
2020-01-26code cleanup: QLatin1Literal is deprecated in Qt 5.14Gravatar Dirk Hohndel
Simply replace it with QLatin1String. There is a tiny performance penalty, but none of that code would care. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-20Translations: try to be smarter when picking the right localeGravatar Dirk Hohndel
I was reminded to do this when a user in French speaking Switzerland reasonably suggested that fr_FR would be a much better fallback than en_US in their situation. Fixes: #2388 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14Stop support Qt versions before 5.9Gravatar Dirk Hohndel
There's just no point to testing these outdated versions. Everything we build is now Qt 5.9 or newer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-08-08Cleanup: move error reporting function declarations to errorhelper.hGravatar Berthold Stoeger
Move the declarations of the "report_error()" and "set_error_cb()" functions and the "verbose" variable to errorhelper.h. Thus, error-reporting translation units don't have to import the big dive.h header file. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-07-18Cleanup: remove includes from qthelper.hGravatar Berthold Stoeger
To reduce interdependencies, remove the dive.h and divelist.h includes in qthelper.h Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-11-01Core: use British translations in South AfricaGravatar Dirk Hohndel
For unrecognized locales we use en_US by default. It makes much more sense for South Africa to use en_GB. Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-09Set desktop file name to avoid a broken icon under KDE WaylandGravatar Alexander Wilms
Signed-off-by: Alexander Wilms <f.alexander.wilms@gmail.com>
2018-08-15core: remove SettingsObjectWrapper and update qPref callsGravatar 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-15core: use qPref::load/syncGravatar jan Iversen
use qPref instead of SettingsObjectWrapper for load/sync (seems sync is only used for testing) Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-13Disable the WindowContextHelpButtonHint for Qt >=5.10Gravatar Stefan Fuchs
Disables the WindowContextHelpButtonHint by default on Qt::Sheet and Qt::Dialog widgets. This hides the ? button on Windows, which only makes sense if you use QWhatsThis functionality. This value has been added in Qt 5.10. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-07-03iOS: find translations againGravatar Dirk Hohndel
commit ec0511e824 ("ios: concentrate build dirs") moved the translations around without updating the way they are accessed, causing our release 2.1.0 on iOS to not be localized. Signed-off-by: Dirk Hohndel <dirk@hohndel.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-03-14Cleanup: Set text encoding to UTF-8 for all platforms.Gravatar Berthold Stoeger
This was only done explicitly for Windows. Other platforms were implicitly supposed to be UTF-8. Suggested-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-19Use different preference file for mobileGravatar Jan Mulder
This is a change mainly for developers working on both mobile and desktop application. As the current setup is that all preferences are stored in one file (Subsurface.conf), for both mobile and desktop, the unwary developer might get confused that the things tested on mobile-on-desktop are not working on mobile-on-device. As we share a lot of code between the desktop and the mobile code, also our fairly extensive set of preferences play a significant role in the inner workings of our applications. So, this commit introduces an own preferences file for mobile (on desktop) resulting in the preferences between the plain desktop apllication now invisible to the mobile-on-desktop application and vise versa. Making the mobile-on-desktop a much more realistic test plaform for mobile development. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-18code cleanup: translators are not globalGravatar Jan Mulder
Un-globalize unused global variables. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-20Don't show localization warning unless verboseGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-03Don't warn about missing en-US translation for QtGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22Add en_US translation for pluralsGravatar Dirk Hohndel
This way in the en_US locale we no longer get shown the odd "dive(s)" and instead get correct singular and plural forms. Most of the patch is just a reindentation as it removes the if clause that used to do the special case of NOT loading a translation for the en_US case. Right now we start with a trivial en_US translation file. My guess is that this will be overwritten once we do the next round of "new strings, new translations". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29Add SPDX header to remaining core filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27Settings update: Move loadPreferences out of qt-helper.cppGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-04Find bundled translations on iOSGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-03Android build: prepare and copy translations into the APKGravatar Dirk Hohndel
And then load them at runtime. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02Move the qtTranslator and ssrfTranslator pointers to qt-init.cppGravatar Thiago Macieira
No point in having it defined in each main program's .cpp. Especially since the unit tests don't define them. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-29Allow switching the user from the command lineGravatar Dirk Hohndel
This is a feature that many people have asked for. This implementation is somewhat simplistic because we simply use a different name for the program settings - but interestingly enough this appears to be enough to capture a lot of the core functionality that people are looking for in multi-user support. 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>