Commit Graph

12 Commits

Author SHA1 Message Date
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 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 958633e4ff Pre-fill the filename propertly
Saving a file for the first time is supposed to set the current name, not the
file name.
2019-07-16 15:29:24 +10:00
Peter Hutterer a82b291dbb flake 8 fixes 2019-07-16 15:28:51 +10:00
Peter Hutterer b3f4e91616 Add some relative dates for the drawings 2019-07-15 21:34:56 +10:00
Peter Hutterer d03493f7ff Add a GUI for Tuhi
This is a quickly hacked-together versions with some bits in detail, others
just sketched in. Credit goes to Piper where much of the basic structure has
been taken from, and tuhi-kete where the DBus bindings were taken from.

Current functionality allows to register a new device and save drawings from
an existing device. Missing is the bit where we can download drawings from a
newly registered device. Several buttons are present but not hooked up yet,
several UI pieces are unpolished.

This UI is designed to work with one device only right now. If you have two
devices, you'll have to manually remove them from Tuhi and add one or the
other through this tool.

The UI is minimal. If you start it and Tuhi doesn't have a device yet, it will
immediately go into search mode and start registering the device. If you have
a device, it'll just display the data.

The data Tuhi exports is downloaded immediately and converted to SVG files,
stored in $XDG_DATA_HOME/tuhigui/<timestamp>.svg. Downloading a file through
the GUI merely copies that file into the target path. No support for rotation
at this point, but could and should be added (there's a button already!)
2019-07-11 11:05:39 +10:00