{"action":"created","comment":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/comments/170143873","pull_request_review_id":98786630,"id":170143873,"diff_hunk":"@@ -82,8 +82,12 @@ QgsAttributeDialog *QgsFeatureAction::newDialog( bool cloneFeature )\n       if ( !action.runable() )\n         continue;\n \n+      if( mLayer->readOnly() && action.isEnabledOnlyWhenEditable() )","path":"src/app/qgsfeatureaction.cpp","position":4,"original_position":4,"commit_id":"7a3dc4289d5553b7580d9ac400ca8550103fc526","original_commit_id":"7a3dc4289d5553b7580d9ac400ca8550103fc526","user":{"login":"nyalldawson","id":1829991,"avatar_url":"https://avatars1.githubusercontent.com/u/1829991?v=4","gravatar_id":"","url":"https://api.github.com/users/nyalldawson","html_url":"https://github.com/nyalldawson","followers_url":"https://api.github.com/users/nyalldawson/followers","following_url":"https://api.github.com/users/nyalldawson/following{/other_user}","gists_url":"https://api.github.com/users/nyalldawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nyalldawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyalldawson/subscriptions","organizations_url":"https://api.github.com/users/nyalldawson/orgs","repos_url":"https://api.github.com/users/nyalldawson/repos","events_url":"https://api.github.com/users/nyalldawson/events{/privacy}","received_events_url":"https://api.github.com/users/nyalldawson/received_events","type":"User","site_admin":false},"body":"Also here update to skip  the action if the layer is not isEditable(). (And the other places below too)","created_at":"2018-02-23T01:25:22Z","updated_at":"2018-02-23T01:27:05Z","html_url":"https://github.com/qgis/QGIS/pull/6430#discussion_r170143873","pull_request_url":"https://api.github.com/repos/qgis/QGIS/pulls/6430","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments/170143873"},"html":{"href":"https://github.com/qgis/QGIS/pull/6430#discussion_r170143873"},"pull_request":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/6430"}}},"pull_request":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/6430","id":170908618,"html_url":"https://github.com/qgis/QGIS/pull/6430","diff_url":"https://github.com/qgis/QGIS/pull/6430.diff","patch_url":"https://github.com/qgis/QGIS/pull/6430.patch","issue_url":"https://api.github.com/repos/qgis/QGIS/issues/6430","number":6430,"state":"open","locked":false,"title":"Only enable duplication when layer editable","user":{"login":"signedav","id":28384354,"avatar_url":"https://avatars1.githubusercontent.com/u/28384354?v=4","gravatar_id":"","url":"https://api.github.com/users/signedav","html_url":"https://github.com/signedav","followers_url":"https://api.github.com/users/signedav/followers","following_url":"https://api.github.com/users/signedav/following{/other_user}","gists_url":"https://api.github.com/users/signedav/gists{/gist_id}","starred_url":"https://api.github.com/users/signedav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signedav/subscriptions","organizations_url":"https://api.github.com/users/signedav/orgs","repos_url":"https://api.github.com/users/signedav/repos","events_url":"https://api.github.com/users/signedav/events{/privacy}","received_events_url":"https://api.github.com/users/signedav/received_events","type":"User","site_admin":false},"body":"MapLayerActions and user actions has the attribute isEnabledOnlyWhenEditable.\r\nIn the user action it's configurable per checkbox in GUI. The MapLayerActions DuplicateFeature and DuplicateFeatureDigitized have it always active. User action Duplicate Selected Feature per default.\r\n\r\nIn the identify result panel the context menu only loads actions that are not onlyEnabledWhenEditable. Means DuplicateFeature is removed there.\r\nIn the attribute form dialog the action menu only loads actions that are not onlyEnabledWhenEditable or in editable mode and are not in AddFeatureMode. Means Duplicate Feature is removed on adding a feature.\r\n\r\nOtherwise its disabled when the layer is not in editable mode. It cannot be selected because it's onlyEnabledWhenEditable.\r\n\r\nIn case there would be somewhere the possiblity to select it, althoug the layer is not editable, DuplicateFeature would not toggle editable mode and no duplication could be done.\r\n\r\nWhere you can see Duplicate Feature and Duplicate Feature Digitized MapLayer Actions disabled when not in editable mode:\r\n- MapCanvas\r\n- Attribute form actions of existing feature\r\n- Attribute form relation widget rightclick\r\n- Attribute list in formview rightclick \r\n- Attribute list in listview rightclick \r\n- Attribute list with actions in column\r\n- Rightclick on feature on map \r\n\r\nWhere you can see Duplicate Selected Features user action:\r\n- Attribute list actions in toolbar\r\n\r\nWhere you can't see them at all:\r\n- Identify result panel\r\n- Attribute form actions of new feature\r\n","created_at":"2018-02-23T01:03:29Z","updated_at":"2018-02-23T01:27:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9daf5b6dc15f14f362055e2b60c91440149f6c19","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/qgis/QGIS/pulls/6430/commits","review_comments_url":"https://api.github.com/repos/qgis/QGIS/pulls/6430/comments","review_comment_url":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qgis/QGIS/issues/6430/comments","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/7a3dc4289d5553b7580d9ac400ca8550103fc526","head":{"label":"signedav:uxduplication","ref":"uxduplication","sha":"7a3dc4289d5553b7580d9ac400ca8550103fc526","user":{"login":"signedav","id":28384354,"avatar_url":"https://avatars1.githubusercontent.com/u/28384354?v=4","gravatar_id":"","url":"https://api.github.com/users/signedav","html_url":"https://github.com/signedav","followers_url":"https://api.github.com/users/signedav/followers","following_url":"https://api.github.com/users/signedav/following{/other_user}","gists_url":"https://api.github.com/users/signedav/gists{/gist_id}","starred_url":"https://api.github.com/users/signedav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signedav/subscriptions","organizations_url":"https://api.github.com/users/signedav/orgs","repos_url":"https://api.github.com/users/signedav/repos","events_url":"https://api.github.com/users/signedav/events{/privacy}","received_events_url":"https://api.github.com/users/signedav/received_events","type":"User","site_admin":false},"repo":{"id":97237349,"name":"QGIS","full_name":"signedav/QGIS","owner":{"login":"signedav","id":28384354,"avatar_url":"https://avatars1.githubusercontent.com/u/28384354?v=4","gravatar_id":"","url":"https://api.github.com/users/signedav","html_url":"https://github.com/signedav","followers_url":"https://api.github.com/users/signedav/followers","following_url":"https://api.github.com/users/signedav/following{/other_user}","gists_url":"https://api.github.com/users/signedav/gists{/gist_id}","starred_url":"https://api.github.com/users/signedav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signedav/subscriptions","organizations_url":"https://api.github.com/users/signedav/orgs","repos_url":"https://api.github.com/users/signedav/repos","events_url":"https://api.github.com/users/signedav/events{/privacy}","received_events_url":"https://api.github.com/users/signedav/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/signedav/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":true,"url":"https://api.github.com/repos/signedav/QGIS","forks_url":"https://api.github.com/repos/signedav/QGIS/forks","keys_url":"https://api.github.com/repos/signedav/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signedav/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signedav/QGIS/teams","hooks_url":"https://api.github.com/repos/signedav/QGIS/hooks","issue_events_url":"https://api.github.com/repos/signedav/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/signedav/QGIS/events","assignees_url":"https://api.github.com/repos/signedav/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/signedav/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/signedav/QGIS/tags","blobs_url":"https://api.github.com/repos/signedav/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signedav/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signedav/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/signedav/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signedav/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/signedav/QGIS/languages","stargazers_url":"https://api.github.com/repos/signedav/QGIS/stargazers","contributors_url":"https://api.github.com/repos/signedav/QGIS/contributors","subscribers_url":"https://api.github.com/repos/signedav/QGIS/subscribers","subscription_url":"https://api.github.com/repos/signedav/QGIS/subscription","commits_url":"https://api.github.com/repos/signedav/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/signedav/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/signedav/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/signedav/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/signedav/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/signedav/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signedav/QGIS/merges","archive_url":"https://api.github.com/repos/signedav/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signedav/QGIS/downloads","issues_url":"https://api.github.com/repos/signedav/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/signedav/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/signedav/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/signedav/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signedav/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/signedav/QGIS/releases{/id}","deployments_url":"https://api.github.com/repos/signedav/QGIS/deployments","created_at":"2017-07-14T13:35:43Z","updated_at":"2017-07-14T13:36:14Z","pushed_at":"2018-02-23T01:23:47Z","git_url":"git://github.com/signedav/QGIS.git","ssh_url":"git@github.com:signedav/QGIS.git","clone_url":"https://github.com/signedav/QGIS.git","svn_url":"https://github.com/signedav/QGIS","homepage":"http://qgis.org","size":1370293,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"qgis:master","ref":"master","sha":"5f664944461d200f7b924e60f19fb252d6e0b232","user":{"login":"qgis","id":483444,"avatar_url":"https://avatars3.githubusercontent.com/u/483444?v=4","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"repo":{"id":1690480,"name":"QGIS","full_name":"qgis/QGIS","owner":{"login":"qgis","id":483444,"avatar_url":"https://avatars3.githubusercontent.com/u/483444?v=4","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qgis/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":false,"url":"https://api.github.com/repos/qgis/QGIS","forks_url":"https://api.github.com/repos/qgis/QGIS/forks","keys_url":"https://api.github.com/repos/qgis/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qgis/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qgis/QGIS/teams","hooks_url":"https://api.github.com/repos/qgis/QGIS/hooks","issue_events_url":"https://api.github.com/repos/qgis/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/qgis/QGIS/events","assignees_url":"https://api.github.com/repos/qgis/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/qgis/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/qgis/QGIS/tags","blobs_url":"https://api.github.com/repos/qgis/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qgis/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qgis/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/qgis/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/qgis/QGIS/languages","stargazers_url":"https://api.github.com/repos/qgis/QGIS/stargazers","contributors_url":"https://api.github.com/repos/qgis/QGIS/contributors","subscribers_url":"https://api.github.com/repos/qgis/QGIS/subscribers","subscription_url":"https://api.github.com/repos/qgis/QGIS/subscription","commits_url":"https://api.github.com/repos/qgis/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/qgis/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/qgis/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/qgis/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/qgis/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/qgis/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qgis/QGIS/merges","archive_url":"https://api.github.com/repos/qgis/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qgis/QGIS/downloads","issues_url":"https://api.github.com/repos/qgis/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/qgis/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/qgis/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/qgis/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qgis/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/qgis/QGIS/releases{/id}","deployments_url":"https://api.github.com/repos/qgis/QGIS/deployments","created_at":"2011-05-02T08:06:26Z","updated_at":"2018-02-22T23:21:59Z","pushed_at":"2018-02-23T01:23:49Z","git_url":"git://github.com/qgis/QGIS.git","ssh_url":"git@github.com:qgis/QGIS.git","clone_url":"https://github.com/qgis/QGIS.git","svn_url":"https://github.com/qgis/QGIS","homepage":"http://qgis.org","size":1373271,"stargazers_count":1830,"watchers_count":1830,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1204,"mirror_url":null,"archived":false,"open_issues_count":116,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1204,"open_issues":116,"watchers":1830,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/6430"},"html":{"href":"https://github.com/qgis/QGIS/pull/6430"},"issue":{"href":"https://api.github.com/repos/qgis/QGIS/issues/6430"},"comments":{"href":"https://api.github.com/repos/qgis/QGIS/issues/6430/comments"},"review_comments":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/6430/comments"},"review_comment":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/6430/commits"},"statuses":{"href":"https://api.github.com/repos/qgis/QGIS/statuses/7a3dc4289d5553b7580d9ac400ca8550103fc526"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nyalldawson"}}