Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.
- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
- Revert accidentally put translations in mt32.cpp
- Use U32::format in some places earlier missed
- Add %u and %i for u32::format
- Add support for GUIErrorMsgFormat to use u32::format internally
- Use the above whereever needed
- Improve linux tts by removing redundant code
- Some places I had changed nullptr -> "". Revert this
This commit also includes some additional major changes.
- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
Resolves a bug with displaying the wrong (previous) translation when switch theme language
Previously, a translated string was stored in cloudmanager _storages config items, which would become stale if the theme language was changed.
RFC 2616 states that HTTP headers are not case-sensitive and also allows
arbitrary number of whitespace characters around header value. Previous
implementation was dependant on headers to be in "Title-Case" and to
have only one space before header value. That has lead to cloud sync
failure on Debian x64 (user's network environment was probably the
reason though).
This commit adds a new method, which parses headers name-value pairs
into HashMap. To ensure case-insensitivity, all headers names are
converted to lowercase, and thus code that uses this method should
specify headers in lowercase. All usages of raw headers contents were
updated to use this method.
If user doesn't have a "saves" folder, listing it as a first step of
syncing save files would result in 404 from OneDrive.
OneDriveTokenRefresher handles token-related errors (401), so when it
meets 404, it calls its finishError method. But because there was some
strange behaviour from OneDrive with sending invalid JSON, this method
tries fixing JSON and parsing it again. If it is valid, it calls
non-error method again, and in result we get stack overflow.
In order to fix that, I've added a non-JSON prefix "<irrecoverable>", so
finishError won't be able to parse JSON and thus won't call finishJson
again. Saves syncing callback does check string contents apart from
trying to parse JSON, so it still works and correctly handles the
situation when "saves" directory is missing. But, if needed, code can be
updated to search for the prefix I've added and remove it before parsing
original JSON.
The warning emitted here was due to debug() call with an empty format
string, so this could have been fixed by replacing this with "%s", "".
However, this change should be better since it avoids the duplication
of the number of file check over several lines and reduces the string
duplication i.e. DRY improvements.
In PR#1754 we've discussed and decided to ignore hidden (having a name
starting with '.') files while syncing saves or downloading game files.
This commit adds a CloudManager method to test whether file should be
ignored, and this method could be extended later if we need to ignore
some other specific file names.
- added missing 'd' in "%d" in SavesSyncRequest;
- removed trailing ',' in enum in gui/options.h;
- fixed #endif to have // before USE_LIBCURL in gui/options.h.
- StorageWizardDialog is removed, along with bmps it was using;
- EditTextWidget now accepts custom font in constructor;
- ScrollContainer scrollbar now jumps to top when content height changes
so it's "overscrolled";
- IndexPageHandler now does not awaits for `code` GET-parameter, as
local webserver is no longer used to connect Storages;
- CloudManager and all corresponding Storages are updated to support
disconnecting and to notify about successful connection.
This mostly affects OneDrive saves syncing, because it is the only cloud
provider to return 0 as timestamp of (non-)created file. 0 is treated as
EOF in /saves/timestamps file, thus all timestamps after such 0
timestamps were ignored and files were reuploaded as being "new". This
commit also adds more verbose debug information on SavesSyncRequest
decisions making for easier debugging.
Something changed and old API endpoint "api.onedrive.com" now does not
work. The other one, "graph.microsoft.com", does, but there were some
other changes in JSON it returns. These changes are also in this commit.
While refreshing access_token, some cloud providers also pass a new
refresh_token. Google Drive does not, and accepts the same refresh_token
next time. These changes allow this to happen.
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
This variable is not used as the constructors for the storage type
classes store the resulting objects into the Cloud Manager using
replaceStorage(this) instead.
The cloud manager registers itself as an event source as a mean to be polled
periodically by the GUI or engine code. The periodical polling is used to
update the OSD icon indicating background sync activity.
Also move the cloud icon from ConnectionManager to CloudManager,
allowing to decouple icon handling from network connections updates.