Commit Graph

400 Commits

Author SHA1 Message Date
Peter Hutterer 3e246b0aa1 gui: add a separator between the close button and the other buttons
To avoid accidentally clicking the close button when trying to save
2019-07-18 18:33:40 +10:00
Peter Hutterer 78fc886375 gui: fix the global orientation changes
This broke at some point, let's fix it again by moving to the drawing and
calling refresh() from there - no need for the DrawingPerspective to call into
the drawing here.
2019-07-18 18:32:11 +10:00
Peter Hutterer b7079e2343 gui: restyle the drawing entries 2019-07-18 18:26:31 +10:00
Peter Hutterer 1224711328 gui: move the battery and sync spinner to the titlebar
We have the real estate there anyway, might as well make use of it
2019-07-18 17:30:41 +10:00
Peter Hutterer 900d0302cd gui: remove duplicate active stack assignment 2019-07-18 17:21:45 +10:00
Peter Hutterer 06b28274a7 Remove tuhigui's gitignore file, it's covered by the top-level one anyway 2019-07-18 13:41:48 +10:00
Peter Hutterer ef830c2560 README: make a note that flatpak doesn't use the same directories
XDG_DATA_DIR in flatpak is $HOME/.var/app/org.freedesktop.Tuhi/data/tuhi
vs $HOOME/.local/share/tuhi for normal runs.

Which means switching between flatpak and normal means we lose the UUID and
the stored drawings.
2019-07-18 13:17:47 +10:00
Peter Hutterer 23281976da tuhigui: share the config path with tuhi
The tuhigui.ini settings file where we store the orientation of the device is
now the same config directory tuhi dumps its data in.

The svgs are in an svg subdirectory, just to make them easier to find.
2019-07-18 13:04:25 +10:00
Peter Hutterer cce5099709 Fix the flatpak for tuhi to point to the GUI now
This means we can drop the normal one. Since Tuhi wasn't a GUI application
anyway it wasn't technically flatpak-compatible.
2019-07-18 12:54:30 +10:00
Peter Hutterer d2bfbc49b4 Add the tuhi.in startup script
As a <builddir>/tuhi and <builddir>/tuhi.devel version. The latter runs
in-tree, the former is the one to be installed.

This is this type of script for a number of reasons. The quickest integration would
be to just use multiprocessing and call into the python module instead of
running other generated scripts. But that doesn't work, GLib doesn't like that
much (the GTK UI crashes). See
https://jameswestby.net/weblog/tech/14-caution-python-multiprocessing-and-glib-dont-mix.html

Another option would be to have a single thread because with GObjects we don't
need to care, right? Except that we do because the DBus bindings use sync
calls and that hangs when we have the server in the same process in a single
thread. Fixing the bindings is a bit more involved.

So meanwhile, let's just go for a script that executes the right targets as
separate processes and let the kernel take care of 'threading', that's what
it's there for after all.
2019-07-18 12:54:14 +10:00
Peter Hutterer ea162610fd meson.build: install the server with meson as well 2019-07-18 12:19:29 +10:00
Peter Hutterer a708978fad meson.build: drop two unneeded replacements 2019-07-18 12:19:29 +10:00
Peter Hutterer fec00a2190 Rename the tuhigui script to tuhi-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-18 12:19:29 +10:00
Peter Hutterer a724495502 Rename tuhi.py to tuhi-server.py 2019-07-18 12:19:29 +10:00
Peter Hutterer 0791dba90a tuhigui: namespace the loggers 2019-07-18 12:19:29 +10:00
Peter Hutterer 4b3914d49c tuhi: take the mainloop out of Tuhi
If we want to integrate this with TuhiGui, we can't have multiple mainloops.
And there's nothing with Tuhi that needs it anyway, it's all about how it is
being called. Which means we can just move this to the main method.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-18 12:19:29 +10:00
Peter Hutterer 16cd17b2d1 Drop TuhiGui, make it into Tuhi
Drop the user-visible separation, make everything just Tuhi. Directory
structure remains largely separate (tuhi vs tuhigui) except for the po files
which are in the top-level directory because convention.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-18 12:19:29 +10:00
Peter Hutterer bc7c55f281 Merge the two directories closer together
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-07-17 21:03:15 +10:00
Peter Hutterer a1dc262772 Drop separate COPYING from tuhigui 2019-07-17 20:56:45 +10:00
Peter Hutterer 1f0709eea0 Merge tuhigui into gui
This is a plain subtree merge without any changes to the tuhigui tree itself.

