From 763ddd347316c9360d2d76d7e70c1596bcb50e66 Mon Sep 17 00:00:00 2001 From: eliboa Date: Tue, 24 Jul 2018 21:54:19 +0200 Subject: [PATCH] Added : trigger autoinject option from tray context menu --- TegraRcmGUI/TegraRcm.cpp | 7 +++++++ TegraRcmGUI/TegraRcmGUI.rc | Bin 21972 -> 21972 bytes TegraRcmGUI/TegraRcmGUIDlg.cpp | 27 +++++++++++++++++++++++++++ TegraRcmGUI/TegraRcmGUIDlg.h | 3 ++- TegraRcmGUI/resource.h | Bin 10122 -> 10312 bytes 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/TegraRcmGUI/TegraRcm.cpp b/TegraRcmGUI/TegraRcm.cpp index 49ccec8..801ea95 100644 --- a/TegraRcmGUI/TegraRcm.cpp +++ b/TegraRcmGUI/TegraRcm.cpp @@ -139,6 +139,12 @@ void TegraRcm::ShowContextMenu(HWND hWnd) HMENU hMenu = CreatePopupMenu(); if (hMenu) { + + CString autoinjectLb; + if (AUTOINJECT_CURR) autoinjectLb = _T("Auto inject (On)"); + else autoinjectLb = _T("Auto inject (Off)"); + InsertMenu(hMenu, -1, MF_BYPOSITION, SWM_AUTOINJECT, autoinjectLb); + if (m_RC == 0) { @@ -219,6 +225,7 @@ void TegraRcm::ShowContextMenu(HWND hWnd) mii.dwTypeData = _T("Favorites"); CString csPathf, csFilename, payload; + m_Ctrltb1->GetDlgItem(PAYLOAD_PATH)->GetWindowTextW(csPathf); int nIndex = csPathf.ReverseFind(_T('\\')); if (nIndex > 0) diff --git a/TegraRcmGUI/TegraRcmGUI.rc b/TegraRcmGUI/TegraRcmGUI.rc index b44164ef32440cba6414bfd4afb65d1ad9848da0..14996cf419514d8084f3adef483cf3e62a9b1cae 100644 GIT binary patch delta 51 zcmcbzn(@kN#tk#r8I3m2WIxKmXf!!qz!1opDDavINYx5+0;$Qh!t#?}NpNl6Agba3 E0N4c(?f?J) delta 51 zcmcbzn(@kN#tk#r84WkjWIxKmXgE1uz!1opDDavINYx5+0;$Qh!t#?}NpNl6Agba3 E0M~mE=>Px# diff --git a/TegraRcmGUI/TegraRcmGUIDlg.cpp b/TegraRcmGUI/TegraRcmGUIDlg.cpp index e3e81b2..caa5438 100644 --- a/TegraRcmGUI/TegraRcmGUIDlg.cpp +++ b/TegraRcmGUI/TegraRcmGUIDlg.cpp @@ -92,6 +92,7 @@ BEGIN_MESSAGE_MAP(CTegraRcmGUIDlg, CDialog) ON_COMMAND(SWM_FAV08, InjectFav08Command) ON_COMMAND(SWM_FAV09, InjectFav09Command) ON_COMMAND(SWM_FAV10, InjectFav10Command) + ON_COMMAND(SWM_AUTOINJECT, AutoInjectCommand) END_MESSAGE_MAP() // @@ -365,6 +366,32 @@ void CTegraRcmGUIDlg::InjectFavCommand(int i) } } +void CTegraRcmGUIDlg::AutoInjectCommand() +{ + if (m_TegraRcm != NULL) + { + DialogTab03 *pt = (DialogTab03*)m_TegraRcm->m_Ctrltb3; + if (m_TegraRcm->AUTOINJECT_CURR) + { + m_TegraRcm->AUTOINJECT_CURR = FALSE; + m_TegraRcm->SetPreset("AUTO_INJECT", "FALSE"); + m_TegraRcm->DELAY_AUTOINJECT = FALSE; + CButton *m_ctlCheck = (CButton*)pt->GetDlgItem(AUTO_INJECT); + m_ctlCheck->SetCheck(BST_UNCHECKED); + } + else + { + m_TegraRcm->AUTOINJECT_CURR = TRUE; + m_TegraRcm->SetPreset("AUTO_INJECT", "TRUE"); + m_TegraRcm->DELAY_AUTOINJECT = TRUE; + CButton *m_ctlCheck = (CButton*)pt->GetDlgItem(AUTO_INJECT); + m_ctlCheck->SetCheck(BST_CHECKED); + } + AfxGetMainWnd()->UpdateWindow(); + pt->OnClickedAutoInject(); + } +} + void CTegraRcmGUIDlg::StartTimer() { diff --git a/TegraRcmGUI/TegraRcmGUIDlg.h b/TegraRcmGUI/TegraRcmGUIDlg.h index b4c35e5..56be0a8 100644 --- a/TegraRcmGUI/TegraRcmGUIDlg.h +++ b/TegraRcmGUI/TegraRcmGUIDlg.h @@ -26,7 +26,7 @@ #include "TegraRcm.h" #include "DialogTab01.h" #include "DialogTab02.h" - +#include "DialogTab03.h" #pragma comment (lib, "setupapi.lib") @@ -118,6 +118,7 @@ public: void InjectFav08Command(); void InjectFav09Command(); void InjectFav10Command(); + void AutoInjectCommand(); CTegraRcmGUIDlg *m_pMainWnd = this; private: diff --git a/TegraRcmGUI/resource.h b/TegraRcmGUI/resource.h index 57302b11c44c400bb58f5f5071e7794a4ad9d2a9..ac0dd2facd62ed68a126246a616231edb41b70bf 100644 GIT binary patch delta 120 zcmeD3KM}A&jc0QMPZpPC5JM<~A45DtID;pU4rT~pa0KEYhLFhznKUO~5R($erUE3d zD5AglidYceR(B;2Djc4KmmdU%A1tvFf>r77Lk(w;PqOjSG$BS!{1lQ&uaU;IXPgGNw0AOhj AW&i*H