Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pluginlegend customize #294

Closed
wants to merge 12 commits into from
Closed

Conversation

tqhien
Copy link
Contributor

@tqhien tqhien commented Oct 15, 2012

Hello,

I created a new branch to allow customization of plgins in the legend dock.
The plugin should call as in your test plugin (I changed the id to make it more simple):
self.iface.legendInterface().addLegendLayerAction(self.action_add_sel_tiles, "Tile Index", "addSelTiles", QgsMapLayer.VectorLayer )

in order to be enabled.

In customization dialog, it will appears under Docks/Legends/Plugins//

On a right-click on a layer, a submenu named will regroup the actions.

Can you test it and give me a feedback ?

Hien TRAN-QUANG

tqhien and others added 12 commits September 21, 2012 14:43
Customization settings used are the same as the Layer menu ones.
TODO : add subtree in Docks/Legend customization to separate customization
- Adv Labeling option to 'Show upside-down labels': never, when rotation defined, or always
- 'Never' (default) option is same as before, labels with 90 <= angle < 270 are turned so their text is always upright
- 'When rotation defined' option shows upside-down labels if their rotation is layer- or data-defined (dynamic labels are turned upright)
- 'Always' option shows upside-down labels at layer- or data-defined rotations and for dynamic labels
A plugin should call addLegendLayerAction to add action.
Example :
self.iface.legendInterface().addLegendLayerAction(self.action_to_add, "plugin_name", string_id, QgsMapLayer::LayerType )

add an action under a submenu named "plugin name"

Signed-off-by: Hien TRAN-QUANG <hien.tranquang@gmail.com>
…xt menu of a layer/group of layer.

Signed-off-by: Hien TRAN-QUANG <hien.tranquang@gmail.com>
@etiennesky
Copy link
Contributor

I am going to close this pull request, for a few reasons

1- you removed the work I had done in layerlegend_customize
2- indentation is not right - please run 'scripts/prepare-commit.sh' before comittting, it ensures correct indentation

now may I ask why you discregarded a number of my commits, instead of adding commits after? This results in a waste of time for everyone.

thanks
Etienne

@etiennesky etiennesky closed this Oct 15, 2012
@etiennesky
Copy link
Contributor

Hien

can you please add any changes (after my commits) to the correct branch - layerlegend_customize

thanks

@tqhien
Copy link
Contributor Author

tqhien commented Oct 16, 2012

Hello,

Sorry I think I have messed up something when I fetch your commits and
couldn't build the project anymore. I tried to reset back but somehow went
probably too far.

I'm going to restart from your commits and add commits after.

Just a few questions :

  • in addLegendLayerAction, your stringid is prefixed with the plugin name.
    Is that a requisite ? There's already the Qstring menu just before.

Just checking your code, it seems we worked on two parallel branches : for
me the plugin integration was a new feature, so I created a new branch to
test things out while you were still on the layerlegend_customize.

Can you tell me which part I can contribute to, so I don't mess things up
again and we don't do twice the job ?

Thanks

Hien.

2012/10/15 Etienne Tourigny notifications@github.com

I am going to close this pull request, for a few reasons

1- you removed the work I had done in layerlegend_customize
2- indentation is not right - please run 'scripts/prepare-commit.sh'
before comittting, it ensures correct indentation

now may I ask why you discregarded a number of my commits, instead of
adding commits after? This results in a waste of time for everyone.

thanks
Etienne


Reply to this email directly or view it on GitHubhttps://github.com//pull/294#issuecomment-9451929.

@etiennesky
Copy link
Contributor

In addLegendLayerAction it is preffered to add the plugin name, just to make sure there are no clashes, but there is no enforcement. The menu name is optional, and can be different from the id which should be unique. For example, menu name can be translated with tr(), but id should not, it's internal to the plugin design.

I was always working on my layerlegend_customize branch, after pulling from your branch. No need to have 2 branches because these are related features, the plugin customization requires your legend customization. Please add any fixes/enhancements there. What is missing is the customization part (selecting which ones are visible or not).

If you prefer I will add that and you can review, but I will not have time before tomorrow.

thanks

@tqhien
Copy link
Contributor Author

tqhien commented Oct 16, 2012

Ok, I understand now.

I don't know yet if I'll get time to modify the customization part before
the end of the week.
And I 'm looking for a way not to restart all the application when we
customize the interface (that is already ok for the legend dock as it
searches the registry/settings file whenever we right-click).

Thanks.

Hien.

2012/10/16 Etienne Tourigny notifications@github.com

In addLegendLayerAction it is preffered to add the plugin name, just to
make sure there are no clashes, but there is no enforcement. The menu name
is optional, and can be different from the id which should be unique. For
example, menu name can be translated with tr(), but id should not, it's
internal to the plugin design.

I was always working on my layerlegend_customize branch, after pulling from
your branch. No need to have 2 branches because these are related features,
the plugin customization requires your legend customization. Please add any
fixes/enhancements there. What is missing is the customization part
(selecting which ones are visible or not).

If you prefer I will add that and you can review, but I will not have time
before tomorrow.

thanks


Reply to this email directly or view it on GitHubhttps://github.com//pull/294#issuecomment-9487579.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants