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>
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.
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.
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.
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.
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.
Previously we only ever updated on the initial device assignments. Especially
when the device is offline while started, this means we never get the right
icon.
Previously the menu was hand-composed, let's replace it with the glade files
as possible. And move the menu itself out into the source file so glade
doesn't keep overwriting it.
And drop the rotate/sync button while we're there. The rotate button because
it's not hooked up anyway. The sync button because that is not how we work: we
just always listen while we're running, any drawing will "immediately" be
synched from the device.
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!)