Commit graph

234 commits

Author SHA1 Message Date
Eberhard Beilharz
0c78e44eda
chore(linux): Remove debug output 2022-03-15 17:53:46 +01:00
Eberhard Beilharz
cc0317af2c
fix(linux): Don't use restart option of exit()
Instead of trying to restart ibus by passing True to bus.exit()
we now exit ibus and then let verify_ibus_daemon() start it again.
Also added additional checks to verify that we're not running
multiple ibus-daemons at the start of km-config and before
restarting.
2022-03-11 18:14:02 +01:00
Eberhard Beilharz
e6cf0327b7
chore(linux): Small improvements
- output error if more than one ibus-daemon is running
- log Keyman version after starting km-config
2022-03-09 18:37:59 +01:00
Eberhard Beilharz
92395ec1f6
fix(linux): Add some debug output 2022-03-08 17:43:19 +01:00
Eberhard Beilharz
e30c00733a
fix(linux): Don't start ibus-daemon multiple times
This change adds a 1s sleep after restarting ibus before checking
that it actually runs. Hopefully this will solve the problem. Since
this bug is hard to reproduce, we also log a critical error for the
other code path this could happen.

Fixes #6237.
2022-03-07 18:22:06 +01:00
Marc Durdin
19d8faa077
Merge pull request #6287 from keymanapp/fix/linux/6285-makedirs
fix(linux): Gracefully handle makedirs failures
2022-03-02 09:02:09 +11:00
Eberhard Beilharz
e5b9b81806
fix(linux): Gracefully handle makedirs failures
This change catches the exception we're getting if we try to create
a directory but e.g. there is already a file with that name. In this
case we now output an error message. This change also gracefully
handles failures when linking files.

Fixes #6285.
2022-02-24 18:13:03 +01:00
Eberhard Beilharz
3c8983037d
fix(linux): Gracefully handle keyboard download failure
In the past we already gracefully handled keyboard download failures
when the user triggered the download from the km-config UI. This
change deals with the command line side of things, most often when
the user clicks on the "Install keyboard" button on keyman.com. If
the download fails we already output an error message and now don't
try to install the non-existing .kmp file.

Fixes #6284.
2022-02-24 17:38:23 +01:00
Eberhard Beilharz
6cac869d0b
feat(linux): Try to start ibus if not running
When we try to restart ibus and that fails and ibus isn't running
afterwards we directly try to start ibus-daemon.

On Ubuntu 21.10 Impish there are two `ibus-daemon` processes
running for the current user. One of them has the `--xim` flag
and is the one we care about. This change improves the detection
that ibus is running after installing a keyboard.
2022-02-07 16:44:26 +01:00
Eberhard Beilharz
9cae5a4ab4
Merge pull request #6159 from keymanapp/fix/linux/6158-install-in-wasta
fix(linux): Don't crash when installing keyboards in Wasta
2022-02-02 09:27:56 +01:00
Eberhard Beilharz
85d33cefcf
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-01-31 16:21:49 +01:00
Eberhard Beilharz
0b8e628812
chore(linux): Improve robustness
Don't crash if we encounter a corrupt file.
2022-01-28 18:37:55 +01:00
Eberhard Beilharz
685eaa6ffc
fix(linux): Don't crash if we lack permissions
Also deal with other file I/O related exceptions and report them
as warnings.

