Move some of the texts to the new TranslationFix, from ViewManager,
and use them. Keep them in ViewManager, too, so that the translations
with context ViewManager are not removed just now.
This is intended to apply translations to some common Qt UI components.
Example: a QMessageBox with standard buttons OK and Cancel; the text
for that is determined at startup using the system locale, and later
changes to the current locale or the current translation catalog,
do not affect OK and Cancel. It might be possible to load a catalog
with the right translation strings, except that there is no way to
know what the context or catalog **is** for the strings that are
used to label standard buttons: they can come from Qt base, or
the platform, or the theme. Merely loading the Qt Base translations
for the correct language does not help, because those translations
do not contain an "OK" string with the context used for standard
buttons.
Do the translation by hand; then we have all of the Calamares
languages covered, too, which is more than the Qt translations do.
This is intended for consumption by QML; the ViewManager object
acts as a proxy for a handful of global Settings values already,
so throw in global Logger values as well. A QML module that would
like to read the log file (e.g. for tailing it as part of a
slide-show) can get the path via this property.
- offer a convenience method for showing a popup and
URL information and copying the URL to the clipboard
- use that from ViewManager (on failure) and DebugWindow (on demand)
Require a ; after RETRANSLATE macros. They are statement-like;
this makes it easier for some of them to be recognized by
clang-format and resolves some existing weird formatting.
For methods that log a bunch of things, and which want to
consistently use SubEntry, but don't know when the **first**
log entry is within the method, Logger::Once can be used
to log one regular message (with function info) and the
rest are subentries.
- this test would fail if the logfile already exists for
any reason (including "I just ran the test")
- remove the file before expecting an empty logfile
- improve messages; a missing logfile is not a "things cannot
work" situation, it's a warning
This tests only the termbin ("fiche") paste by sending it
a derpy fixed string. Prints the resulting URL, doesn't
verify in particular.
It'd be rude to run this test too often.
- mark functions with STATICTEST so they can be compiled into a test
- move logfile-reading so we can call the pastebin-upload functions
with an arbitrary payload.
- The Paste API promises just a (string) URL back, not
a whole message, so return just the URL from the
abstract API and the concrete (fiche) implementation.
- Set clipboard contents from the UI
- Build (translated) message in the UI code
- have a namespace Paste with just one entry point, which will handle
untangling type &c.
This doesn't compile, but indicates the direction to take the API
- Use just type and url, since port can be specified in
a URL. Note that we only use host and port, not the
scheme (or the path, for that matter).
- Factor out understanding the *uploadServer* key to a function.
- get a QByteArray rather than going through a char[] buffer
- bytes-read is not important since the RE can only match if
there **are** that many characters.
- using the QML sidebar would not highlight the first step on startup,
only after next / prev would the highlight show up. Now, notify
when all the modules are loaded (and number 0 is active).