Bug report #9430

Disable "Paste Features as New Layer" if empty clipboard

Added by Jeremy Palmer almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:Denis Rouzaud
Category:GUI
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18024

Description

The new "paste features as new layer" feature should be disabled if the clipboard is empty.

Also see #9083

In addition if the clipboard does not contain features to paste, then the process should stop after the error of message of "No features in clipboard". Currently the error message is raised but then continues to prompt for the new layer coordinates system and other save options.

Associated revisions

Revision 7a9e6820
Added by Denis Rouzaud almost 6 years ago

fix #9430: do not enable copy to layer if nothing to copy

Revision 983b1c95
Added by Denis Rouzaud almost 6 years ago

fix #9430 followup 7a9e682

History

#1 Updated by Giovanni Manghi almost 6 years ago

  • Operating System deleted (ALL)
  • Affected QGIS version changed from 2.0.1 to master

#2 Updated by Denis Rouzaud almost 6 years ago

  • Assignee set to Denis Rouzaud

#3 Updated by Denis Rouzaud almost 6 years ago

  • Status changed from Open to Closed

#4 Updated by Denis Rouzaud almost 6 years ago

  • Status changed from Closed to Reopened

see https://github.com/qgis/QGIS/pull/1140

the paste menu gets enabled as soon as there is something in the clipboard (I mean any text).
Even if the text does not contain WKT strings, the menu is enabled.

To prevent this, the check of the clipboard content should be done every time it changes.

This will output GEOS every time there is a new copy which is not made of WKT strings.

Is this reasonable or shall the beheviour remain (and consider this issue as a non-issue)?

#5 Updated by Radim Blazek almost 6 years ago

Denis Rouzaud wrote:

This will output GEOS every time there is a new copy which is not made of WKT strings.

This is not clear to me, can you please explain?

#6 Updated by Denis Rouzaud almost 6 years ago

with this patch, QGIS will try to see if there are geometric features in the clipboard every time it changes.
So as soon as you will copy something outside of QGIS, it will go through each line of text and test if it is a WKT geometry. This check is done via geos and each failure writes a log message in QGIS.

see https://f.cloud.github.com/assets/127259/2073642/cc33bace-8d63-11e3-9667-d77a4b5d972d.png

#7 Updated by Denis Rouzaud almost 6 years ago

  • Status changed from Reopened to Closed

The current behavior is considered as the right one. If there is something in the keyboard, you are allowed to try pasting, even if you have only standard text in the clipboard.

Also available in: Atom PDF