If we can't create the cache dir, e.g. if `~/.cache` doesn't exist or
if we don't have enough permissions, we now return a temporary directory.
Fixes#10033.
1. Fcitx does not need restart to load newly installed keyman keyboard
2. Restart fcitx may cause issue on kwin/weston Wayland where input
method have to be spawned by compositor process.
Ubuntu 20.04 comes with Python 3.8 which doesn't have
`platform.freedesktop_os_release()`. This change catches the exception
if this happens, as well as other exceptions we might get so that the
initialization of Sentry will succeed.
Fixes#9773.
- during installation add to the list of custom keyboards if necessary
- during uninstallation remove from the list of custom keyboards
- if list of custom keyboards has invalid values, remove those before
saving the list
Closes#8598.
This change adds additional details to Sentry events so that the "All
Events" tab on keyman.sentry.io will show helpful values in the
"device" and "os" columns instead of emptry strings.
The `hash` method that we previously used calculates the hash based on
the memory location, i.e. with each program run we get a different value
for the same user. This change now uses the md5 algorithm so that the
same user always produces the same hash.
When running on Ubuntu 20.04 Focal, one of the Python dependencies
loads the `unittest` module so that running `km-config` output the
message that Sentry would be disabled because unit tests are running.
This change now uses the callstack to check if we're running unit
tests.
Fixes#9577.
This works around the issue where browsers installed as snap package
can't access files under `$HOME/.local`. Instead we now only open
external links with the browser. Local non-html files we open with
the default app, and links to local html file we open in webview
(like we did previously with `welcome.htm` files).
Fixes#9600.
This change reworks the output we show if the user tries to
uninstall a non-existing keyboard. This could be trying to uninstall
a shared keyboard when a user keyboard exists and vice versa. This
change rewords the message to include the area (shared/user), so
hopefully this makes it a bit clearer. We also now output this as a
warning instead of an error.
Completely suppressing the message as suggested in #9213 doesn't seem
to be the right way as that would lead to the user blaming uninstall
to not work when the real reason are wrong parameters.
Closes#9213.
We can't initialize Sentry during module initialization because our
`initialize_sentry` logs some status info. Setting the logging level
later on is then a no-op, breaking verbose and very-verbose logging.
This change fixes this by putting Sentry initialization into a
separate method that gets called after we set the log level.
Also refactor some common code into methods that appear in all our
executables.
After this change uninstalling a keyboard will remove all installed
language/keyboard combinations for that particular keyboard.
Previously we only uninstalled for the first language listed in the
keyboard.
We no longer ask the user if he tries to install a keyboard that is
already installed with the same version. The only time we ask is for
downgrades.
A similar change is implemented in `km-package-install` where we
changed the logic to match `install_window.py`. We now silently
install the new version unless it's a downgrade in which case we
output a error message and exit. This change also introduces the
`--force` parameter which allows to install the downgrade. For
upgrades or re-installing the same version it will cause an
uninstall of the current version first.
This change makes it possible to install the same keyboard again
for a different language. It won't be visible in the GUI if the
keyboard is installed for more than language, but it will show up
for the installed languages in the keyboard dropdown.
Closes#8619.
We changed the comparison of version numbers a while ago, but this
one slipped through. Using string comparison for version numbers
is a bad idea... This addresses code review comments.