This fixes #6171.
2022-01-28 18:37:54 +01:00
Eberhard Beilharz
c42a623f38
fix(linux): Don't crash when installing keyboards in Wasta
Fixes #6158. This bug got introduced in #6015.
2022-01-27 17:22:02 +01:00
Eberhard Beilharz
072481198e
chore(linux): Add comment for clarification of code behaviour 2022-01-24 11:55:45 +01:00
Eberhard Beilharz
88ef184cc2
Merge pull request #6086 from keymanapp/fix/linux/issue-6085-requests_cache
fix(linux): Fix attribute error
2022-01-11 08:23:05 +01:00
Eberhard Beilharz
4876497fe8
Merge pull request #6070 from keymanapp/feat/linux/sentry
feat(linux): Don't create Sentry events for errors
2022-01-11 08:22:36 +01:00
Eberhard Beilharz
c269d12ec7
Merge pull request #6015 from keymanapp/fix/linux/issue-5311-sharedinstall
fix(linux): Fix installation of shared packages
2022-01-10 18:16:57 +01:00
Eberhard Beilharz
254ceabe78
fix(linux): Fix attribute error
Newer versions of requests-cache (>= 0.6) restructure some code so
that the _core_ namespace is no longer available. However, it turns
out that we don't need to specify that namespace at all, so this
change will work with both older and newer versions of
requests-cache.

This will fix #6085.
2022-01-07 17:22:53 +01:00
Eberhard Beilharz
79244650b1
feat(linux): Don't create Sentry critical events for handled errors
We don't want to send events to Sentry for errors that we handled.
2022-01-06 18:43:28 +01:00
Eberhard Beilharz
20064ea42a fix(linux): fix release version number for Sentry reporting
Forgot to change the second occurrence of the version number for older
Sentry SDK.
2021-12-17 23:09:47 +01:00
Eberhard Beilharz
10c7d88eb9 fix(linux): fix release version number for Sentry reporting
Fixes #5817.
2021-12-15 10:52:21 +01:00
Eberhard Beilharz
2ec64ac521 fix(linux): Fix unit tests 2021-12-09 14:44:33 +01:00
Eberhard Beilharz
b57699b06b refactor(linux): Move GSettings code to separate class 2021-12-08 19:05:23 +01:00
Eberhard Beilharz
05f2bdad61
fix(linux): Fix installation of shared packages
This change fixes the installation of shared packages, so that they
show up in the list of the installed keyboards. It implements the
fix for both ibus and gnome.

Fixes #5311.
2021-12-07 16:56:08 +01:00
Marc Durdin
024a36da9f
Merge pull request #5787 from keymanapp/chore/sentry-io
chore: sentry.io dsn 👮‍♂️
2021-10-06 07:32:43 +11:00
Marc Durdin
c951b35083 chore(linux): use secret in legacy sentry setup 2021-10-05 09:30:17 +11:00
Eberhard Beilharz
41c6f6940b
Merge pull request #5758 from keymanapp/fix/linux/cherry/5756
fix(linux): Don't crash displaying keyboard details 🍒
2021-10-04 12:22:26 +02:00
Marc Durdin
3219b44624 chore: sentry.io dsn 2021-10-04 15:01:36 +11:00
Eberhard Beilharz
6f31014ba0
fix(linux): Don't crash displaying keyboard details
At least one user got a crash trying to click on the "About" button
to display keyboard details for the ekwtamil99uni keyboard. I can't
reproduce the problem, but this change adds additional code that
should prevent the crash from happening.

Fixes #5756.

(cherry picked from commit 3d44b9987d)
2021-09-27 17:43:51 +02:00
Eberhard Beilharz
ed1746d3d0
fix(linux): Don't crash with non-keyboard package file
If a user tries to a install a model .kmp file, we now display a
message box instead of crashing.

Fixes #5753.

