{"action":"created","comment":{"url":"https://api.github.com/repos/tux3/qTox/pulls/comments/32650277","id":32650277,"diff_hunk":"@@ -141,3 +571,80 @@ void FriendListWidget::reDraw()\n     show();\n     resize(QSize()); //lifehack\n }\n+\n+CircleWidget* FriendListWidget::createCircleWidget(int id)\n+{\n+    bool isNew = (id == -1);\n+\n+    if (id == -1)\n+        id = Settings::getInstance().addCircle();\n+\n+    // Stop, after it has been created. Code after this is for displaying.\n+    if (mode == Activity)\n+        return nullptr;\n+\n+    CircleWidget* circleWidget = new CircleWidget(this, id);\n+    circleLayout->addSortedWidget(circleWidget);\n+    connect(this, &FriendListWidget::onCompactChanged, circleWidget, &CircleWidget::onCompactChanged);\n+    connect(circleWidget, &CircleWidget::renameRequested, this, &FriendListWidget::renameCircleWidget);\n+    circleWidget->show(); // Avoid flickering.\n+\n+    if (isNew)\n+        circleWidget->editName();\n+\n+    return circleWidget;\n+}\n+\n+QLayout* FriendListWidget::nextLayout(QLayout* layout, bool forward) const\n+{\n+    if (layout == groupLayout.getLayout())\n+    {\n+        if (forward)\n+        {\n+            if (groupsOnTop)\n+                return listLayout->getLayoutOnline();\n+            return listLayout->getLayoutOffline();\n+        }\n+        else\n+        {\n+            if (groupsOnTop)\n+                return circleLayout->getLayout();\n+            return listLayout->getLayoutOnline();\n+        }\n+    }\n+    else if (layout == listLayout->getLayoutOnline())\n+    {\n+        if (forward)\n+        {\n+            if (groupsOnTop)\n+                return listLayout->getLayoutOffline();\n+            return groupLayout.getLayout();\n+        }\n+        else\n+        {\n+            if (groupsOnTop)\n+                return groupLayout.getLayout();\n+            return circleLayout->getLayout();\n+        }\n+    }\n+    else if (layout == listLayout->getLayoutOffline())\n+    {\n+        if (forward)\n+            return circleLayout->getLayout();\n+        else if (groupsOnTop)\n+            return listLayout->getLayoutOnline();","path":"src/widget/friendlistwidget.cpp","position":682,"original_position":682,"commit_id":"478e0d8dbf245cead6e6321610cfa8dde743a623","original_commit_id":"478e0d8dbf245cead6e6321610cfa8dde743a623","user":{"login":"zetok","id":3148759,"avatar_url":"https://avatars.githubusercontent.com/u/3148759?v=3","gravatar_id":"","url":"https://api.github.com/users/zetok","html_url":"https://github.com/zetok","followers_url":"https://api.github.com/users/zetok/followers","following_url":"https://api.github.com/users/zetok/following{/other_user}","gists_url":"https://api.github.com/users/zetok/gists{/gist_id}","starred_url":"https://api.github.com/users/zetok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zetok/subscriptions","organizations_url":"https://api.github.com/users/zetok/orgs","repos_url":"https://api.github.com/users/zetok/repos","events_url":"https://api.github.com/users/zetok/events{/privacy}","received_events_url":"https://api.github.com/users/zetok/received_events","type":"User","site_admin":false},"body":"``\\n``","created_at":"2015-06-17T17:12:17Z","updated_at":"2015-06-17T17:12:17Z","html_url":"https://github.com/tux3/qTox/pull/1879#discussion_r32650277","pull_request_url":"https://api.github.com/repos/tux3/qTox/pulls/1879","_links":{"self":{"href":"https://api.github.com/repos/tux3/qTox/pulls/comments/32650277"},"html":{"href":"https://github.com/tux3/qTox/pull/1879#discussion_r32650277"},"pull_request":{"href":"https://api.github.com/repos/tux3/qTox/pulls/1879"}}},"pull_request":{"url":"https://api.github.com/repos/tux3/qTox/pulls/1879","id":37896609,"html_url":"https://github.com/tux3/qTox/pull/1879","diff_url":"https://github.com/tux3/qTox/pull/1879.diff","patch_url":"https://github.com/tux3/qTox/pull/1879.patch","issue_url":"https://api.github.com/repos/tux3/qTox/issues/1879","number":1879,"state":"open","locked":false,"title":"Friends list improvements (including contact groups and activity sort)","user":{"login":"TheSpiritXIII","id":4027687,"avatar_url":"https://avatars.githubusercontent.com/u/4027687?v=3","gravatar_id":"","url":"https://api.github.com/users/TheSpiritXIII","html_url":"https://github.com/TheSpiritXIII","followers_url":"https://api.github.com/users/TheSpiritXIII/followers","following_url":"https://api.github.com/users/TheSpiritXIII/following{/other_user}","gists_url":"https://api.github.com/users/TheSpiritXIII/gists{/gist_id}","starred_url":"https://api.github.com/users/TheSpiritXIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheSpiritXIII/subscriptions","organizations_url":"https://api.github.com/users/TheSpiritXIII/orgs","repos_url":"https://api.github.com/users/TheSpiritXIII/repos","events_url":"https://api.github.com/users/TheSpiritXIII/events{/privacy}","received_events_url":"https://api.github.com/users/TheSpiritXIII/received_events","type":"User","site_admin":false},"body":"This is a big commit, meant to improve consistency and introduce new features. It includes the following changes:\r\n- Organize friends using “circles”. Includes a compact mode.\r\n- Search and filter through friends within circles.\r\n- Ability to cycle between circles. Cycling is also now O(log n) instead of O(n).\r\n- Friends add/status change find fixed from O(n) to O(log n).\r\n- Dragging friends over groups or circles highlights the group or circle.\r\n- Inline renaming of friends, groups and circles.\r\n- When groups and circles are added, users rename them immediately.\r\n- Groups and circles are sorted alphabetically.\r\n- Notification expand the circle that the friend is in.\r\n- View friends by sorting by activity.\r\n\r\nTested extensively with Valgrind. Let me know if there are any problems.\r\n\r\nThis fixes: #1125 #1356 ","created_at":"2015-06-17T12:48:38Z","updated_at":"2015-06-17T17:12:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e52ade2ddf5a75a8c1dbfa817bd4bcad6fd2319c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tux3/qTox/pulls/1879/commits","review_comments_url":"https://api.github.com/repos/tux3/qTox/pulls/1879/comments","review_comment_url":"https://api.github.com/repos/tux3/qTox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tux3/qTox/issues/1879/comments","statuses_url":"https://api.github.com/repos/tux3/qTox/statuses/478e0d8dbf245cead6e6321610cfa8dde743a623","head":{"label":"TheSpiritXIII:circles","ref":"circles","sha":"478e0d8dbf245cead6e6321610cfa8dde743a623","user":{"login":"TheSpiritXIII","id":4027687,"avatar_url":"https://avatars.githubusercontent.com/u/4027687?v=3","gravatar_id":"","url":"https://api.github.com/users/TheSpiritXIII","html_url":"https://github.com/TheSpiritXIII","followers_url":"https://api.github.com/users/TheSpiritXIII/followers","following_url":"https://api.github.com/users/TheSpiritXIII/following{/other_user}","gists_url":"https://api.github.com/users/TheSpiritXIII/gists{/gist_id}","starred_url":"https://api.github.com/users/TheSpiritXIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheSpiritXIII/subscriptions","organizations_url":"https://api.github.com/users/TheSpiritXIII/orgs","repos_url":"https://api.github.com/users/TheSpiritXIII/repos","events_url":"https://api.github.com/users/TheSpiritXIII/events{/privacy}","received_events_url":"https://api.github.com/users/TheSpiritXIII/received_events","type":"User","site_admin":false},"repo":{"id":31904795,"name":"qTox","full_name":"TheSpiritXIII/qTox","owner":{"login":"TheSpiritXIII","id":4027687,"avatar_url":"https://avatars.githubusercontent.com/u/4027687?v=3","gravatar_id":"","url":"https://api.github.com/users/TheSpiritXIII","html_url":"https://github.com/TheSpiritXIII","followers_url":"https://api.github.com/users/TheSpiritXIII/followers","following_url":"https://api.github.com/users/TheSpiritXIII/following{/other_user}","gists_url":"https://api.github.com/users/TheSpiritXIII/gists{/gist_id}","starred_url":"https://api.github.com/users/TheSpiritXIII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheSpiritXIII/subscriptions","organizations_url":"https://api.github.com/users/TheSpiritXIII/orgs","repos_url":"https://api.github.com/users/TheSpiritXIII/repos","events_url":"https://api.github.com/users/TheSpiritXIII/events{/privacy}","received_events_url":"https://api.github.com/users/TheSpiritXIII/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TheSpiritXIII/qTox","description":"Powerful Tox client that follows the Tox design guidelines. Formerly called toxgui","fork":true,"url":"https://api.github.com/repos/TheSpiritXIII/qTox","forks_url":"https://api.github.com/repos/TheSpiritXIII/qTox/forks","keys_url":"https://api.github.com/repos/TheSpiritXIII/qTox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheSpiritXIII/qTox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheSpiritXIII/qTox/teams","hooks_url":"https://api.github.com/repos/TheSpiritXIII/qTox/hooks","issue_events_url":"https://api.github.com/repos/TheSpiritXIII/qTox/issues/events{/number}","events_url":"https://api.github.com/repos/TheSpiritXIII/qTox/events","assignees_url":"https://api.github.com/repos/TheSpiritXIII/qTox/assignees{/user}","branches_url":"https://api.github.com/repos/TheSpiritXIII/qTox/branches{/branch}","tags_url":"https://api.github.com/repos/TheSpiritXIII/qTox/tags","blobs_url":"https://api.github.com/repos/TheSpiritXIII/qTox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheSpiritXIII/qTox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheSpiritXIII/qTox/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheSpiritXIII/qTox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheSpiritXIII/qTox/statuses/{sha}","languages_url":"https://api.github.com/repos/TheSpiritXIII/qTox/languages","stargazers_url":"https://api.github.com/repos/TheSpiritXIII/qTox/stargazers","contributors_url":"https://api.github.com/repos/TheSpiritXIII/qTox/contributors","subscribers_url":"https://api.github.com/repos/TheSpiritXIII/qTox/subscribers","subscription_url":"https://api.github.com/repos/TheSpiritXIII/qTox/subscription","commits_url":"https://api.github.com/repos/TheSpiritXIII/qTox/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheSpiritXIII/qTox/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheSpiritXIII/qTox/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheSpiritXIII/qTox/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheSpiritXIII/qTox/contents/{+path}","compare_url":"https://api.github.com/repos/TheSpiritXIII/qTox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheSpiritXIII/qTox/merges","archive_url":"https://api.github.com/repos/TheSpiritXIII/qTox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheSpiritXIII/qTox/downloads","issues_url":"https://api.github.com/repos/TheSpiritXIII/qTox/issues{/number}","pulls_url":"https://api.github.com/repos/TheSpiritXIII/qTox/pulls{/number}","milestones_url":"https://api.github.com/repos/TheSpiritXIII/qTox/milestones{/number}","notifications_url":"https://api.github.com/repos/TheSpiritXIII/qTox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheSpiritXIII/qTox/labels{/name}","releases_url":"https://api.github.com/repos/TheSpiritXIII/qTox/releases{/id}","created_at":"2015-03-09T15:01:04Z","updated_at":"2015-06-17T14:19:40Z","pushed_at":"2015-06-17T12:56:50Z","git_url":"git://github.com/TheSpiritXIII/qTox.git","ssh_url":"git@github.com:TheSpiritXIII/qTox.git","clone_url":"https://github.com/TheSpiritXIII/qTox.git","svn_url":"https://github.com/TheSpiritXIII/qTox","homepage":"http://utoxisfinished.info","size":16739,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"tux3:master","ref":"master","sha":"ce2c8309a28dc49ec005610791062ee55633ef80","user":{"login":"tux3","id":5155966,"avatar_url":"https://avatars.githubusercontent.com/u/5155966?v=3","gravatar_id":"","url":"https://api.github.com/users/tux3","html_url":"https://github.com/tux3","followers_url":"https://api.github.com/users/tux3/followers","following_url":"https://api.github.com/users/tux3/following{/other_user}","gists_url":"https://api.github.com/users/tux3/gists{/gist_id}","starred_url":"https://api.github.com/users/tux3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tux3/subscriptions","organizations_url":"https://api.github.com/users/tux3/orgs","repos_url":"https://api.github.com/users/tux3/repos","events_url":"https://api.github.com/users/tux3/events{/privacy}","received_events_url":"https://api.github.com/users/tux3/received_events","type":"User","site_admin":false},"repo":{"id":21179164,"name":"qTox","full_name":"tux3/qTox","owner":{"login":"tux3","id":5155966,"avatar_url":"https://avatars.githubusercontent.com/u/5155966?v=3","gravatar_id":"","url":"https://api.github.com/users/tux3","html_url":"https://github.com/tux3","followers_url":"https://api.github.com/users/tux3/followers","following_url":"https://api.github.com/users/tux3/following{/other_user}","gists_url":"https://api.github.com/users/tux3/gists{/gist_id}","starred_url":"https://api.github.com/users/tux3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tux3/subscriptions","organizations_url":"https://api.github.com/users/tux3/orgs","repos_url":"https://api.github.com/users/tux3/repos","events_url":"https://api.github.com/users/tux3/events{/privacy}","received_events_url":"https://api.github.com/users/tux3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tux3/qTox","description":"Powerful Tox client that follows the Tox design guidelines.","fork":false,"url":"https://api.github.com/repos/tux3/qTox","forks_url":"https://api.github.com/repos/tux3/qTox/forks","keys_url":"https://api.github.com/repos/tux3/qTox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tux3/qTox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tux3/qTox/teams","hooks_url":"https://api.github.com/repos/tux3/qTox/hooks","issue_events_url":"https://api.github.com/repos/tux3/qTox/issues/events{/number}","events_url":"https://api.github.com/repos/tux3/qTox/events","assignees_url":"https://api.github.com/repos/tux3/qTox/assignees{/user}","branches_url":"https://api.github.com/repos/tux3/qTox/branches{/branch}","tags_url":"https://api.github.com/repos/tux3/qTox/tags","blobs_url":"https://api.github.com/repos/tux3/qTox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tux3/qTox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tux3/qTox/git/refs{/sha}","trees_url":"https://api.github.com/repos/tux3/qTox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tux3/qTox/statuses/{sha}","languages_url":"https://api.github.com/repos/tux3/qTox/languages","stargazers_url":"https://api.github.com/repos/tux3/qTox/stargazers","contributors_url":"https://api.github.com/repos/tux3/qTox/contributors","subscribers_url":"https://api.github.com/repos/tux3/qTox/subscribers","subscription_url":"https://api.github.com/repos/tux3/qTox/subscription","commits_url":"https://api.github.com/repos/tux3/qTox/commits{/sha}","git_commits_url":"https://api.github.com/repos/tux3/qTox/git/commits{/sha}","comments_url":"https://api.github.com/repos/tux3/qTox/comments{/number}","issue_comment_url":"https://api.github.com/repos/tux3/qTox/issues/comments{/number}","contents_url":"https://api.github.com/repos/tux3/qTox/contents/{+path}","compare_url":"https://api.github.com/repos/tux3/qTox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tux3/qTox/merges","archive_url":"https://api.github.com/repos/tux3/qTox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tux3/qTox/downloads","issues_url":"https://api.github.com/repos/tux3/qTox/issues{/number}","pulls_url":"https://api.github.com/repos/tux3/qTox/pulls{/number}","milestones_url":"https://api.github.com/repos/tux3/qTox/milestones{/number}","notifications_url":"https://api.github.com/repos/tux3/qTox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tux3/qTox/labels{/name}","releases_url":"https://api.github.com/repos/tux3/qTox/releases{/id}","created_at":"2014-06-24T20:09:04Z","updated_at":"2015-06-17T02:30:01Z","pushed_at":"2015-06-17T12:56:51Z","git_url":"git://github.com/tux3/qTox.git","ssh_url":"git@github.com:tux3/qTox.git","clone_url":"https://github.com/tux3/qTox.git","svn_url":"https://github.com/tux3/qTox","homepage":"http://utoxisfinished.info","size":28706,"stargazers_count":474,"watchers_count":474,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"open_issues_count":368,"forks":157,"open_issues":368,"watchers":474,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tux3/qTox/pulls/1879"},"html":{"href":"https://github.com/tux3/qTox/pull/1879"},"issue":{"href":"https://api.github.com/repos/tux3/qTox/issues/1879"},"comments":{"href":"https://api.github.com/repos/tux3/qTox/issues/1879/comments"},"review_comments":{"href":"https://api.github.com/repos/tux3/qTox/pulls/1879/comments"},"review_comment":{"href":"https://api.github.com/repos/tux3/qTox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tux3/qTox/pulls/1879/commits"},"statuses":{"href":"https://api.github.com/repos/tux3/qTox/statuses/478e0d8dbf245cead6e6321610cfa8dde743a623"}}}}