viking icon indicating copy to clipboard operation
viking copied to clipboard

GPX Track name not updated if entered by copy - paste and not <enter>

Open TxoNi opened this issue 1 year ago • 2 comments

To give some context and hoping I use the correct terms:

After importing a GPX track from a Garmin device, one gets two names: the layer name that corresponds to the GPX file name, and the name of the route/track which is shown on the device.

I always try that both the filename and the actual track name match, in order to organize my tracks. So the procedure I follow is:

  1. I write down the new name of the file, press [enter]
  2. Click again, [Ctrl C] for copying
  3. Click on the track name [Ctrl V] for pasting.

At this moment the editing line pastes the new value and "exits" editing mode as if the edition were finished. However, I have not pressed [enter] key.

Then when I export the track as a new GPX file, the track name remains unaltered.

However, if I re-click again on the track name and press [enter]. It seems the GPX track name gets updated and the file is correctly exported.

Somehow it seems that pressing [enter] is necessary for the value to be updated in the file. Otherwise it's only shown in the GUI but not updated in the real data.

viking version: 1.10 OS: KDE neon 5.27, based on Ubuntu 22.04

TxoNi avatar Sep 01 '23 14:09 TxoNi

I don't think I can quite recreate your exact problem, however I can offer some words of advice for the v1.10 (and probably all previous versions).

There is a slight conflict between the Text Editing of the GTK GUI widgets within Layers Tree View (i.e. the names that you see in the left hand panel) and the overloaded copy/paste mechanism tied into the Layers containing the Geo data.

When you perform step 2, the keyboard ctrl+C is intercepted by the Layers code - which although the label is being edited - doesn't have access to the modification (as that I think is internal to the GTK part) and so copies whatever the name was and I believe the geo data (as copy/paste mechanism registers handlers for different format types - a plain text version, a Viking layer type, maybe an HTML encoded version, etc...)

However if you right click and select copy (this is performed only within the GTK part) and so copies the text label as updated. Similarly then in step 3, if you right click and select paste - this will just paste the text - and you need to press [enter] to finish.

Otherwise note that when pressing Ctrl+V, which is processed by Viking layer code it tries to apply the potentially multiple available format types with them being preferentially ordered so IIRC the Viking geo data style is used if available.

So you can see the copy/paste is not quite as straight-forward as one might think - hence the observed behaviour.

There is some logic in Viking's copy/paste code to try to overcome the limitations, but I have not be able to find a way to make it work intuitively - like you want - so recommend the right click workaround for label copy/pasting.

rnorris avatar Sep 04 '23 20:09 rnorris

Thanks for the response rnorris. Unfortunately I annot press [enter] on the 3rd step. The widget exits edit mode as soon as I press Ctrl+V. I need to re-click and press [enter] for that.

Interestingly, the behavior I described was with distro packages. I have tried building the last version from GitHub, and the widget behaves differently. This time it does not respond to copy-paste shortcuts, as if shortcuts were differently configured or not associated. I'll try to check what is exactly going on here. Unfortunately, although I am experienced with Qt coding, I have very little experience with GTK widgets, but I'll try to debug this situation anyway.

TxoNi avatar Sep 04 '23 21:09 TxoNi