{"action":"created","comment":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/32371973","id":32371973,"diff_hunk":"@@ -0,0 +1,109 @@\n+/*\n+ * Bittorrent Client using Qt4 and libtorrent.\n+ * Copyright (C) 2006  Christophe Dumez\n+ *\n+ * This program is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License\n+ * as published by the Free Software Foundation; either version 2\n+ * of the License, or (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program; if not, write to the Free Software\n+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n+ *\n+ * In addition, as a special exception, the copyright holders give permission to\n+ * link this program with the OpenSSL project's \"OpenSSL\" library (or with\n+ * modified versions of it that use the same license as the \"OpenSSL\" library),\n+ * and distribute the linked executables. You must obey the GNU General Public\n+ * License in all respects for all of the code used other than \"OpenSSL\".  If you\n+ * modify file(s), you may extend this exception to your version of the file(s),\n+ * but you are not obligated to do so. If you do not wish to do so, delete this\n+ * exception statement from your version.\n+ *\n+ * Contact : chris@qbittorrent.org\n+ */\n+\n+#include <QMessageBox>\n+#include <QHostAddress>\n+\n+#include \"peersadditiondlg.h\"\n+\n+PeersAdditionDlg::PeersAdditionDlg(QWidget *parent)\n+    : QDialog(parent)\n+{\n+    setupUi(this);\n+    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));\n+    connect(buttonBox, SIGNAL(accepted()), this, SLOT(validateInput()));\n+\n+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))\n+    label_format->hide();\n+    peers_txt->setPlaceholderText(\"Example:\\n198.51.100.1:20000\\n[2001:f0d0:1002:51::4]:20000\");\n+#endif\n+}\n+\n+QList<BitTorrent::PeerAddress> PeersAdditionDlg::askForPeersEndpoints()\n+{\n+    PeersAdditionDlg dlg;\n+    dlg.exec();\n+    return dlg.peers_list;\n+}\n+\n+void PeersAdditionDlg::validateInput()\n+{\n+    if (peers_txt->toPlainText().trimmed().isEmpty()) {\n+        QMessageBox::warning(this, tr(\"No peer entered\"),\n+                    tr(\"Please type at least one peer.\"),\n+                    QMessageBox::Ok);\n+        return;\n+    }\n+\n+    QStringList peers = peers_txt->toPlainText().trimmed().split(\"\\n\");\n+    bool ok;\n+    bool all_valid = true;\n+    QString invalid_peer;\n+    foreach (const QString &peer, peers) {\n+        if (peer.lastIndexOf(\":\") == -1) {\n+            qDebug(\"Unable to parse the provided peer: %s\", qPrintable(peer));\n+            all_valid = false;\n+\t    invalid_peer = peer;","path":"src/gui/properties/peersadditiondlg.cpp","position":73,"original_position":73,"commit_id":"771bf4518de05ba20f7a8f298bdb31a162104b41","original_commit_id":"771bf4518de05ba20f7a8f298bdb31a162104b41","user":{"login":"sledgehammer999","id":273315,"avatar_url":"https://avatars.githubusercontent.com/u/273315?v=3","gravatar_id":"","url":"https://api.github.com/users/sledgehammer999","html_url":"https://github.com/sledgehammer999","followers_url":"https://api.github.com/users/sledgehammer999/followers","following_url":"https://api.github.com/users/sledgehammer999/following{/other_user}","gists_url":"https://api.github.com/users/sledgehammer999/gists{/gist_id}","starred_url":"https://api.github.com/users/sledgehammer999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sledgehammer999/subscriptions","organizations_url":"https://api.github.com/users/sledgehammer999/orgs","repos_url":"https://api.github.com/users/sledgehammer999/repos","events_url":"https://api.github.com/users/sledgehammer999/events{/privacy}","received_events_url":"https://api.github.com/users/sledgehammer999/received_events","type":"User","site_admin":false},"body":"indentation","created_at":"2015-06-13T16:59:20Z","updated_at":"2015-06-13T16:59:20Z","html_url":"https://github.com/qbittorrent/qBittorrent/pull/3150#discussion_r32371973","pull_request_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/3150","_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/32371973"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/3150#discussion_r32371973"},"pull_request":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/3150"}}},"pull_request":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/3150","id":37085258,"html_url":"https://github.com/qbittorrent/qBittorrent/pull/3150","diff_url":"https://github.com/qbittorrent/qBittorrent/pull/3150.diff","patch_url":"https://github.com/qbittorrent/qBittorrent/pull/3150.patch","issue_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/3150","number":3150,"state":"open","locked":false,"title":"Add multiple peers in Peers addition dialog. Closes #1563, Closes #2245, Closes #3133","user":{"login":"ngosang","id":10577978,"avatar_url":"https://avatars.githubusercontent.com/u/10577978?v=3","gravatar_id":"","url":"https://api.github.com/users/ngosang","html_url":"https://github.com/ngosang","followers_url":"https://api.github.com/users/ngosang/followers","following_url":"https://api.github.com/users/ngosang/following{/other_user}","gists_url":"https://api.github.com/users/ngosang/gists{/gist_id}","starred_url":"https://api.github.com/users/ngosang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngosang/subscriptions","organizations_url":"https://api.github.com/users/ngosang/orgs","repos_url":"https://api.github.com/users/ngosang/repos","events_url":"https://api.github.com/users/ngosang/events{/privacy}","received_events_url":"https://api.github.com/users/ngosang/received_events","type":"User","site_admin":false},"body":"Closes #1563,  #2245 and #3133.\r\n\r\nBefore:\r\n![](http://i.imgur.com/CwCQVBl.png)\r\nAfter: (Qt4)\r\n![](http://i.imgur.com/qpHXl9M.png)\r\nAfter: (Qt5)\r\n![](http://i.imgur.com/c898tfZ.png)","created_at":"2015-06-06T05:20:31Z","updated_at":"2015-06-13T16:59:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fea2da840e6ad84581f6624ed5a2bddb32a581c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/3150/commits","review_comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/3150/comments","review_comment_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/3150/comments","statuses_url":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/771bf4518de05ba20f7a8f298bdb31a162104b41","head":{"label":"ngosang:add_peer_dialog","ref":"add_peer_dialog","sha":"771bf4518de05ba20f7a8f298bdb31a162104b41","user":{"login":"ngosang","id":10577978,"avatar_url":"https://avatars.githubusercontent.com/u/10577978?v=3","gravatar_id":"","url":"https://api.github.com/users/ngosang","html_url":"https://github.com/ngosang","followers_url":"https://api.github.com/users/ngosang/followers","following_url":"https://api.github.com/users/ngosang/following{/other_user}","gists_url":"https://api.github.com/users/ngosang/gists{/gist_id}","starred_url":"https://api.github.com/users/ngosang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngosang/subscriptions","organizations_url":"https://api.github.com/users/ngosang/orgs","repos_url":"https://api.github.com/users/ngosang/repos","events_url":"https://api.github.com/users/ngosang/events{/privacy}","received_events_url":"https://api.github.com/users/ngosang/received_events","type":"User","site_admin":false},"repo":{"id":30111086,"name":"qBittorrent","full_name":"ngosang/qBittorrent","owner":{"login":"ngosang","id":10577978,"avatar_url":"https://avatars.githubusercontent.com/u/10577978?v=3","gravatar_id":"","url":"https://api.github.com/users/ngosang","html_url":"https://github.com/ngosang","followers_url":"https://api.github.com/users/ngosang/followers","following_url":"https://api.github.com/users/ngosang/following{/other_user}","gists_url":"https://api.github.com/users/ngosang/gists{/gist_id}","starred_url":"https://api.github.com/users/ngosang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngosang/subscriptions","organizations_url":"https://api.github.com/users/ngosang/orgs","repos_url":"https://api.github.com/users/ngosang/repos","events_url":"https://api.github.com/users/ngosang/events{/privacy}","received_events_url":"https://api.github.com/users/ngosang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ngosang/qBittorrent","description":"qBittorrent BitTorrent client","fork":true,"url":"https://api.github.com/repos/ngosang/qBittorrent","forks_url":"https://api.github.com/repos/ngosang/qBittorrent/forks","keys_url":"https://api.github.com/repos/ngosang/qBittorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ngosang/qBittorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ngosang/qBittorrent/teams","hooks_url":"https://api.github.com/repos/ngosang/qBittorrent/hooks","issue_events_url":"https://api.github.com/repos/ngosang/qBittorrent/issues/events{/number}","events_url":"https://api.github.com/repos/ngosang/qBittorrent/events","assignees_url":"https://api.github.com/repos/ngosang/qBittorrent/assignees{/user}","branches_url":"https://api.github.com/repos/ngosang/qBittorrent/branches{/branch}","tags_url":"https://api.github.com/repos/ngosang/qBittorrent/tags","blobs_url":"https://api.github.com/repos/ngosang/qBittorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ngosang/qBittorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ngosang/qBittorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/ngosang/qBittorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ngosang/qBittorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/ngosang/qBittorrent/languages","stargazers_url":"https://api.github.com/repos/ngosang/qBittorrent/stargazers","contributors_url":"https://api.github.com/repos/ngosang/qBittorrent/contributors","subscribers_url":"https://api.github.com/repos/ngosang/qBittorrent/subscribers","subscription_url":"https://api.github.com/repos/ngosang/qBittorrent/subscription","commits_url":"https://api.github.com/repos/ngosang/qBittorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/ngosang/qBittorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/ngosang/qBittorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/ngosang/qBittorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/ngosang/qBittorrent/contents/{+path}","compare_url":"https://api.github.com/repos/ngosang/qBittorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ngosang/qBittorrent/merges","archive_url":"https://api.github.com/repos/ngosang/qBittorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ngosang/qBittorrent/downloads","issues_url":"https://api.github.com/repos/ngosang/qBittorrent/issues{/number}","pulls_url":"https://api.github.com/repos/ngosang/qBittorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/ngosang/qBittorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/ngosang/qBittorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ngosang/qBittorrent/labels{/name}","releases_url":"https://api.github.com/repos/ngosang/qBittorrent/releases{/id}","created_at":"2015-01-31T12:02:43Z","updated_at":"2015-03-31T10:45:06Z","pushed_at":"2015-06-13T12:19:05Z","git_url":"git://github.com/ngosang/qBittorrent.git","ssh_url":"git@github.com:ngosang/qBittorrent.git","clone_url":"https://github.com/ngosang/qBittorrent.git","svn_url":"https://github.com/ngosang/qBittorrent","homepage":"http://www.qbittorrent.org","size":105155,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"qbittorrent:master","ref":"master","sha":"88970015676c880539e6454ef36016088f571134","user":{"login":"qbittorrent","id":2131270,"avatar_url":"https://avatars.githubusercontent.com/u/2131270?v=3","gravatar_id":"","url":"https://api.github.com/users/qbittorrent","html_url":"https://github.com/qbittorrent","followers_url":"https://api.github.com/users/qbittorrent/followers","following_url":"https://api.github.com/users/qbittorrent/following{/other_user}","gists_url":"https://api.github.com/users/qbittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/qbittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qbittorrent/subscriptions","organizations_url":"https://api.github.com/users/qbittorrent/orgs","repos_url":"https://api.github.com/users/qbittorrent/repos","events_url":"https://api.github.com/users/qbittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/qbittorrent/received_events","type":"Organization","site_admin":false},"repo":{"id":3351871,"name":"qBittorrent","full_name":"qbittorrent/qBittorrent","owner":{"login":"qbittorrent","id":2131270,"avatar_url":"https://avatars.githubusercontent.com/u/2131270?v=3","gravatar_id":"","url":"https://api.github.com/users/qbittorrent","html_url":"https://github.com/qbittorrent","followers_url":"https://api.github.com/users/qbittorrent/followers","following_url":"https://api.github.com/users/qbittorrent/following{/other_user}","gists_url":"https://api.github.com/users/qbittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/qbittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qbittorrent/subscriptions","organizations_url":"https://api.github.com/users/qbittorrent/orgs","repos_url":"https://api.github.com/users/qbittorrent/repos","events_url":"https://api.github.com/users/qbittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/qbittorrent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qbittorrent/qBittorrent","description":"qBittorrent BitTorrent client","fork":false,"url":"https://api.github.com/repos/qbittorrent/qBittorrent","forks_url":"https://api.github.com/repos/qbittorrent/qBittorrent/forks","keys_url":"https://api.github.com/repos/qbittorrent/qBittorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qbittorrent/qBittorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qbittorrent/qBittorrent/teams","hooks_url":"https://api.github.com/repos/qbittorrent/qBittorrent/hooks","issue_events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/events{/number}","events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/events","assignees_url":"https://api.github.com/repos/qbittorrent/qBittorrent/assignees{/user}","branches_url":"https://api.github.com/repos/qbittorrent/qBittorrent/branches{/branch}","tags_url":"https://api.github.com/repos/qbittorrent/qBittorrent/tags","blobs_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/qbittorrent/qBittorrent/languages","stargazers_url":"https://api.github.com/repos/qbittorrent/qBittorrent/stargazers","contributors_url":"https://api.github.com/repos/qbittorrent/qBittorrent/contributors","subscribers_url":"https://api.github.com/repos/qbittorrent/qBittorrent/subscribers","subscription_url":"https://api.github.com/repos/qbittorrent/qBittorrent/subscription","commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/qbittorrent/qBittorrent/contents/{+path}","compare_url":"https://api.github.com/repos/qbittorrent/qBittorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qbittorrent/qBittorrent/merges","archive_url":"https://api.github.com/repos/qbittorrent/qBittorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qbittorrent/qBittorrent/downloads","issues_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues{/number}","pulls_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/qbittorrent/qBittorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/labels{/name}","releases_url":"https://api.github.com/repos/qbittorrent/qBittorrent/releases{/id}","created_at":"2012-02-04T09:37:46Z","updated_at":"2015-06-13T14:42:12Z","pushed_at":"2015-06-13T12:19:07Z","git_url":"git://github.com/qbittorrent/qBittorrent.git","ssh_url":"git@github.com:qbittorrent/qBittorrent.git","clone_url":"https://github.com/qbittorrent/qBittorrent.git","svn_url":"https://github.com/qbittorrent/qBittorrent","homepage":"http://www.qbittorrent.org","size":119567,"stargazers_count":980,"watchers_count":980,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":308,"mirror_url":null,"open_issues_count":1073,"forks":308,"open_issues":1073,"watchers":980,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/3150"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/3150"},"issue":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/3150"},"comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/3150/comments"},"review_comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/3150/comments"},"review_comment":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/3150/commits"},"statuses":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/771bf4518de05ba20f7a8f298bdb31a162104b41"}}}}