{"action":"opened","number":7,"pull_request":{"url":"https://api.github.com/repos/assem-ch/alfanous/pulls/7","id":30590141,"html_url":"https://github.com/assem-ch/alfanous/pull/7","diff_url":"https://github.com/assem-ch/alfanous/pull/7.diff","patch_url":"https://github.com/assem-ch/alfanous/pull/7.patch","issue_url":"https://api.github.com/repos/assem-ch/alfanous/issues/7","number":7,"state":"open","locked":false,"title":"Add a cancel button when change lang, style also restart alf when choose ok and update the checked item","user":{"login":"Zinebl","id":5882388,"avatar_url":"https://avatars.githubusercontent.com/u/5882388?v=3","gravatar_id":"","url":"https://api.github.com/users/Zinebl","html_url":"https://github.com/Zinebl","followers_url":"https://api.github.com/users/Zinebl/followers","following_url":"https://api.github.com/users/Zinebl/following{/other_user}","gists_url":"https://api.github.com/users/Zinebl/gists{/gist_id}","starred_url":"https://api.github.com/users/Zinebl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zinebl/subscriptions","organizations_url":"https://api.github.com/users/Zinebl/orgs","repos_url":"https://api.github.com/users/Zinebl/repos","events_url":"https://api.github.com/users/Zinebl/events{/privacy}","received_events_url":"https://api.github.com/users/Zinebl/received_events","type":"User","site_admin":false},"body":"    def changeStyle( self, style ):\r\n        mb = QtGui.QMessageBox(QtGui.QMessageBox.Warning, _(\"Applying skin\"), _(\"You should restart application in order for the skin to take effect\"), buttons = QtGui.QMessageBox.Ok)\r\n        mb.addButton(QtGui.QMessageBox.Cancel)\r\n        ret = mb.exec_()\r\n        if ret == QtGui.QMessageBox.Ok:\r\n                self.style = style\r\n                self.save_config()\r\n                self.restart_program()\r\n        elif ret == QtGui.QMessageBox.Cancel:\r\n                #\r\n                config = ConfigObj( CONFIGPATH + \"/config.ini\", encoding=\"utf-8\" )\r\n                if config.has_key( \"options\" ):\r\n                        self.style = config[\"options\"][\"style\"] if config[\"options\"].has_key( \"style\" ) else \"\"\r\n                else:\r\n                        self.style = \"\"\r\n\r\n                styles = {\"\": self.actionDefaultStyle.setChecked,\r\n                        \"windows\": self.actionWindows.setChecked,\r\n                        \"motif\": self.actionMotif.setChecked,\r\n                        \"cde\": self.actionCDE.setChecked,\r\n                        \"plastique\": self.actionPlastique.setChecked,\r\n                        \"windowsxp\": self.actionWindowsXP.setChecked,\r\n                        \"macintosh\": self.actionMacintosh.setChecked}\r\n                styles[self.style](True)\r\n                pass\r\n    \r\n        \r\n    def restart_program(self):\r\n        \"\"\"Restarts the current program \"\"\"\r\n        python = sys.executable\r\n        os.execl(python, python, * sys.argv)\r\n        \r\n    def changeLanguage( self, lang ):\r\n        \"\"\" Change Language\"\"\"\r\n        mb = QtGui.QMessageBox(QtGui.QMessageBox.Warning,  _(\"Applying language\"), _(\"You should restart application in order for the language to take effect\"), buttons = QtGui.QMessageBox.Ok)\r\n        mb.addButton(QtGui.QMessageBox.Cancel)\r\n        ret = mb.exec_()\r\n        if ret == QtGui.QMessageBox.Ok:\r\n                self.language = lang # change only if we choose ok\r\n                self.save_config()\r\n                self.restart_program()\r\n        elif ret == QtGui.QMessageBox.Cancel:\r\n                #---------\r\n                config = ConfigObj( CONFIGPATH + \"/config.ini\", encoding=\"utf-8\" )\r\n                if config.has_key( \"options\" ):\r\n                        self.language = config[\"options\"][\"language\"] if config[\"options\"].has_key( \"language\" ) else \"\"\r\n                else:\r\n                        self.language = \"\"\r\n                languages = {\"\": self.actionSystem.setChecked,\r\n                        \"en\": self.actionEnglish.setChecked,\r\n                        \"ar\": self.actionArabic.setChecked,\r\n                        \"fr\": self.actionFrench.setChecked,\r\n                        \"id\": self.actionIndonesian.setChecked,\r\n                        \"es\": self.actionSpanish.setChecked,\r\n                        \"ms\": self.actionMalay.setChecked }\r\n                languages[self.language](True)\r\n                #----------# we add this in order to update the checked item of current lang,  for exp if we use \"en\" and we choose \"ar\" but we cancel our change, \r\n                # without this the \"ar\" item will be checked instead of \"en\"\r\n                pass","created_at":"2015-03-05T20:00:05Z","updated_at":"2015-03-05T20:00:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/assem-ch/alfanous/pulls/7/commits","review_comments_url":"https://api.github.com/repos/assem-ch/alfanous/pulls/7/comments","review_comment_url":"https://api.github.com/repos/assem-ch/alfanous/pulls/comments{/number}","comments_url":"https://api.github.com/repos/assem-ch/alfanous/issues/7/comments","statuses_url":"https://api.github.com/repos/assem-ch/alfanous/statuses/e54f9de2557e90e0ce26e779648f08db2432f269","head":{"label":"Alfanous-team:master","ref":"master","sha":"e54f9de2557e90e0ce26e779648f08db2432f269","user":{"login":"Alfanous-team","id":1835951,"avatar_url":"https://avatars.githubusercontent.com/u/1835951?v=3","gravatar_id":"","url":"https://api.github.com/users/Alfanous-team","html_url":"https://github.com/Alfanous-team","followers_url":"https://api.github.com/users/Alfanous-team/followers","following_url":"https://api.github.com/users/Alfanous-team/following{/other_user}","gists_url":"https://api.github.com/users/Alfanous-team/gists{/gist_id}","starred_url":"https://api.github.com/users/Alfanous-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alfanous-team/subscriptions","organizations_url":"https://api.github.com/users/Alfanous-team/orgs","repos_url":"https://api.github.com/users/Alfanous-team/repos","events_url":"https://api.github.com/users/Alfanous-team/events{/privacy}","received_events_url":"https://api.github.com/users/Alfanous-team/received_events","type":"Organization","site_admin":false},"repo":{"id":4617289,"name":"alfanous","full_name":"Alfanous-team/alfanous","owner":{"login":"Alfanous-team","id":1835951,"avatar_url":"https://avatars.githubusercontent.com/u/1835951?v=3","gravatar_id":"","url":"https://api.github.com/users/Alfanous-team","html_url":"https://github.com/Alfanous-team","followers_url":"https://api.github.com/users/Alfanous-team/followers","following_url":"https://api.github.com/users/Alfanous-team/following{/other_user}","gists_url":"https://api.github.com/users/Alfanous-team/gists{/gist_id}","starred_url":"https://api.github.com/users/Alfanous-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alfanous-team/subscriptions","organizations_url":"https://api.github.com/users/Alfanous-team/orgs","repos_url":"https://api.github.com/users/Alfanous-team/repos","events_url":"https://api.github.com/users/Alfanous-team/events{/privacy}","received_events_url":"https://api.github.com/users/Alfanous-team/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Alfanous-team/alfanous","description":"Alfanous (The Lantern - الفانوس ) is an Arabic search engine API provides the simple and advanced search in the Holy Quran , more features and many interfaces...","fork":true,"url":"https://api.github.com/repos/Alfanous-team/alfanous","forks_url":"https://api.github.com/repos/Alfanous-team/alfanous/forks","keys_url":"https://api.github.com/repos/Alfanous-team/alfanous/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alfanous-team/alfanous/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alfanous-team/alfanous/teams","hooks_url":"https://api.github.com/repos/Alfanous-team/alfanous/hooks","issue_events_url":"https://api.github.com/repos/Alfanous-team/alfanous/issues/events{/number}","events_url":"https://api.github.com/repos/Alfanous-team/alfanous/events","assignees_url":"https://api.github.com/repos/Alfanous-team/alfanous/assignees{/user}","branches_url":"https://api.github.com/repos/Alfanous-team/alfanous/branches{/branch}","tags_url":"https://api.github.com/repos/Alfanous-team/alfanous/tags","blobs_url":"https://api.github.com/repos/Alfanous-team/alfanous/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alfanous-team/alfanous/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alfanous-team/alfanous/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alfanous-team/alfanous/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alfanous-team/alfanous/statuses/{sha}","languages_url":"https://api.github.com/repos/Alfanous-team/alfanous/languages","stargazers_url":"https://api.github.com/repos/Alfanous-team/alfanous/stargazers","contributors_url":"https://api.github.com/repos/Alfanous-team/alfanous/contributors","subscribers_url":"https://api.github.com/repos/Alfanous-team/alfanous/subscribers","subscription_url":"https://api.github.com/repos/Alfanous-team/alfanous/subscription","commits_url":"https://api.github.com/repos/Alfanous-team/alfanous/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alfanous-team/alfanous/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alfanous-team/alfanous/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alfanous-team/alfanous/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alfanous-team/alfanous/contents/{+path}","compare_url":"https://api.github.com/repos/Alfanous-team/alfanous/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alfanous-team/alfanous/merges","archive_url":"https://api.github.com/repos/Alfanous-team/alfanous/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alfanous-team/alfanous/downloads","issues_url":"https://api.github.com/repos/Alfanous-team/alfanous/issues{/number}","pulls_url":"https://api.github.com/repos/Alfanous-team/alfanous/pulls{/number}","milestones_url":"https://api.github.com/repos/Alfanous-team/alfanous/milestones{/number}","notifications_url":"https://api.github.com/repos/Alfanous-team/alfanous/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alfanous-team/alfanous/labels{/name}","releases_url":"https://api.github.com/repos/Alfanous-team/alfanous/releases{/id}","created_at":"2012-06-10T18:31:51Z","updated_at":"2015-03-04T21:26:59Z","pushed_at":"2015-03-04T21:26:59Z","git_url":"git://github.com/Alfanous-team/alfanous.git","ssh_url":"git@github.com:Alfanous-team/alfanous.git","clone_url":"https://github.com/Alfanous-team/alfanous.git","svn_url":"https://github.com/Alfanous-team/alfanous","homepage":"www.alfanous.org","size":136418,"stargazers_count":67,"watchers_count":67,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":163,"forks":35,"open_issues":163,"watchers":67,"default_branch":"master"}},"base":{"label":"assem-ch:master","ref":"master","sha":"1f7a6c399fa08fb3818edae80f9d091c49a20ee2","user":{"login":"assem-ch","id":315228,"avatar_url":"https://avatars.githubusercontent.com/u/315228?v=3","gravatar_id":"","url":"https://api.github.com/users/assem-ch","html_url":"https://github.com/assem-ch","followers_url":"https://api.github.com/users/assem-ch/followers","following_url":"https://api.github.com/users/assem-ch/following{/other_user}","gists_url":"https://api.github.com/users/assem-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/assem-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/assem-ch/subscriptions","organizations_url":"https://api.github.com/users/assem-ch/orgs","repos_url":"https://api.github.com/users/assem-ch/repos","events_url":"https://api.github.com/users/assem-ch/events{/privacy}","received_events_url":"https://api.github.com/users/assem-ch/received_events","type":"User","site_admin":false},"repo":{"id":4562849,"name":"alfanous","full_name":"assem-ch/alfanous","owner":{"login":"assem-ch","id":315228,"avatar_url":"https://avatars.githubusercontent.com/u/315228?v=3","gravatar_id":"","url":"https://api.github.com/users/assem-ch","html_url":"https://github.com/assem-ch","followers_url":"https://api.github.com/users/assem-ch/followers","following_url":"https://api.github.com/users/assem-ch/following{/other_user}","gists_url":"https://api.github.com/users/assem-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/assem-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/assem-ch/subscriptions","organizations_url":"https://api.github.com/users/assem-ch/orgs","repos_url":"https://api.github.com/users/assem-ch/repos","events_url":"https://api.github.com/users/assem-ch/events{/privacy}","received_events_url":"https://api.github.com/users/assem-ch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/assem-ch/alfanous","description":"Alfanous (The Lantern - الفانوس ) is an Arabic search engine API provide the simple and advanced search in the Holy Quran , more features and many interfaces...","fork":false,"url":"https://api.github.com/repos/assem-ch/alfanous","forks_url":"https://api.github.com/repos/assem-ch/alfanous/forks","keys_url":"https://api.github.com/repos/assem-ch/alfanous/keys{/key_id}","collaborators_url":"https://api.github.com/repos/assem-ch/alfanous/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/assem-ch/alfanous/teams","hooks_url":"https://api.github.com/repos/assem-ch/alfanous/hooks","issue_events_url":"https://api.github.com/repos/assem-ch/alfanous/issues/events{/number}","events_url":"https://api.github.com/repos/assem-ch/alfanous/events","assignees_url":"https://api.github.com/repos/assem-ch/alfanous/assignees{/user}","branches_url":"https://api.github.com/repos/assem-ch/alfanous/branches{/branch}","tags_url":"https://api.github.com/repos/assem-ch/alfanous/tags","blobs_url":"https://api.github.com/repos/assem-ch/alfanous/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/assem-ch/alfanous/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/assem-ch/alfanous/git/refs{/sha}","trees_url":"https://api.github.com/repos/assem-ch/alfanous/git/trees{/sha}","statuses_url":"https://api.github.com/repos/assem-ch/alfanous/statuses/{sha}","languages_url":"https://api.github.com/repos/assem-ch/alfanous/languages","stargazers_url":"https://api.github.com/repos/assem-ch/alfanous/stargazers","contributors_url":"https://api.github.com/repos/assem-ch/alfanous/contributors","subscribers_url":"https://api.github.com/repos/assem-ch/alfanous/subscribers","subscription_url":"https://api.github.com/repos/assem-ch/alfanous/subscription","commits_url":"https://api.github.com/repos/assem-ch/alfanous/commits{/sha}","git_commits_url":"https://api.github.com/repos/assem-ch/alfanous/git/commits{/sha}","comments_url":"https://api.github.com/repos/assem-ch/alfanous/comments{/number}","issue_comment_url":"https://api.github.com/repos/assem-ch/alfanous/issues/comments{/number}","contents_url":"https://api.github.com/repos/assem-ch/alfanous/contents/{+path}","compare_url":"https://api.github.com/repos/assem-ch/alfanous/compare/{base}...{head}","merges_url":"https://api.github.com/repos/assem-ch/alfanous/merges","archive_url":"https://api.github.com/repos/assem-ch/alfanous/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/assem-ch/alfanous/downloads","issues_url":"https://api.github.com/repos/assem-ch/alfanous/issues{/number}","pulls_url":"https://api.github.com/repos/assem-ch/alfanous/pulls{/number}","milestones_url":"https://api.github.com/repos/assem-ch/alfanous/milestones{/number}","notifications_url":"https://api.github.com/repos/assem-ch/alfanous/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/assem-ch/alfanous/labels{/name}","releases_url":"https://api.github.com/repos/assem-ch/alfanous/releases{/id}","created_at":"2012-06-05T17:01:53Z","updated_at":"2015-03-04T19:39:30Z","pushed_at":"2015-03-04T19:39:30Z","git_url":"git://github.com/assem-ch/alfanous.git","ssh_url":"git@github.com:assem-ch/alfanous.git","clone_url":"https://github.com/assem-ch/alfanous.git","svn_url":"https://github.com/assem-ch/alfanous","homepage":"www.alfanous.org","size":132456,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":1,"forks":46,"open_issues":1,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/assem-ch/alfanous/pulls/7"},"html":{"href":"https://github.com/assem-ch/alfanous/pull/7"},"issue":{"href":"https://api.github.com/repos/assem-ch/alfanous/issues/7"},"comments":{"href":"https://api.github.com/repos/assem-ch/alfanous/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/assem-ch/alfanous/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/assem-ch/alfanous/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/assem-ch/alfanous/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/assem-ch/alfanous/statuses/e54f9de2557e90e0ce26e779648f08db2432f269"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":3,"deletions":0,"changed_files":1}}