Feature request #1568

some properties menu items do nothing if certain legend elements selected

Added by barryrowlingson - over 11 years ago. Updated about 10 years ago.

Status:Closed
Priority:Low
Assignee:Marco Hugentobler
Category:GUI
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:11628

Description

Load a vector layer. Make sure the legend element is expanded so you can see the symbolism.

Click on the symbolism so a line is highlighted (and the layer name isnt). Now from the main menu do Layer.. Open Attribute Table. That works, up comes the attribute table. Saving as shapefile and saving selection as shapefile work. Toggling editing works.

But do Layer... Properties - nothing happens. Same with Layer... Remove layer.

Also fails with the 'Files' title if you have 'Show File Groups' set, but works if you select the files themselves.

1568_partial_fix.patch Magnifier - partial fix for legendLayerRemove and legendLayerShowProperties when a legend symbol item is selected (1.72 KB) Gabriele Monfardini, 2009-07-18 01:05 PM

1568_complete_fix.patch Magnifier - Fix the remaining issue (2.12 KB) Gabriele Monfardini, 2009-07-21 01:48 PM

1568_fix2.patch Magnifier - Made against revision 11533, delete a layer when one of its file group is selected (1.24 KB) Gabriele Monfardini, 2009-08-31 02:16 PM

History

#1 Updated by Giovanni Manghi over 11 years ago

Confirmed on QGis 1.2 (rev. 11005, Ubuntu 9.04).

#2 Updated by Gabriele Monfardini over 11 years ago

The patch I've uploaded simply check the parent of the current item instead of the current item if the current item is a QgsLegendItem::LEGEND_SYMBOL_ITEM.

It is a fix, maybe a more principled solution is possible.

Also, it is a partial fix, since it doesn't cope with the problem described in the ticket with the phrase "Also fails with the 'Files' title if you have 'Show File Groups' set, but works if you select the files themselves" since I don't understand exactly how to reproduce it.

#3 Updated by Giovanni Manghi over 11 years ago

Replying to [comment:3 gabrimonfa]:

Also, it is a partial fix, since it doesn't cope with the problem described in the ticket with the phrase "Also fails with the 'Files' title if you have 'Show File Groups' set, but works if you select the files themselves" since I don't understand exactly how to reproduce it.

after adding a layer, click the right button on it on the layer and select "Show File Groups". Than you expand further the legend of a layer, as it will show "files" and then the actual filename.

#4 Updated by Giovanni Manghi over 11 years ago

Replying to [comment:3 gabrimonfa]:

The patch I've uploaded simply check the parent of the current item instead of the current item if the current item is a QgsLegendItem::LEGEND_SYMBOL_ITEM.

It is a fix, maybe a more principled solution is possible.

Also, it is a partial fix, since it doesn't cope with the problem described in the ticket with the phrase "Also fails with the 'Files' title if you have 'Show File Groups' set, but works if you select the files themselves" since I don't understand exactly how to reproduce it.

I forgot... thanks a lot for the patch!

#5 Updated by Gabriele Monfardini over 11 years ago

1568_complete_fix.patch already contains the previous patch.
I've only coped with the possibility that the current selected item is a QgsLegendItem::LEGEND_LAYER_FILE_GROUP

#6 Updated by Giovanni Manghi over 11 years ago

Hi,
is the patch still good after the new legend gui has been introduced?

#7 Updated by Gabriele Monfardini about 11 years ago

No now it is become partially obsolete.

In commit 11533 (the current one while I'm writing) the only thing that remains to fix is when a file group is selected. I suppose that, since the file group clearly belongs to one layer, if the user calls remove layer its intention is clear. However, since the action "remove layer" is not present when right clicking on a file group, maybe my assumption is not correct.

In order to have "remove layer" menu action working when file group is selected, I'm about to submit yet another small patch. Otherwise it would be better to disable this action in the menu, and to allow it only when a layer, a layer group or a file is selected.

#8 Updated by Giovanni Manghi almost 11 years ago

The "file" part in the legend symbology has already been removed, but the described behaviour is still true if the symbol in the legend is selected.

It would be nice to have the patch updated and committed before packaging of version 1.4.

#9 Updated by Gabriele Monfardini almost 11 years ago

I'm using a1b0f200 (SVN r12313).

Symbols in the legend have an "hover" effect but don't appear to be selectable anymore, neither if the layer is thematized using the values of one of its fields.
If the symbols are not selectable, this bug doesn't exist anymore.

Is this correct?

#10 Updated by Giovanni Manghi almost 11 years ago

Replying to [comment:11 gabrimonfa]:

Is this correct?

even with just this "hover" effect the problem still there.

#11 Updated by Gabriele Monfardini almost 11 years ago

@lutra
Sorry, I'm not able to reproduce it anymore.

I thought the problem was that when you select an element inside a group of a layer (a symbol or, in the past, a file), you mean to select the layer. So if you choose delete layer when an element is selected, you would expect to delete the layer to which the element belong.

But now, you cannot select the symbols anymore. So when you move your mouse away to go the menu, the symbol is not selected. In fact nothing is selected in the legend. So I think it is correct that actions on layers are disabled, because you've not chosen the layer to use. And now the only element selectable is the layer itself.

Can you please explain me exactly how to reproduce the behavior that you consider wrong?

The patch I've proposed in the past is very simple.
If I understand the problem, it will not be much work to adapt to current code.

#12 Updated by Giovanni Manghi almost 11 years ago

Can you please explain me exactly how to reproduce the behavior that you consider wrong?

Hi there,
I see your point but :) I guess that this behaviour should be consistent for all the actions. "Delete layer" and "Properties" do not work, ok, but what about the other 4 (open attribute table, toggle editing, save as shapefile, save selection as shapefile)? They all work even with the symbols "not selected", so I guess that the only thing is needed is to choose a consistent behaviour among layer actions when the layer name is not selected and the "hover" is on the symbol or on one symbology category.

#13 Updated by Gabriele Monfardini almost 11 years ago

Wow I haven't seen that some actions indeed do something.
Probably I've always tried "delete layer"

So it's remembering which is last clicked layer even if I click on a symbol.

I fully agree that the behaviour should be consistent for all the actions.
Now, there is nothing remembering the user to which layer its action will be applied and IMHO, this is confusing.
I think it would be better to disable also the other actions instead of enabling also "properties" and "delete layer".

However, I'm ready to try to make also "properties" and "delete layer" work, if you think it's a better solution.

#14 Updated by Giovanni Manghi almost 11 years ago

However, I'm ready to try to make also "properties" and "delete layer" work, if you think it's a better solution.

To me make sense to have all them disabled, better if even greyed in the menu, exactly as it happens (for part of them) when you load a raster.

#15 Updated by Jürgen Fischer about 10 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

most likely superseeded by the nested layer capability.

Also available in: Atom PDF