{"action":"created","comment":{"url":"https://api.github.com/repos/jpd002/Play-/pulls/comments/77432183","id":77432183,"diff_hunk":"@@ -0,0 +1,164 @@\n+#include \"cdevice.h\"\n+#include \"AppConfig.h\"\n+#include \"PS2VM_Preferences.h\"\n+#include \"vfsdiscselectordialog.h\"\n+\n+#include <QFileDialog>\n+#include <QStorageInfo>\n+\n+CDevice::CDevice()\n+{\n+\n+}\n+\n+\n+///////////////////////////////////////////\n+//CDevice Implementation\n+///////////////////////////////////////////\n+\n+CDevice::~CDevice()\n+{\n+\n+}\n+\n+///////////////////////////////////////////\n+//CDirectoryDevice Implementation\n+///////////////////////////////////////////\n+\n+CDirectoryDevice::CDirectoryDevice(const char* sName, const char* sPreference)\n+{\n+    m_sName         = sName;\n+    m_sPreference   = sPreference;\n+    m_sValue        = CAppConfig::GetInstance().GetPreferenceString(m_sPreference);\n+}\n+\n+CDirectoryDevice::~CDirectoryDevice()\n+{\n+\n+}\n+\n+const char* CDirectoryDevice::GetDeviceName()\n+{\n+    return m_sName;\n+}\n+\n+const char* CDirectoryDevice::GetBindingType()\n+{\n+    return \"Directory\";\n+}\n+\n+const char* CDirectoryDevice::GetBinding()\n+{\n+    return m_sValue.c_str();\n+}\n+\n+\n+void CDirectoryDevice::Save()\n+{\n+    CAppConfig::GetInstance().SetPreferenceString(m_sPreference, m_sValue.c_str());\n+}\n+\n+bool CDirectoryDevice::RequestModification(QWidget *parent)\n+{\n+    QFileDialog dialog(parent);\n+    dialog.setFileMode(QFileDialog::Directory);\n+    dialog.setOption(QFileDialog::ShowDirsOnly);\n+    dialog.setOption(QFileDialog::DontResolveSymlinks);\n+    if (dialog.exec())\n+    {\n+        QString fileName = dialog.selectedFiles().first();\n+\n+        m_sValue = fileName.toStdString();\n+        return true;\n+\n+    } else {\n+        return false;\n+    }\n+}\n+\n+///////////////////////////////////////////\n+//CCdrom0Device Implementation\n+///////////////////////////////////////////\n+\n+CCdrom0Device::CCdrom0Device()\n+{\n+    const char* sPath = CAppConfig::GetInstance().GetPreferenceString(PS2VM_CDROM0PATH);\n+\n+    //Detect the binding type from the path format\n+    QString m_sPath(sPath);\n+    if (m_sPath.startsWith(\"\\\\\\\\.\\\\\", Qt::CaseInsensitive) || m_sPath.startsWith(\"/dev/\", Qt::CaseInsensitive))\n+    {\n+        m_nBindingType\t= CDevice::BINDING_PHYSICAL;\n+        m_sImagePath\t= sPath;\n+    } else {\n+        m_nBindingType\t= CDevice::BINDING_IMAGE;\n+        if(!strcmp(sPath, \"\"))\n+        {\n+            m_sImagePath\t= \"\";\n+        } else {\n+            m_sImagePath\t= sPath;\n+        }\n+    }\n+}\n+\n+CCdrom0Device::~CCdrom0Device()\n+{\n+\n+}\n+\n+const char* CCdrom0Device::GetDeviceName()\n+{\n+    return \"cdrom0\";\n+}\n+\n+const char* CCdrom0Device::GetBindingType()\n+{\n+    if(m_nBindingType == CDevice::BINDING_PHYSICAL)\n+    {\n+        return \"Physical Device\";\n+    }\n+    if(m_nBindingType == CDevice::BINDING_IMAGE)\n+    {\n+        return \"Disk Image\";\n+    }\n+    return \"\";\n+}\n+\n+const char* CCdrom0Device::GetBinding()\n+{\n+    if(m_sImagePath.length() == 0)\n+    {\n+        return \"(None)\";\n+    }\n+    else\n+    {\n+        return m_sImagePath.c_str();\n+    }\n+}\n+\n+void CCdrom0Device::Save()\n+{\n+    CAppConfig::GetInstance().SetPreferenceString(PS2VM_CDROM0PATH, m_sImagePath.c_str());\n+\n+}\n+\n+bool CCdrom0Device::RequestModification(QWidget *parent)\n+{\n+    if (true)","path":"Source/ui_unix/cdevice.cpp","position":147,"original_position":147,"commit_id":"95dc2c2d665827f0ee1fabe4b702283eee9890af","original_commit_id":"95dc2c2d665827f0ee1fabe4b702283eee9890af","user":{"login":"jpd002","id":6760433,"avatar_url":"https://avatars.githubusercontent.com/u/6760433?v=3","gravatar_id":"","url":"https://api.github.com/users/jpd002","html_url":"https://github.com/jpd002","followers_url":"https://api.github.com/users/jpd002/followers","following_url":"https://api.github.com/users/jpd002/following{/other_user}","gists_url":"https://api.github.com/users/jpd002/gists{/gist_id}","starred_url":"https://api.github.com/users/jpd002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpd002/subscriptions","organizations_url":"https://api.github.com/users/jpd002/orgs","repos_url":"https://api.github.com/users/jpd002/repos","events_url":"https://api.github.com/users/jpd002/events{/privacy}","received_events_url":"https://api.github.com/users/jpd002/received_events","type":"User","site_admin":false},"body":"Why the always true condition?","created_at":"2016-09-03T06:19:30Z","updated_at":"2016-09-03T06:19:30Z","html_url":"https://github.com/jpd002/Play-/pull/423#discussion_r77432183","pull_request_url":"https://api.github.com/repos/jpd002/Play-/pulls/423","_links":{"self":{"href":"https://api.github.com/repos/jpd002/Play-/pulls/comments/77432183"},"html":{"href":"https://github.com/jpd002/Play-/pull/423#discussion_r77432183"},"pull_request":{"href":"https://api.github.com/repos/jpd002/Play-/pulls/423"}}},"pull_request":{"url":"https://api.github.com/repos/jpd002/Play-/pulls/423","id":73664655,"html_url":"https://github.com/jpd002/Play-/pull/423","diff_url":"https://github.com/jpd002/Play-/pull/423.diff","patch_url":"https://github.com/jpd002/Play-/pull/423.patch","issue_url":"https://api.github.com/repos/jpd002/Play-/issues/423","number":423,"state":"open","locked":false,"title":"Linux UI","user":{"login":"Thunder07","id":5013823,"avatar_url":"https://avatars.githubusercontent.com/u/5013823?v=3","gravatar_id":"","url":"https://api.github.com/users/Thunder07","html_url":"https://github.com/Thunder07","followers_url":"https://api.github.com/users/Thunder07/followers","following_url":"https://api.github.com/users/Thunder07/following{/other_user}","gists_url":"https://api.github.com/users/Thunder07/gists{/gist_id}","starred_url":"https://api.github.com/users/Thunder07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thunder07/subscriptions","organizations_url":"https://api.github.com/users/Thunder07/orgs","repos_url":"https://api.github.com/users/Thunder07/repos","events_url":"https://api.github.com/users/Thunder07/events{/privacy}","received_events_url":"https://api.github.com/users/Thunder07/received_events","type":"User","site_admin":false},"body":"following are the required packages that you'd need to build this PR.\r\n\r\nfor starters you'd need [qt 5.6.*](https://www.qt.io/download-open-source/#section-2), you can also install just the cmdline packages using `sudo apt-get install qt5-default` but this will install 5.5.1 which still doesnt contain this [patch](https://codereview.qt-project.org/#/c/139775/13/src/widgets/kernel/qopenglwidget.cpp), so you'll be spammed with that error, for now i'd avoid the apt package.\r\nnote: I'd also avoid using Qt 5.7  due [failed to compile gtk plugin] (https://bugreports.qt.io/browse/QTBUG-53844)\r\n \r\n```\r\nsudo apt-get install python-dev libbz2-dev libalut-dev libmysqlclient-dev libglew-dev libicu-dev cmake git -y\r\nsudo apt-get install libboost-filesystem-dev libboost-chrono-dev\r\nsudo apt-get install -f\r\n```\r\n\r\n~~you'll also need boost, i downloaded and used the latest version, at the time it was/is 1.61.0, if you use a newer or older version, just make sure to edit ./Play/build_unix/ui_unix.pro to reflect that.\r\nwhen building boost make sure to build it with static linking (just to avoid having the end-user having to install boost), I've also chosen to build it with speed optimisation and multi-threading.\r\n[Boost package](https://sourceforge.net/projects/boost/files/boost/1.61.0/), download 1 directory outside of the project directory, see below of directory tree.~~\r\n```\r\ntar xvf boost_1_61_0.tar.*\r\ncd boost_1_61_0\r\n./bootstrap.sh\r\n./b2 link=static link=shared threading=multi optimization=speed --with-chrono --with-filesystem --with-system\r\n./b2 link=static link=shared threading=multi optimization=speed  --with-chrono --with-filesystem --with-system install #optional, i've avoided installing it for ease of future updates\r\n```\r\n\r\n~~~now all you need to start building is~~~\r\n```\r\ncd Play/build_unix/\r\nexport BOOST_INCLUDEDIR=/full/path/to/boost_1_61_0\r\n./build.sh\r\n```\r\n\r\n\r\n~~~this is what my project directory looks like~~~\r\n```\r\n.\r\n├── boost_1_61_0\r\n└── Play-Build\r\n    ├── CodeGen\r\n    ├── Dependencies\r\n    ├── Framework\r\n    └── Play\r\n```","created_at":"2016-06-14T00:38:20Z","updated_at":"2016-09-03T06:19:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bec94bcc6a8fff7640ebceff3a49baa6330cf0d4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jpd002/Play-/pulls/423/commits","review_comments_url":"https://api.github.com/repos/jpd002/Play-/pulls/423/comments","review_comment_url":"https://api.github.com/repos/jpd002/Play-/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jpd002/Play-/issues/423/comments","statuses_url":"https://api.github.com/repos/jpd002/Play-/statuses/95dc2c2d665827f0ee1fabe4b702283eee9890af","head":{"label":"Thunder07:unix_ui_qt","ref":"unix_ui_qt","sha":"95dc2c2d665827f0ee1fabe4b702283eee9890af","user":{"login":"Thunder07","id":5013823,"avatar_url":"https://avatars.githubusercontent.com/u/5013823?v=3","gravatar_id":"","url":"https://api.github.com/users/Thunder07","html_url":"https://github.com/Thunder07","followers_url":"https://api.github.com/users/Thunder07/followers","following_url":"https://api.github.com/users/Thunder07/following{/other_user}","gists_url":"https://api.github.com/users/Thunder07/gists{/gist_id}","starred_url":"https://api.github.com/users/Thunder07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thunder07/subscriptions","organizations_url":"https://api.github.com/users/Thunder07/orgs","repos_url":"https://api.github.com/users/Thunder07/repos","events_url":"https://api.github.com/users/Thunder07/events{/privacy}","received_events_url":"https://api.github.com/users/Thunder07/received_events","type":"User","site_admin":false},"repo":{"id":38981934,"name":"Play-","full_name":"Thunder07/Play-","owner":{"login":"Thunder07","id":5013823,"avatar_url":"https://avatars.githubusercontent.com/u/5013823?v=3","gravatar_id":"","url":"https://api.github.com/users/Thunder07","html_url":"https://github.com/Thunder07","followers_url":"https://api.github.com/users/Thunder07/followers","following_url":"https://api.github.com/users/Thunder07/following{/other_user}","gists_url":"https://api.github.com/users/Thunder07/gists{/gist_id}","starred_url":"https://api.github.com/users/Thunder07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thunder07/subscriptions","organizations_url":"https://api.github.com/users/Thunder07/orgs","repos_url":"https://api.github.com/users/Thunder07/repos","events_url":"https://api.github.com/users/Thunder07/events{/privacy}","received_events_url":"https://api.github.com/users/Thunder07/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Thunder07/Play-","description":"Play! - PlayStation 2 Emulator","fork":true,"url":"https://api.github.com/repos/Thunder07/Play-","forks_url":"https://api.github.com/repos/Thunder07/Play-/forks","keys_url":"https://api.github.com/repos/Thunder07/Play-/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Thunder07/Play-/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Thunder07/Play-/teams","hooks_url":"https://api.github.com/repos/Thunder07/Play-/hooks","issue_events_url":"https://api.github.com/repos/Thunder07/Play-/issues/events{/number}","events_url":"https://api.github.com/repos/Thunder07/Play-/events","assignees_url":"https://api.github.com/repos/Thunder07/Play-/assignees{/user}","branches_url":"https://api.github.com/repos/Thunder07/Play-/branches{/branch}","tags_url":"https://api.github.com/repos/Thunder07/Play-/tags","blobs_url":"https://api.github.com/repos/Thunder07/Play-/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Thunder07/Play-/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Thunder07/Play-/git/refs{/sha}","trees_url":"https://api.github.com/repos/Thunder07/Play-/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Thunder07/Play-/statuses/{sha}","languages_url":"https://api.github.com/repos/Thunder07/Play-/languages","stargazers_url":"https://api.github.com/repos/Thunder07/Play-/stargazers","contributors_url":"https://api.github.com/repos/Thunder07/Play-/contributors","subscribers_url":"https://api.github.com/repos/Thunder07/Play-/subscribers","subscription_url":"https://api.github.com/repos/Thunder07/Play-/subscription","commits_url":"https://api.github.com/repos/Thunder07/Play-/commits{/sha}","git_commits_url":"https://api.github.com/repos/Thunder07/Play-/git/commits{/sha}","comments_url":"https://api.github.com/repos/Thunder07/Play-/comments{/number}","issue_comment_url":"https://api.github.com/repos/Thunder07/Play-/issues/comments{/number}","contents_url":"https://api.github.com/repos/Thunder07/Play-/contents/{+path}","compare_url":"https://api.github.com/repos/Thunder07/Play-/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Thunder07/Play-/merges","archive_url":"https://api.github.com/repos/Thunder07/Play-/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Thunder07/Play-/downloads","issues_url":"https://api.github.com/repos/Thunder07/Play-/issues{/number}","pulls_url":"https://api.github.com/repos/Thunder07/Play-/pulls{/number}","milestones_url":"https://api.github.com/repos/Thunder07/Play-/milestones{/number}","notifications_url":"https://api.github.com/repos/Thunder07/Play-/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Thunder07/Play-/labels{/name}","releases_url":"https://api.github.com/repos/Thunder07/Play-/releases{/id}","deployments_url":"https://api.github.com/repos/Thunder07/Play-/deployments","created_at":"2015-07-12T23:22:48Z","updated_at":"2016-08-03T22:18:59Z","pushed_at":"2016-09-02T08:07:46Z","git_url":"git://github.com/Thunder07/Play-.git","ssh_url":"git@github.com:Thunder07/Play-.git","clone_url":"https://github.com/Thunder07/Play-.git","svn_url":"https://github.com/Thunder07/Play-","homepage":"http://purei.org","size":12851,"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":"jpd002:master","ref":"master","sha":"82fd06476e05814f772d131a0da953797a4e900d","user":{"login":"jpd002","id":6760433,"avatar_url":"https://avatars.githubusercontent.com/u/6760433?v=3","gravatar_id":"","url":"https://api.github.com/users/jpd002","html_url":"https://github.com/jpd002","followers_url":"https://api.github.com/users/jpd002/followers","following_url":"https://api.github.com/users/jpd002/following{/other_user}","gists_url":"https://api.github.com/users/jpd002/gists{/gist_id}","starred_url":"https://api.github.com/users/jpd002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpd002/subscriptions","organizations_url":"https://api.github.com/users/jpd002/orgs","repos_url":"https://api.github.com/users/jpd002/repos","events_url":"https://api.github.com/users/jpd002/events{/privacy}","received_events_url":"https://api.github.com/users/jpd002/received_events","type":"User","site_admin":false},"repo":{"id":17104739,"name":"Play-","full_name":"jpd002/Play-","owner":{"login":"jpd002","id":6760433,"avatar_url":"https://avatars.githubusercontent.com/u/6760433?v=3","gravatar_id":"","url":"https://api.github.com/users/jpd002","html_url":"https://github.com/jpd002","followers_url":"https://api.github.com/users/jpd002/followers","following_url":"https://api.github.com/users/jpd002/following{/other_user}","gists_url":"https://api.github.com/users/jpd002/gists{/gist_id}","starred_url":"https://api.github.com/users/jpd002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpd002/subscriptions","organizations_url":"https://api.github.com/users/jpd002/orgs","repos_url":"https://api.github.com/users/jpd002/repos","events_url":"https://api.github.com/users/jpd002/events{/privacy}","received_events_url":"https://api.github.com/users/jpd002/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpd002/Play-","description":"Play! - PlayStation 2 Emulator","fork":false,"url":"https://api.github.com/repos/jpd002/Play-","forks_url":"https://api.github.com/repos/jpd002/Play-/forks","keys_url":"https://api.github.com/repos/jpd002/Play-/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpd002/Play-/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpd002/Play-/teams","hooks_url":"https://api.github.com/repos/jpd002/Play-/hooks","issue_events_url":"https://api.github.com/repos/jpd002/Play-/issues/events{/number}","events_url":"https://api.github.com/repos/jpd002/Play-/events","assignees_url":"https://api.github.com/repos/jpd002/Play-/assignees{/user}","branches_url":"https://api.github.com/repos/jpd002/Play-/branches{/branch}","tags_url":"https://api.github.com/repos/jpd002/Play-/tags","blobs_url":"https://api.github.com/repos/jpd002/Play-/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpd002/Play-/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpd002/Play-/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpd002/Play-/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpd002/Play-/statuses/{sha}","languages_url":"https://api.github.com/repos/jpd002/Play-/languages","stargazers_url":"https://api.github.com/repos/jpd002/Play-/stargazers","contributors_url":"https://api.github.com/repos/jpd002/Play-/contributors","subscribers_url":"https://api.github.com/repos/jpd002/Play-/subscribers","subscription_url":"https://api.github.com/repos/jpd002/Play-/subscription","commits_url":"https://api.github.com/repos/jpd002/Play-/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpd002/Play-/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpd002/Play-/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpd002/Play-/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpd002/Play-/contents/{+path}","compare_url":"https://api.github.com/repos/jpd002/Play-/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpd002/Play-/merges","archive_url":"https://api.github.com/repos/jpd002/Play-/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpd002/Play-/downloads","issues_url":"https://api.github.com/repos/jpd002/Play-/issues{/number}","pulls_url":"https://api.github.com/repos/jpd002/Play-/pulls{/number}","milestones_url":"https://api.github.com/repos/jpd002/Play-/milestones{/number}","notifications_url":"https://api.github.com/repos/jpd002/Play-/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpd002/Play-/labels{/name}","releases_url":"https://api.github.com/repos/jpd002/Play-/releases{/id}","deployments_url":"https://api.github.com/repos/jpd002/Play-/deployments","created_at":"2014-02-23T08:45:33Z","updated_at":"2016-09-02T14:42:02Z","pushed_at":"2016-09-02T08:07:46Z","git_url":"git://github.com/jpd002/Play-.git","ssh_url":"git@github.com:jpd002/Play-.git","clone_url":"https://github.com/jpd002/Play-.git","svn_url":"https://github.com/jpd002/Play-","homepage":"http://purei.org","size":15185,"stargazers_count":311,"watchers_count":311,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":138,"forks":53,"open_issues":138,"watchers":311,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jpd002/Play-/pulls/423"},"html":{"href":"https://github.com/jpd002/Play-/pull/423"},"issue":{"href":"https://api.github.com/repos/jpd002/Play-/issues/423"},"comments":{"href":"https://api.github.com/repos/jpd002/Play-/issues/423/comments"},"review_comments":{"href":"https://api.github.com/repos/jpd002/Play-/pulls/423/comments"},"review_comment":{"href":"https://api.github.com/repos/jpd002/Play-/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jpd002/Play-/pulls/423/commits"},"statuses":{"href":"https://api.github.com/repos/jpd002/Play-/statuses/95dc2c2d665827f0ee1fabe4b702283eee9890af"}}}}
{"actor":{"display_login":"jpd002"}}