{"action":"created","comment":{"url":"https://api.github.com/repos/opentx/opentx/pulls/comments/22856070","id":22856070,"diff_hunk":"@@ -1294,92 +1298,109 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString\n \n void MainWindow::writeFlash(QString fileToFlash)\n {\n-    QString fileName;\n-    bool backup = g.backupOnFlash();\n-    if(!fileToFlash.isEmpty())\n-      fileName = fileToFlash;\n-    burnDialog *cd = new burnDialog(this, 2, &fileName, &backup);\n-    cd->exec();\n-    if (IS_TARANIS(GetEepromInterface()->getBoard()))\n-      backup=false;\n-    if (!fileName.isEmpty()) {\n-      if (g.checkHardwareCompatibility()) {\n-        QString tempFlash = generateProcessUniqueTempFileName(\"flash.bin\");\n-        if (!readFirmwareFromRadio(tempFlash)) {\n-          QMessageBox::warning(this, tr(\"Firmware check failed\"), tr(\"Could not check firmware from radio\"));\n-          return;\n-        }\n-        FlashInterface previousFlash(tempFlash);\n-        FlashInterface newFlash(fileName);\n-        if (!newFlash.isHardwareCompatible(previousFlash)) {\n-          QMessageBox::warning(this, tr(\"Firmware check failed\"), tr(\"New firmware is not compatible with the one currently installed!\"));\n-          return;\n+  qDebug() << \"MainWindow::writeFlash(): started with\" << fileToFlash;\n+  QString fileName;\n+  bool backup = g.backupOnFlash();\n+  if(!fileToFlash.isEmpty()) {\n+    fileName = fileToFlash;\n+  }\n+\n+  burnDialog *cd = new burnDialog(this, 2, &fileName, &backup);\n+  cd->exec();\n+  qDebug() << \"MainWindow::writeFlash(): flashing \" << fileName;\n+  \n+  if (IS_TARANIS(GetEepromInterface()->getBoard())) {\n+    backup=false;\n+  }\n+\n+  if (!fileName.isEmpty()) {\n+    if (g.checkHardwareCompatibility()) {\n+      QString tempFlash = generateProcessUniqueTempFileName(\"flash-check.bin\");\n+      if (!readFirmwareFromRadio(tempFlash)) {\n+        QMessageBox::warning(this, tr(\"Firmware check failed\"), tr(\"Could not check firmware from radio\"));\n+        return;\n+      }\n+      FlashInterface previousFlash(tempFlash);\n+      qunlink(tempFlash);\n+      FlashInterface newFlash(fileName);\n+      qDebug() << \"MainWindow::writeFlash(): checking firmware compatibility between \" << tempFlash << \"and\" << fileName;\n+      if (!newFlash.isHardwareCompatible(previousFlash)) {\n+        QMessageBox::warning(this, tr(\"Firmware check failed\"), tr(\"New firmware is not compatible with the one currently installed!\"));\n+        if (isTempFileName(fileName)) {\n+          qDebug() << \"MainWindow::writeFlash(): removing temporary file\" << fileName;\n+          qunlink(fileName);","path":"companion/src/mainwindow.cpp","position":86,"original_position":86,"commit_id":"d827395434429f1177a27861e73dd32dbc771509","original_commit_id":"d827395434429f1177a27861e73dd32dbc771509","user":{"login":"projectkk2glider","id":5950438,"avatar_url":"https://avatars.githubusercontent.com/u/5950438?v=3","gravatar_id":"","url":"https://api.github.com/users/projectkk2glider","html_url":"https://github.com/projectkk2glider","followers_url":"https://api.github.com/users/projectkk2glider/followers","following_url":"https://api.github.com/users/projectkk2glider/following{/other_user}","gists_url":"https://api.github.com/users/projectkk2glider/gists{/gist_id}","starred_url":"https://api.github.com/users/projectkk2glider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectkk2glider/subscriptions","organizations_url":"https://api.github.com/users/projectkk2glider/orgs","repos_url":"https://api.github.com/users/projectkk2glider/repos","events_url":"https://api.github.com/users/projectkk2glider/events{/privacy}","received_events_url":"https://api.github.com/users/projectkk2glider/received_events","type":"User","site_admin":false},"body":"Temp file deleted","created_at":"2015-01-13T11:21:53Z","updated_at":"2015-01-13T11:21:53Z","html_url":"https://github.com/opentx/opentx/pull/1998#discussion_r22856070","pull_request_url":"https://api.github.com/repos/opentx/opentx/pulls/1998","_links":{"self":{"href":"https://api.github.com/repos/opentx/opentx/pulls/comments/22856070"},"html":{"href":"https://github.com/opentx/opentx/pull/1998#discussion_r22856070"},"pull_request":{"href":"https://api.github.com/repos/opentx/opentx/pulls/1998"}}},"pull_request":{"url":"https://api.github.com/repos/opentx/opentx/pulls/1998","id":27264033,"html_url":"https://github.com/opentx/opentx/pull/1998","diff_url":"https://github.com/opentx/opentx/pull/1998.diff","patch_url":"https://github.com/opentx/opentx/pull/1998.patch","issue_url":"https://api.github.com/repos/opentx/opentx/issues/1998","number":1998,"state":"open","locked":false,"title":"Fixes #1997: firmware upload failed when \"Check Firmware Compatibility\" ...","user":{"login":"projectkk2glider","id":5950438,"avatar_url":"https://avatars.githubusercontent.com/u/5950438?v=3","gravatar_id":"","url":"https://api.github.com/users/projectkk2glider","html_url":"https://github.com/projectkk2glider","followers_url":"https://api.github.com/users/projectkk2glider/followers","following_url":"https://api.github.com/users/projectkk2glider/following{/other_user}","gists_url":"https://api.github.com/users/projectkk2glider/gists{/gist_id}","starred_url":"https://api.github.com/users/projectkk2glider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectkk2glider/subscriptions","organizations_url":"https://api.github.com/users/projectkk2glider/orgs","repos_url":"https://api.github.com/users/projectkk2glider/repos","events_url":"https://api.github.com/users/projectkk2glider/events{/privacy}","received_events_url":"https://api.github.com/users/projectkk2glider/received_events","type":"User","site_admin":false},"body":"...was selected\r\n\r\nCloses #1997 \r\n\r\nI've tested this on Linux with *fake* Taranis - just an USB key with FIRMWARE.BIN file. But it works - the contents of FIRMWARE.BIN get changed to desired state.\r\n\r\nWe need somebody to test this on Windows and with real radio.","created_at":"2015-01-13T11:20:42Z","updated_at":"2015-01-13T11:21:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"394945ca635fba3b161926f3d264037e602c19fa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opentx/opentx/pulls/1998/commits","review_comments_url":"https://api.github.com/repos/opentx/opentx/pulls/1998/comments","review_comment_url":"https://api.github.com/repos/opentx/opentx/pulls/comments/{number}","comments_url":"https://api.github.com/repos/opentx/opentx/issues/1998/comments","statuses_url":"https://api.github.com/repos/opentx/opentx/statuses/d827395434429f1177a27861e73dd32dbc771509","head":{"label":"opentx:projectkk2glider/issue_1997","ref":"projectkk2glider/issue_1997","sha":"d827395434429f1177a27861e73dd32dbc771509","user":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"repo":{"id":14794708,"name":"opentx","full_name":"opentx/opentx","owner":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opentx/opentx","description":"OpenTX custom firmware for Transmitters","fork":false,"url":"https://api.github.com/repos/opentx/opentx","forks_url":"https://api.github.com/repos/opentx/opentx/forks","keys_url":"https://api.github.com/repos/opentx/opentx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentx/opentx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentx/opentx/teams","hooks_url":"https://api.github.com/repos/opentx/opentx/hooks","issue_events_url":"https://api.github.com/repos/opentx/opentx/issues/events{/number}","events_url":"https://api.github.com/repos/opentx/opentx/events","assignees_url":"https://api.github.com/repos/opentx/opentx/assignees{/user}","branches_url":"https://api.github.com/repos/opentx/opentx/branches{/branch}","tags_url":"https://api.github.com/repos/opentx/opentx/tags","blobs_url":"https://api.github.com/repos/opentx/opentx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentx/opentx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentx/opentx/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentx/opentx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentx/opentx/statuses/{sha}","languages_url":"https://api.github.com/repos/opentx/opentx/languages","stargazers_url":"https://api.github.com/repos/opentx/opentx/stargazers","contributors_url":"https://api.github.com/repos/opentx/opentx/contributors","subscribers_url":"https://api.github.com/repos/opentx/opentx/subscribers","subscription_url":"https://api.github.com/repos/opentx/opentx/subscription","commits_url":"https://api.github.com/repos/opentx/opentx/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentx/opentx/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentx/opentx/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentx/opentx/issues/comments/{number}","contents_url":"https://api.github.com/repos/opentx/opentx/contents/{+path}","compare_url":"https://api.github.com/repos/opentx/opentx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentx/opentx/merges","archive_url":"https://api.github.com/repos/opentx/opentx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentx/opentx/downloads","issues_url":"https://api.github.com/repos/opentx/opentx/issues{/number}","pulls_url":"https://api.github.com/repos/opentx/opentx/pulls{/number}","milestones_url":"https://api.github.com/repos/opentx/opentx/milestones{/number}","notifications_url":"https://api.github.com/repos/opentx/opentx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentx/opentx/labels{/name}","releases_url":"https://api.github.com/repos/opentx/opentx/releases{/id}","created_at":"2013-11-29T07:02:56Z","updated_at":"2015-01-12T17:25:47Z","pushed_at":"2015-01-13T11:16:20Z","git_url":"git://github.com/opentx/opentx.git","ssh_url":"git@github.com:opentx/opentx.git","clone_url":"https://github.com/opentx/opentx.git","svn_url":"https://github.com/opentx/opentx","homepage":"","size":137881,"stargazers_count":176,"watchers_count":176,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":112,"mirror_url":null,"open_issues_count":204,"forks":112,"open_issues":204,"watchers":176,"default_branch":"next"}},"base":{"label":"opentx:master","ref":"master","sha":"94ced113c32b8298206610e0cfbe1ecad505cc9b","user":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"repo":{"id":14794708,"name":"opentx","full_name":"opentx/opentx","owner":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opentx/opentx","description":"OpenTX custom firmware for Transmitters","fork":false,"url":"https://api.github.com/repos/opentx/opentx","forks_url":"https://api.github.com/repos/opentx/opentx/forks","keys_url":"https://api.github.com/repos/opentx/opentx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentx/opentx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentx/opentx/teams","hooks_url":"https://api.github.com/repos/opentx/opentx/hooks","issue_events_url":"https://api.github.com/repos/opentx/opentx/issues/events{/number}","events_url":"https://api.github.com/repos/opentx/opentx/events","assignees_url":"https://api.github.com/repos/opentx/opentx/assignees{/user}","branches_url":"https://api.github.com/repos/opentx/opentx/branches{/branch}","tags_url":"https://api.github.com/repos/opentx/opentx/tags","blobs_url":"https://api.github.com/repos/opentx/opentx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentx/opentx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentx/opentx/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentx/opentx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentx/opentx/statuses/{sha}","languages_url":"https://api.github.com/repos/opentx/opentx/languages","stargazers_url":"https://api.github.com/repos/opentx/opentx/stargazers","contributors_url":"https://api.github.com/repos/opentx/opentx/contributors","subscribers_url":"https://api.github.com/repos/opentx/opentx/subscribers","subscription_url":"https://api.github.com/repos/opentx/opentx/subscription","commits_url":"https://api.github.com/repos/opentx/opentx/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentx/opentx/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentx/opentx/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentx/opentx/issues/comments/{number}","contents_url":"https://api.github.com/repos/opentx/opentx/contents/{+path}","compare_url":"https://api.github.com/repos/opentx/opentx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentx/opentx/merges","archive_url":"https://api.github.com/repos/opentx/opentx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentx/opentx/downloads","issues_url":"https://api.github.com/repos/opentx/opentx/issues{/number}","pulls_url":"https://api.github.com/repos/opentx/opentx/pulls{/number}","milestones_url":"https://api.github.com/repos/opentx/opentx/milestones{/number}","notifications_url":"https://api.github.com/repos/opentx/opentx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentx/opentx/labels{/name}","releases_url":"https://api.github.com/repos/opentx/opentx/releases{/id}","created_at":"2013-11-29T07:02:56Z","updated_at":"2015-01-12T17:25:47Z","pushed_at":"2015-01-13T11:16:20Z","git_url":"git://github.com/opentx/opentx.git","ssh_url":"git@github.com:opentx/opentx.git","clone_url":"https://github.com/opentx/opentx.git","svn_url":"https://github.com/opentx/opentx","homepage":"","size":137881,"stargazers_count":176,"watchers_count":176,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":112,"mirror_url":null,"open_issues_count":204,"forks":112,"open_issues":204,"watchers":176,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/opentx/opentx/pulls/1998"},"html":{"href":"https://github.com/opentx/opentx/pull/1998"},"issue":{"href":"https://api.github.com/repos/opentx/opentx/issues/1998"},"comments":{"href":"https://api.github.com/repos/opentx/opentx/issues/1998/comments"},"review_comments":{"href":"https://api.github.com/repos/opentx/opentx/pulls/1998/comments"},"review_comment":{"href":"https://api.github.com/repos/opentx/opentx/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/opentx/opentx/pulls/1998/commits"},"statuses":{"href":"https://api.github.com/repos/opentx/opentx/statuses/d827395434429f1177a27861e73dd32dbc771509"}}}}