As we'll keep the distinction between the DBus server and the GTK UI, the
directory layout will reflect that.
2019-07-17 20:48:36 +10:00
Peter Hutterer 71614aa47f Swap "never" for "not yet", it's more accurate 2019-07-17 20:16:55 +10:00
Peter Hutterer efabaf3aaa Move the setup dialog to the main window
No need for a separate file just for those few lines of code
2019-07-17 19:40:13 +10:00
Peter Hutterer 037d05babf Move the error perspective to the main window
No need to have a separate file for a few lines of code
2019-07-17 19:39:26 +10:00
Peter Hutterer db08e1a82f wacom: improve a debug message 2019-07-17 18:25:40 +10:00
Peter Hutterer bc612f9e0e wacom: fix the firmware version retrieval for the base protocol
Introduced in dbd60675a9
2019-07-17 18:25:36 +10:00
Peter Hutterer bd66b8dbd3 Add a flatpak wrapper to start Tuhi on demand
No-one but Arch packages Tuhi at the moment, so let's assume it's not
running/installed, install it and start it up together with TuhiGui and voila,
everything just works as it should be.
2019-07-17 10:49:17 +10:00
Peter Hutterer 7677ce60eb Add all the hooks required for translation 2019-07-16 21:54:50 +10:00
Peter Hutterer 5e0b7762d6 Fix the error screen to look like something sensible 2019-07-16 21:40:27 +10:00
Peter Hutterer d8fa2ba00a Add another rotation button
Because it's effectively free anyway
2019-07-16 21:29:03 +10:00
Peter Hutterer ec09d0c73c Drop the 'completed' image
A user may want to download the drawing multiple times. And besides, after
switching back to the default icon theme, I couldn't find a decent icon
anyway.
2019-07-16 21:24:01 +10:00
Peter Hutterer ec33e3f0af Add a rotation button to the drawings 2019-07-16 21:17:09 +10:00
Peter Hutterer 3e23e8bc31 svg: pass the orientation into the constructor
Don't let the SVG generation parse the config file, not necessary here.
2019-07-16 21:15:11 +10:00
Peter Hutterer 1743a93873 Rename Config.load() to Config.instance() for better clarity 2019-07-16 21:13:30 +10:00
Peter Hutterer 09a66642ae Move SVG generation to the Drawing
This means we can just call refresh() from the parent after the orientation
has changed.
2019-07-16 21:06:32 +10:00
Peter Hutterer 9903bd851d Handle the iteration through the flowbox children better 2019-07-16 20:54:01 +10:00
Peter Hutterer 55164043e3 README: fix spelling of Māori
Fixes #141
2019-07-16 17:03:50 +10:00
Peter Hutterer 34defb3768 Drop the text for the "synchronized" label
This would just cause extra work for translators, we never actually display
that bit anyway.
2019-07-16 15:34:02 +10:00
Peter Hutterer ceee14b1ed Reduce font size for the bottom hint to press the button 2019-07-16 15:33:57 +10:00
Peter Hutterer 7be996e43a Streamline the setup dialog
Just the minimal bits that are needed.
2019-07-16 15:33:49 +10:00
Peter Hutterer 79e3e02b66 Fix a grammar mistake 2019-07-16 15:33:45 +10:00
Peter Hutterer 951bc85139 Display the missing battery icon until we get data from Tuhi 2019-07-16 15:33:40 +10:00
Peter Hutterer e999beafd7 If we haven't synced in 10 years, it's "never"
This is the value that's displayed on startup now
2019-07-16 15:33:34 +10:00
Peter Hutterer a857b14b8a Implement 'deleting' drawings
Enable the delete button that's been hidden away so far. When clicked, we
suffix the cached json file with '.deleted'. This also causes a popup with an
undo button to appear (taken from Nautilus). When clicked, that button will
restore the drawing again.

This is really all just renaming anyway, because nothing ever gets deleted
here.

An extra filter is needed to skip Tuhi drawings that have been deleted in the
GUI - we don't want to add the drawings we just deleted again just because
Tuhi still keeps them in cache.
2019-07-16 15:33:02 +10:00
Peter Hutterer ff35e5bfc5 Cache the json files to disentangle them from Tuhi
Tuhi caches the json data but has no guarantee about storage. So we cache the
json we get from Tuhi and store it in our settings dir through our Config
backend. Then we use  those cached values to generate the SVG files.
2019-07-16 15:32:49 +10:00
Peter Hutterer b34dbcf899 Switch to using pathlib over os.join 2019-07-16 15:32:10 +10:00
Peter Hutterer 6e21db0c9a Revert "Store the SVGs in the runtime directory"
Actually, not a good idea since we can't rely on Tuhi to store the drawings
forever.

This reverts commit 5470a7afd23c44d55ee14d32ddf081a8e0eab251.
2019-07-16 15:31:46 +10:00
Peter Hutterer 651d9d87e4 Store the SVGs in the runtime directory
No need to pile these into the data directory.
2019-07-16 15:31:43 +10:00
Peter Hutterer 2f3094d3db Allow for orientation changes for the device
This is saved for posterity in the new settings file, so we need a new Config
object (singleton is enough here).

For now, whenever the orientation changes, we just wipe our UI and re-generate
all SVG files. Much easier than messing with proper SVG rotation given that a
device should only ever change between rotations once.
2019-07-16 15:31:36 +10:00
Peter Hutterer 84273a1c83 Add a Help entry in the menu (to point to the wiki) 2019-07-16 15:29:51 +10:00
Peter Hutterer 6c8d586caa Rename a the variable used to generate the icon name 2019-07-16 15:29:46 +10:00