{"action":"created","comment":{"url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments/42355628","id":42355628,"diff_hunk":"@@ -197,3 +202,60 @@ void DlgAutoDJ::setTrackTableFont(const QFont& font) {\n void DlgAutoDJ::setTrackTableRowHeight(int rowHeight) {\n     m_pTrackTableView->setTrackTableRowHeight(rowHeight);\n }\n+\n+void DlgAutoDJ::updateSelectionInfo()\n+{\n+    int duration = 0;\n+    \n+    QModelIndexList indices = m_pTrackTableView->selectionModel()->selectedRows();\n+\n+    for(int i=0;i!= indices.size();i++) {\n+      TrackPointer pTrack = m_pAutoDJTableModel->getTrack(indices.at(i));\n+      if (pTrack) {\n+        duration += pTrack->getDuration();\n+      }\n+    }\n+\n+    QString label = QString();\n+    QString tooltip = QString();\n+    \n+    if (!indices.isEmpty()) {\n+    \t\n+      \tint hours = duration / 3600;\n+\tint minutes = (duration - (hours*3600)) / 60;\n+\tint seconds = duration - (hours * 3600) - (minutes*60);\n+\n+\tif (hours > 0) {\n+\t  label.append(tr(\"%Ln hour(s)\", \"duration_hours\", hours));\n+\t}\n+\t\n+\tif (minutes > 0) {\n+\t  if (hours > 0) { \n+\t    label.append(\", \");\n+\t  }\n+\t  label.append(tr(\"%Ln minute(s)\",\"duration_minutes\", minutes));\n+\t}","path":"src/dlgautodj.cpp","position":55,"original_position":55,"commit_id":"2db9bf1aac6799b97fa025dfddcfe466f65ad428","original_commit_id":"2db9bf1aac6799b97fa025dfddcfe466f65ad428","user":{"login":"jclaveau","id":1556489,"avatar_url":"https://avatars.githubusercontent.com/u/1556489?v=3","gravatar_id":"","url":"https://api.github.com/users/jclaveau","html_url":"https://github.com/jclaveau","followers_url":"https://api.github.com/users/jclaveau/followers","following_url":"https://api.github.com/users/jclaveau/following{/other_user}","gists_url":"https://api.github.com/users/jclaveau/gists{/gist_id}","starred_url":"https://api.github.com/users/jclaveau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jclaveau/subscriptions","organizations_url":"https://api.github.com/users/jclaveau/orgs","repos_url":"https://api.github.com/users/jclaveau/repos","events_url":"https://api.github.com/users/jclaveau/events{/privacy}","received_events_url":"https://api.github.com/users/jclaveau/received_events","type":"User","site_admin":false},"body":"Space missing.","created_at":"2015-10-19T10:21:38Z","updated_at":"2015-10-19T10:21:38Z","html_url":"https://github.com/mixxxdj/mixxx/pull/749#discussion_r42355628","pull_request_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/749","_links":{"self":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments/42355628"},"html":{"href":"https://github.com/mixxxdj/mixxx/pull/749#discussion_r42355628"},"pull_request":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/749"}}},"pull_request":{"url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/749","id":48027281,"html_url":"https://github.com/mixxxdj/mixxx/pull/749","diff_url":"https://github.com/mixxxdj/mixxx/pull/749.diff","patch_url":"https://github.com/mixxxdj/mixxx/pull/749.patch","issue_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/749","number":749,"state":"open","locked":false,"title":"Print duration of selected tracks in AutoDJ","user":{"login":"idcmp","id":165614,"avatar_url":"https://avatars.githubusercontent.com/u/165614?v=3","gravatar_id":"","url":"https://api.github.com/users/idcmp","html_url":"https://github.com/idcmp","followers_url":"https://api.github.com/users/idcmp/followers","following_url":"https://api.github.com/users/idcmp/following{/other_user}","gists_url":"https://api.github.com/users/idcmp/gists{/gist_id}","starred_url":"https://api.github.com/users/idcmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idcmp/subscriptions","organizations_url":"https://api.github.com/users/idcmp/orgs","repos_url":"https://api.github.com/users/idcmp/repos","events_url":"https://api.github.com/users/idcmp/events{/privacy}","received_events_url":"https://api.github.com/users/idcmp/received_events","type":"User","site_admin":false},"body":"Relates to https://bugs.launchpad.net/mixxx/+bug/1505408 and possibly offers a fix.\r\n\r\nAdds a human friendly duration of the selected tracks in AutoDJ next to the \"Enable AutoDJ\" button:\r\n\r\n    1 hour, 34 seconds (24 tracks)\r\n\r\nThe exact time is available as a tooltip.\r\n\r\nNOTE: I'm not a C++ programmer, so I may have overlooked something. :smile:\r\n\r\nI ran *lupdate* to update the mixxx.ts file. It made a truckload of changes to the file (mostly line number changes), but I've tried to only include the relevant lines in this pull request.\r\n\r\n(I'd love it if this could make the next 1.12 beta.)\r\n","created_at":"2015-10-19T03:02:33Z","updated_at":"2015-10-19T10:21:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4356c10f2e9579c6f01ad419b310293f8dc3e7e4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/749/commits","review_comments_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/749/comments","review_comment_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/749/comments","statuses_url":"https://api.github.com/repos/mixxxdj/mixxx/statuses/2db9bf1aac6799b97fa025dfddcfe466f65ad428","head":{"label":"idcmp:master","ref":"master","sha":"2db9bf1aac6799b97fa025dfddcfe466f65ad428","user":{"login":"idcmp","id":165614,"avatar_url":"https://avatars.githubusercontent.com/u/165614?v=3","gravatar_id":"","url":"https://api.github.com/users/idcmp","html_url":"https://github.com/idcmp","followers_url":"https://api.github.com/users/idcmp/followers","following_url":"https://api.github.com/users/idcmp/following{/other_user}","gists_url":"https://api.github.com/users/idcmp/gists{/gist_id}","starred_url":"https://api.github.com/users/idcmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idcmp/subscriptions","organizations_url":"https://api.github.com/users/idcmp/orgs","repos_url":"https://api.github.com/users/idcmp/repos","events_url":"https://api.github.com/users/idcmp/events{/privacy}","received_events_url":"https://api.github.com/users/idcmp/received_events","type":"User","site_admin":false},"repo":{"id":44500568,"name":"mixxx","full_name":"idcmp/mixxx","owner":{"login":"idcmp","id":165614,"avatar_url":"https://avatars.githubusercontent.com/u/165614?v=3","gravatar_id":"","url":"https://api.github.com/users/idcmp","html_url":"https://github.com/idcmp","followers_url":"https://api.github.com/users/idcmp/followers","following_url":"https://api.github.com/users/idcmp/following{/other_user}","gists_url":"https://api.github.com/users/idcmp/gists{/gist_id}","starred_url":"https://api.github.com/users/idcmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idcmp/subscriptions","organizations_url":"https://api.github.com/users/idcmp/orgs","repos_url":"https://api.github.com/users/idcmp/repos","events_url":"https://api.github.com/users/idcmp/events{/privacy}","received_events_url":"https://api.github.com/users/idcmp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/idcmp/mixxx","description":"Mixxx is Free DJ software that gives you everything you need to perform live mixes.","fork":true,"url":"https://api.github.com/repos/idcmp/mixxx","forks_url":"https://api.github.com/repos/idcmp/mixxx/forks","keys_url":"https://api.github.com/repos/idcmp/mixxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/idcmp/mixxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/idcmp/mixxx/teams","hooks_url":"https://api.github.com/repos/idcmp/mixxx/hooks","issue_events_url":"https://api.github.com/repos/idcmp/mixxx/issues/events{/number}","events_url":"https://api.github.com/repos/idcmp/mixxx/events","assignees_url":"https://api.github.com/repos/idcmp/mixxx/assignees{/user}","branches_url":"https://api.github.com/repos/idcmp/mixxx/branches{/branch}","tags_url":"https://api.github.com/repos/idcmp/mixxx/tags","blobs_url":"https://api.github.com/repos/idcmp/mixxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/idcmp/mixxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/idcmp/mixxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/idcmp/mixxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/idcmp/mixxx/statuses/{sha}","languages_url":"https://api.github.com/repos/idcmp/mixxx/languages","stargazers_url":"https://api.github.com/repos/idcmp/mixxx/stargazers","contributors_url":"https://api.github.com/repos/idcmp/mixxx/contributors","subscribers_url":"https://api.github.com/repos/idcmp/mixxx/subscribers","subscription_url":"https://api.github.com/repos/idcmp/mixxx/subscription","commits_url":"https://api.github.com/repos/idcmp/mixxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/idcmp/mixxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/idcmp/mixxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/idcmp/mixxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/idcmp/mixxx/contents/{+path}","compare_url":"https://api.github.com/repos/idcmp/mixxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/idcmp/mixxx/merges","archive_url":"https://api.github.com/repos/idcmp/mixxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/idcmp/mixxx/downloads","issues_url":"https://api.github.com/repos/idcmp/mixxx/issues{/number}","pulls_url":"https://api.github.com/repos/idcmp/mixxx/pulls{/number}","milestones_url":"https://api.github.com/repos/idcmp/mixxx/milestones{/number}","notifications_url":"https://api.github.com/repos/idcmp/mixxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/idcmp/mixxx/labels{/name}","releases_url":"https://api.github.com/repos/idcmp/mixxx/releases{/id}","created_at":"2015-10-18T23:14:53Z","updated_at":"2015-10-18T23:15:21Z","pushed_at":"2015-10-19T02:57:35Z","git_url":"git://github.com/idcmp/mixxx.git","ssh_url":"git@github.com:idcmp/mixxx.git","clone_url":"https://github.com/idcmp/mixxx.git","svn_url":"https://github.com/idcmp/mixxx","homepage":"http://mixxx.org","size":333501,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mixxxdj:master","ref":"master","sha":"b8c9d92c70b5c15e4b1fb40db9f9f4228748a8f8","user":{"login":"mixxxdj","id":1743769,"avatar_url":"https://avatars.githubusercontent.com/u/1743769?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxxdj","html_url":"https://github.com/mixxxdj","followers_url":"https://api.github.com/users/mixxxdj/followers","following_url":"https://api.github.com/users/mixxxdj/following{/other_user}","gists_url":"https://api.github.com/users/mixxxdj/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxxdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxxdj/subscriptions","organizations_url":"https://api.github.com/users/mixxxdj/orgs","repos_url":"https://api.github.com/users/mixxxdj/repos","events_url":"https://api.github.com/users/mixxxdj/events{/privacy}","received_events_url":"https://api.github.com/users/mixxxdj/received_events","type":"Organization","site_admin":false},"repo":{"id":10126031,"name":"mixxx","full_name":"mixxxdj/mixxx","owner":{"login":"mixxxdj","id":1743769,"avatar_url":"https://avatars.githubusercontent.com/u/1743769?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxxdj","html_url":"https://github.com/mixxxdj","followers_url":"https://api.github.com/users/mixxxdj/followers","following_url":"https://api.github.com/users/mixxxdj/following{/other_user}","gists_url":"https://api.github.com/users/mixxxdj/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxxdj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxxdj/subscriptions","organizations_url":"https://api.github.com/users/mixxxdj/orgs","repos_url":"https://api.github.com/users/mixxxdj/repos","events_url":"https://api.github.com/users/mixxxdj/events{/privacy}","received_events_url":"https://api.github.com/users/mixxxdj/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mixxxdj/mixxx","description":"Mixxx is Free DJ software that gives you everything you need to perform live mixes.","fork":false,"url":"https://api.github.com/repos/mixxxdj/mixxx","forks_url":"https://api.github.com/repos/mixxxdj/mixxx/forks","keys_url":"https://api.github.com/repos/mixxxdj/mixxx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mixxxdj/mixxx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mixxxdj/mixxx/teams","hooks_url":"https://api.github.com/repos/mixxxdj/mixxx/hooks","issue_events_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/events{/number}","events_url":"https://api.github.com/repos/mixxxdj/mixxx/events","assignees_url":"https://api.github.com/repos/mixxxdj/mixxx/assignees{/user}","branches_url":"https://api.github.com/repos/mixxxdj/mixxx/branches{/branch}","tags_url":"https://api.github.com/repos/mixxxdj/mixxx/tags","blobs_url":"https://api.github.com/repos/mixxxdj/mixxx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mixxxdj/mixxx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mixxxdj/mixxx/git/refs{/sha}","trees_url":"https://api.github.com/repos/mixxxdj/mixxx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mixxxdj/mixxx/statuses/{sha}","languages_url":"https://api.github.com/repos/mixxxdj/mixxx/languages","stargazers_url":"https://api.github.com/repos/mixxxdj/mixxx/stargazers","contributors_url":"https://api.github.com/repos/mixxxdj/mixxx/contributors","subscribers_url":"https://api.github.com/repos/mixxxdj/mixxx/subscribers","subscription_url":"https://api.github.com/repos/mixxxdj/mixxx/subscription","commits_url":"https://api.github.com/repos/mixxxdj/mixxx/commits{/sha}","git_commits_url":"https://api.github.com/repos/mixxxdj/mixxx/git/commits{/sha}","comments_url":"https://api.github.com/repos/mixxxdj/mixxx/comments{/number}","issue_comment_url":"https://api.github.com/repos/mixxxdj/mixxx/issues/comments{/number}","contents_url":"https://api.github.com/repos/mixxxdj/mixxx/contents/{+path}","compare_url":"https://api.github.com/repos/mixxxdj/mixxx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mixxxdj/mixxx/merges","archive_url":"https://api.github.com/repos/mixxxdj/mixxx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mixxxdj/mixxx/downloads","issues_url":"https://api.github.com/repos/mixxxdj/mixxx/issues{/number}","pulls_url":"https://api.github.com/repos/mixxxdj/mixxx/pulls{/number}","milestones_url":"https://api.github.com/repos/mixxxdj/mixxx/milestones{/number}","notifications_url":"https://api.github.com/repos/mixxxdj/mixxx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mixxxdj/mixxx/labels{/name}","releases_url":"https://api.github.com/repos/mixxxdj/mixxx/releases{/id}","created_at":"2013-05-17T15:14:38Z","updated_at":"2015-10-18T17:52:58Z","pushed_at":"2015-10-19T05:32:27Z","git_url":"git://github.com/mixxxdj/mixxx.git","ssh_url":"git@github.com:mixxxdj/mixxx.git","clone_url":"https://github.com/mixxxdj/mixxx.git","svn_url":"https://github.com/mixxxdj/mixxx","homepage":"http://mixxx.org","size":333501,"stargazers_count":370,"watchers_count":370,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":257,"mirror_url":null,"open_issues_count":67,"forks":257,"open_issues":67,"watchers":370,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/749"},"html":{"href":"https://github.com/mixxxdj/mixxx/pull/749"},"issue":{"href":"https://api.github.com/repos/mixxxdj/mixxx/issues/749"},"comments":{"href":"https://api.github.com/repos/mixxxdj/mixxx/issues/749/comments"},"review_comments":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/749/comments"},"review_comment":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mixxxdj/mixxx/pulls/749/commits"},"statuses":{"href":"https://api.github.com/repos/mixxxdj/mixxx/statuses/2db9bf1aac6799b97fa025dfddcfe466f65ad428"}}}}