Opened 15 years ago

Closed 13 years ago

#1568 closed patch (fixed)

some properties menu items do nothing if certain legend elements selected

Reported by: Barryrowlingson Owned by: mhugent
Priority: minor: annoyance Milestone: Version 1.6.0
Component: GUI Version: Trunk
Keywords: Cc: pcav
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

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.

Attachments (3)

1568_partial_fix.patch (1.7 KB ) - added by gabrimonfa 15 years ago.
partial fix for legendLayerRemove and legendLayerShowProperties when a legend symbol item is selected
1568_complete_fix.patch (2.1 KB ) - added by gabrimonfa 15 years ago.
Fix the remaining issue
1568_fix2.patch (1.2 KB ) - added by gabrimonfa 15 years ago.
Made against revision 11533, delete a layer when one of its file group is selected

Download all attachments as: .zip

Change History (21)

comment:1 by pcav, 15 years ago

Milestone: Version 1.0.3

comment:2 by lutra, 15 years ago

Cc: pcav added
Milestone: Version 1.0.3Version 1.2.0
Version: 1.0.0HEAD

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

by gabrimonfa, 15 years ago

Attachment: 1568_partial_fix.patch added

partial fix for legendLayerRemove and legendLayerShowProperties when a legend symbol item is selected

comment:3 by gabrimonfa, 15 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.

comment:4 by lutra, 15 years ago

Owner: changed from nobody to mhugent
Type: bugpatch

in reply to:  3 comment:5 by lutra, 15 years ago

Replying to 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.

in reply to:  3 comment:6 by lutra, 15 years ago

Replying to 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!

by gabrimonfa, 15 years ago

Attachment: 1568_complete_fix.patch added

Fix the remaining issue

comment:7 by gabrimonfa, 15 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

comment:8 by lutra, 15 years ago

Platform: DebianAll

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

comment:9 by gabrimonfa, 15 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.

by gabrimonfa, 15 years ago

Attachment: 1568_fix2.patch added

Made against revision 11533, delete a layer when one of its file group is selected

comment:10 by lutra, 14 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.

comment:11 by gabrimonfa, 14 years ago

I'm using r12312.

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?

in reply to:  11 comment:12 by lutra, 14 years ago

Replying to gabrimonfa:

Is this correct?

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

comment:13 by gabrimonfa, 14 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.

in reply to:  13 comment:14 by lutra, 14 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.

comment:15 by gabrimonfa, 14 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.

in reply to:  15 comment:16 by lutra, 14 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.

comment:17 by pcav, 14 years ago

Milestone: Version 1.5.0Version 1.6.0

comment:18 by jef, 13 years ago

Resolution: fixed
Status: newclosed

most likely superseeded by the nested layer capability.

Note: See TracTickets for help on using tickets.