(cherry picked from commit 98e1269ae2)
2021-09-27 17:07:35 +02:00
Eberhard Beilharz
fe0e423433
fix(linux): Use first keyboard language if none given
This fixes a bug introduced in #3290 where we added using the
language from search. Unfortunately that broke things in a lot of
other places because we didn't test for the empty string.
2021-08-27 11:04:42 +02:00
Eberhard Beilharz
c3540e9f37
chore(linux): Fix uploading to Sentry
On local builds we shouldn't upload errors to Sentry. The
`build-utils.sh` script sets the `UPLOAD_SENTRY` environment variable
for that purpose. Also, Sentry doesn't like having an empty string
as pkgversion (which should no longer happen with the rest of this
change, but...)
2021-08-23 16:24:13 +02:00
Eberhard Beilharz
163874b81d
Merge pull request #5585 from keymanapp/fix/linux/5584-badimage
fix(linux): Handle corrupt icon file
2021-08-17 11:43:58 +02:00
Eberhard Beilharz
c8049a0cd2
fix(linux): Handle corrupt icon file
Fixes #5584.
2021-08-16 15:55:36 +02:00
Eberhard Beilharz
d48b5194e1
fix(linux): Check for valid kmp file
Before trying to install we now check if it's a valid zip file.
This fixes #5575.
2021-08-16 10:58:50 +02:00
Eberhard Beilharz
a2950bef7f
refactor(linux): Cleanup import of os.path
This change imports `os` instead of `os.path`. This is the
recommended way. It also reduces confusion whether to use
`os.path.whatever()` or just `path.whatever()`.
2021-08-04 12:24:07 +02:00
Eberhard Beilharz
c78800d4d8
fix(linux): Improve uninstallation
Previously uninstalling of a keyboard failed if the directory was
a symlink (e.g. with keyboards from unit tests). This change treats
symlinks differently.

Fixes Sentry issue KEYMAN-LINUX-32.
2021-08-04 11:24:03 +02:00
Eberhard Beilharz
3bd0173954
fix(linux): Don't crash with corrupt keyboard
If we try to install a keyboard that's missing some metadata
we shouldn't crash.

Fixes #5384, #5385.
2021-07-01 12:49:50 +02:00
Eberhard Beilharz
8b1a529f43
Merge pull request #5401 from keymanapp/fix/linux/issue-5400
fix(linux): Improve bitmap conversion
2021-07-01 09:00:41 +02:00
Eberhard Beilharz
f519c2447d
fix(linux): Improve bitmap conversion
Converting some bitmaps fail with a truncation error. This change
allows to successfully convert the bitmap files.

Fixes #5400.
2021-06-30 18:57:22 +02:00
Eberhard Beilharz
3e938fe82c
fix(linux): Report Sentry related messages to stderr
This will make them not appear in the generated markdown help files.
2021-06-30 12:18:02 +02:00
Eberhard Beilharz
56e27473ac
Merge pull request #5373 from keymanapp/fix/linux/issue-5310
fix(linux): Save QR code in temporary directory
2021-06-28 16:53:52 +02:00
Eberhard Beilharz
a92c59f3be
Merge pull request #5372 from keymanapp/refactor/linux/issue-5309
refactor(linux): Centralize paths
2021-06-28 16:51:56 +02:00
Eberhard Beilharz
768de5f66b
fix(linux): Save QR code in temporary directory
Fixes #5310.
2021-06-25 19:41:51 +02:00
Eberhard Beilharz
50d19372bc
refactor(linux): Use path instead of os.path 2021-06-25 19:39:16 +02:00
Eberhard Beilharz
35d506c977
refactor(linux): Centralize paths
Introduce methods to get paths instead of hard-coding the values.
This also deprecates four methods (`user_keyman_dir`,
`user_keyman_font_dir`, `user_keyboard_dir`, and `get_isntall_area_path`).

This change also fixes a crash trying to install a package in the
shared area.
2021-06-25 19:25:48 +02:00
Eberhard Beilharz
0a2dd29e53
fix(linux): Fix restarting ibus when running with sudo
When installing in the shared area the user has to run
`km-package-install` with sudo so that he has sufficient permissions.
In that case we have to do extra work to restart ibus for the
logged-in user instead of root.

Fixes #5309.
2021-06-25 18:59:12 +02:00
Eberhard Beilharz
7c28e87ece
fix(linux): fix crash in km-package-install -p foo 2021-06-25 18:59:11 +02:00
Eberhard Beilharz
5bde5b5904
chore(linux): Add deprecated decorator 2021-06-25 18:52:10 +02:00