sat23 před 4 roky
rodič
revize
8c08bbf31f

+ 18 - 18
SATHelper/SATHelper/DevicesWnd.cpp

@@ -45,10 +45,10 @@ CDevicesWnd::CDevicesWnd() noexcept
 int CDevicesWnd::InitCtrl()
 {
 	CRect rectDummy(0, 0, 50, 23);
-	m_lb_Actuator.Create(_T("执行器:"), SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
-	m_lb_IP.Create(_T("电视IP:"), SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
-	m_lb_TaskId.Create(_T("任务ID:"), SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
-	m_lb_TaskStatus.Create(_T("任务状态"), SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
+	m_lb_Actuator.Create(GlobalString::g_strActuator, SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
+	m_lb_IP.Create(GlobalString::g_strActuatorTVIP, SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
+	m_lb_TaskId.Create(GlobalString::g_strActuatorTaskID, SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
+	m_lb_TaskStatus.Create(GlobalString::g_strActuatorTaskStatus, SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
 
 	if (!m_edit_TaskId.Create(WS_BORDER | WS_CHILD | WS_VISIBLE | ES_READONLY | WS_TABSTOP, rectDummy, this, TX_TASKID))
 	{
@@ -65,12 +65,12 @@ int CDevicesWnd::InitCtrl()
 		return -1;
 	}
 
-	if (!m_btnModify.Create(_T("修改"), WS_CHILD | WS_VISIBLE | WS_TABSTOP, rectDummy, this, BTN_MODIFY_RUNNER_NAME))
+	if (!m_btnModify.Create(GlobalString::g_strActuatorModify, WS_CHILD | WS_VISIBLE | WS_TABSTOP, rectDummy, this, BTN_MODIFY_RUNNER_NAME))
 	{
 		return -1;
 	}
 	
-	if (!m_btnAddAndroid.Create(_T("添加"), WS_CHILD | WS_VISIBLE | WS_TABSTOP, rectDummy, this, BTN_ADD_ANDROID))
+	if (!m_btnAddAndroid.Create(GlobalString::g_strActuatorAddIP, WS_CHILD | WS_VISIBLE | WS_TABSTOP, rectDummy, this, BTN_ADD_ANDROID))
 	{
 		return -1;
 	}
@@ -104,24 +104,24 @@ int CDevicesWnd::InitCtrl()
 
 	int nIndex = 0;
 	// 初始化设备列表;
-	m_listDevices.InsertColumn(nIndex, "类型");
-	m_listDevices.SetColumnWidth(nIndex++, 38);
-	m_listDevices.InsertColumn(nIndex, "TV名称");
+	m_listDevices.InsertColumn(nIndex, GlobalString::g_strListDeviceType);
+	m_listDevices.SetColumnWidth(nIndex++, 39);
+	m_listDevices.InsertColumn(nIndex, GlobalString::g_strListDeviceName);
 	m_listDevices.SetColumnWidth(nIndex++, 115);
-	m_listDevices.InsertColumn(nIndex, "状态");
-	m_listDevices.SetColumnWidth(nIndex++, 38);
+	m_listDevices.InsertColumn(nIndex, GlobalString::g_strListDeviceStatus);
+	m_listDevices.SetColumnWidth(nIndex++, 50);
 	m_listDevices.SetExtendedStyle(m_listDevices.GetExtendedStyle() | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
 
 	// 初始化任务列表;
-	m_listTask.InsertColumn(0, "No");
-	m_listTask.SetColumnWidth(0, 25);
-	m_listTask.InsertColumn(1, "脚本名称");
+	m_listTask.InsertColumn(0, GlobalString::g_strListTaskNo);
+	m_listTask.SetColumnWidth(0, 30);
+	m_listTask.InsertColumn(1, GlobalString::g_strListTaskScript);
 	m_listTask.SetColumnWidth(1, 130);
-	m_listTask.InsertColumn(2, "执行状态");
-	m_listTask.SetColumnWidth(2, 60);
-	m_listTask.InsertColumn(3, "结果状态");
+	m_listTask.InsertColumn(2, GlobalString::g_strListTaskRunStatus);
+	m_listTask.SetColumnWidth(2, 65);
+	m_listTask.InsertColumn(3, GlobalString::g_strListTaskResult);
 	m_listTask.SetColumnWidth(3, 60);
-	m_listTask.InsertColumn(4, "日志");
+	m_listTask.InsertColumn(4, GlobalString::g_strListTaskLog);
 	m_listTask.SetColumnWidth(4, 55);
 	m_listTask.SetExtendedStyle(m_listTask.GetExtendedStyle() | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
 

+ 46 - 13
SATHelper/SATHelper/GlobalString.cpp

@@ -8,44 +8,77 @@ namespace GlobalString
 	CString g_strLogout;
 	CString g_strLoginFail;
 	CString g_strLogoutFail;
-
+	CString g_strCtrlClose;
+	CString g_strCtrlOpen;
 	CString g_strSwitchPC;
 	CString g_strSwitchTV;
-	CString g_strRemoteDevice;
-	CString g_strActuator;
-	CString g_strUSBUpgrade;
+	// 遥控器;
+	CString g_strRemoteDevice;	
 	CString g_strRestartRemoteDevice;
-	CString g_strRemoteSelect;
+	CString g_strRemoteSelect;	
+	// 执行器;
+	CString g_strActuator;
 	CString g_strActuatorModify;
 	CString g_strActuatorAddIP;
 	CString g_strActuatorTVIP;
 	CString g_strActuatorTaskID;
 	CString g_strActuatorTaskStatus;
-	CString g_strCtrlClose;
-	CString g_strCtrlOpen;
+	CString g_strListDeviceType;
+	CString g_strListDeviceName;
+	CString g_strListDeviceStatus;
+	CString g_strListTaskNo;
+	CString g_strListTaskScript;
+	CString g_strListTaskRunStatus;
+	CString g_strListTaskResult;
+	CString g_strListTaskLog;
+	// USB升级;
+	CString g_strUSBUpgrade;
+	CString g_strUpgradePath;
+	CString g_strUpgradeFTPUser;
+	CString g_strUpgradeFTPPassword;
+	CString g_strUpgradeRememberFTP;
+	CString g_strUpgradeBtn;
+	CString g_strUpgradeOpenFile;
+	CString g_strUpgradeNotify;
 
 	void GetResourceString()
 	{
 		g_strLogin.LoadString(IDS_LOGIN);
 		g_strLogout.LoadString(IDS_LOGOUT);
-
 		g_strLoginFail.LoadString(IDS_LOGIN_FAIL);
 		g_strLogoutFail.LoadString(IDS_LOGOUT_FAIL);
-
+		g_strCtrlClose.LoadString(IDS_CTRL_CLOSE);
+		g_strCtrlOpen.LoadString(IDS_CTRL_OPEN);
 		g_strSwitchPC.LoadString(IDS_SWITCH_PC);
 		g_strSwitchTV.LoadString(IDS_SWITCH_TV);
+		// 遥控器;
 		g_strRemoteDevice.LoadString(IDS_REMOTE_DEVICE);
-		g_strActuator.LoadString(IDS_ACTUATOR);
-		g_strUSBUpgrade.LoadString(IDS_USB_UPGRADE);
 		g_strRestartRemoteDevice.LoadString(IDS_RESTART_REMOTE_DEVICE);
 		g_strRemoteSelect.LoadString(IDS_REMOTE_SELECTE);
+		// 执行器;
+		g_strActuator.LoadString(IDS_ACTUATOR);
 		g_strActuatorModify.LoadString(IDS_ACTUATOR_MODIFY);
 		g_strActuatorAddIP.LoadString(IDS_ACTUATOR_ADDIP);
 		g_strActuatorTVIP.LoadString(IDS_ACTUATOR_TVIP);
 		g_strActuatorTaskID.LoadString(IDS_ACTUATOR_TASKID);
 		g_strActuatorTaskStatus.LoadString(IDS_ACTUATOR_TASK_STATUS);
+		g_strListDeviceType.LoadString(IDS_LIST_DEVICE_TYPE);
+		g_strListDeviceName.LoadString(IDS_LIST_DEVICE_NAME);
+		g_strListDeviceStatus.LoadString(IDS_LIST_DEVICE_STATUS);
+		g_strListTaskNo.LoadString(IDS_LIST_TASK_NO);
+		g_strListTaskScript.LoadString(IDS_LIST_TASK_NAME);
+		g_strListTaskRunStatus.LoadString(IDS_LIST_TASK_RUN_STATUS);
+		g_strListTaskResult.LoadString(IDS_LIST_TASK_RESULT);
+		g_strListTaskLog.LoadString(IDS_LIST_TASK_LOG);
 
-		g_strCtrlClose.LoadString(IDS_CTRL_CLOSE);
-		g_strCtrlOpen.LoadString(IDS_CTRL_OPEN);
+		// USB升级;
+		g_strUSBUpgrade.LoadString(IDS_USB_UPGRADE);
+		g_strUpgradePath.LoadString(IDS_UPGRADE_PATH);
+		g_strUpgradeFTPUser.LoadString(IDS_UPGRADE_FTP_USER);
+		g_strUpgradeFTPPassword.LoadString(IDS_UPGRADE_FTP_PASSWORD);
+		g_strUpgradeRememberFTP.LoadString(IDS_UPGRADE_CHECK_FTP);
+		g_strUpgradeBtn.LoadString(IDS_UPGRADE_BTN_UPGRADE);
+		g_strUpgradeOpenFile.LoadString(IDS_UPGRADE_OPEN_FILE);
+		g_strUpgradeNotify.LoadString(IDS_UPGRADE_NOTIFY);
 	}
 };

+ 24 - 5
SATHelper/SATHelper/GlobalString.h

@@ -8,21 +8,40 @@ namespace GlobalString
 	extern CString g_strLogout;
 	extern CString g_strLoginFail;
 	extern CString g_strLogoutFail;
-
+	extern CString g_strCtrlClose;
+	extern CString g_strCtrlOpen;
 	extern CString g_strSwitchPC;
 	extern CString g_strSwitchTV;
+	// Ò£¿ØÆ÷;
 	extern CString g_strRemoteDevice;
-	extern CString g_strActuator;
-	extern CString g_strUSBUpgrade;
 	extern CString g_strRestartRemoteDevice;
 	extern CString g_strRemoteSelect;
+	
+	// Ö´ÐÐÆ÷;
+	extern CString g_strActuator;
 	extern CString g_strActuatorModify;
 	extern CString g_strActuatorAddIP;
 	extern CString g_strActuatorTVIP;
 	extern CString g_strActuatorTaskID;
 	extern CString g_strActuatorTaskStatus;
-	extern CString g_strCtrlClose;
-	extern CString g_strCtrlOpen;
+	extern CString g_strListDeviceType;
+	extern CString g_strListDeviceName;
+	extern CString g_strListDeviceStatus;
+	extern CString g_strListTaskNo;
+	extern CString g_strListTaskScript;
+	extern CString g_strListTaskRunStatus;
+	extern CString g_strListTaskResult;
+	extern CString g_strListTaskLog;
+
+	// USBÉý¼¶;
+	extern CString g_strUSBUpgrade;
+	extern CString g_strUpgradePath;
+	extern CString g_strUpgradeFTPUser;
+	extern CString g_strUpgradeFTPPassword;
+	extern CString g_strUpgradeRememberFTP;
+	extern CString g_strUpgradeBtn;
+	extern CString g_strUpgradeOpenFile;
+	extern CString g_strUpgradeNotify;
 
 	void GetResourceString();
 };

+ 16 - 6
SATHelper/SATHelper/Resource.h

@@ -26,26 +26,36 @@
 #define IDB_FILESMALL                   115
 #define IDS_ACTUATOR_TASKID             115
 #define IDS_ACTUATOR_TASK_STATUS        116
-#define IDS_STRING117                   117
-#define IDS_STRING118                   118
+#define IDS_LIST_DEVICE_TYPE            117
+#define IDS_LIST_DEVICE_NAME            118
 #define IDR_POPUP_EDIT                  119
-#define IDS_STRING119                   119
+#define IDS_LIST_DEVICE_STATUS          119
 #define ID_STATUSBAR_PANE1              120
-#define IDS_STRING120                   120
+#define IDS_LIST_TASK_NO                120
 #define ID_STATUSBAR_PANE2              121
-#define IDS_STRING121                   121
+#define IDS_LIST_TASK_NAME              121
 #define IDS_STATUS_PANE1                122
 #define IDS_STATUS_PANE2                123
+#define IDS_LIST_TASK_RUN_STATUS        124
+#define IDS_LIST_TASK_RESULT            125
+#define IDS_LIST_TASK_LOG               126
+#define IDS_UPGRADE_PATH                127
 #define IDR_MAINFRAME                   128
 #define IDR_MAINFRAME_256               129
+#define IDS_UPGRADE_FTP_USER            129
 #define IDR_SATHelperTYPE               130
 #define ID_WINDOW_MANAGER               131
+#define IDS_UPGRADE_FTP_PASSWORD        132
 #define ID_VIEW_FILEVIEW                133
+#define IDS_UPGRADE_CHECK_FTP           133
 #define ID_VIEW_CLASSVIEW               134
+#define IDS_UPGRADE_BTN_UPGRADE         134
 #define ID_PROPERTIES                   135
-#define IDS_STRING135                   135
+#define IDS_UPGRADE_NOTIFY              135
 #define ID_OPEN                         136
+#define IDS_UPGRADE_OPEN_FILE           136
 #define ID_OPEN_WITH                    137
+#define IDS_STRING137                   137
 #define ID_DUMMY_COMPILE                138
 #define ID_CLASS_ADD_MEMBER_FUNCTION    139
 #define ID_CLASS_ADD_MEMBER_VARIABLE    140

+ 14 - 8
SATHelper/SATHelper/UpgradeWnd.cpp

@@ -136,37 +136,37 @@ int CUpgradeWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
 	const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_BORDER | CBS_SORT | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP;
 
 	// 编辑框;
-	m_text_path.Create(_T("路径:"), SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE , rectDummy, this, IDC_STATIC);
+	m_text_path.Create(GlobalString::g_strUpgradePath, SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE , rectDummy, this, IDC_STATIC);
 	//if (!m_edit_path.Create( WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPSIBLINGS| WS_TABSTOP, rectDummy, this, ID_EDIT_IMAGE_PATH))
 	if (!m_edit_path.Create(WS_CHILD | WS_VISIBLE | WS_BORDER |ES_AUTOHSCROLL | WS_TABSTOP, rectDummy, this, ID_EDIT_IMAGE_PATH))
 	{
 		return -1;
 	}
 
-	m_text_user.Create(_T("FTP账号:"), SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
+	m_text_user.Create(GlobalString::g_strUpgradeFTPUser, SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
 	if (!m_ftp_user.Create(WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL | WS_TABSTOP, rectDummy, this, ID_EIDT_FTP_USER))
 	{
 		return -1;
 	}
 
-	m_text_password.Create(_T("FTP密码:"), SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
+	m_text_password.Create(GlobalString::g_strUpgradeFTPPassword, SS_CENTER | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
 	if (!m_ftp_password.Create(WS_CHILD | WS_VISIBLE | WS_BORDER | ES_PASSWORD | ES_AUTOHSCROLL | WS_TABSTOP, rectDummy, this, ID_EDIT_FTP_PASSWORD))
 	{
 		//m_ftp_password.SetPasswordChar(‘*');
 		return -1;
 	}
 
-	if (!m_check_remember.Create(_T("记住信息"), WS_CHILD | BS_CHECKBOX| WS_VISIBLE | WS_TABSTOP, rectDummy, this, ID_CHECK_REMEMBER_FTP))
+	if (!m_check_remember.Create(GlobalString::g_strUpgradeRememberFTP, WS_CHILD | BS_CHECKBOX| WS_VISIBLE | WS_TABSTOP, rectDummy, this, ID_CHECK_REMEMBER_FTP))
 	{
 		return -1;
 	}
 
-	if (!m_btnUpgrade.Create(_T("升级"), WS_CHILD | WS_VISIBLE | WS_TABSTOP, rectDummy, this, ID_BTN_UPGRADE))
+	if (!m_btnUpgrade.Create(GlobalString::g_strUpgradeBtn, WS_CHILD | WS_VISIBLE | WS_TABSTOP, rectDummy, this, ID_BTN_UPGRADE))
 	{
 		return -1;
 	}
 
-	m_text_notify.Create(_T("提示:\n        升级按钮对应的功能脚本修改后必须重启SATHelper!"), SS_LEFT | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
+	m_text_notify.Create(GlobalString::g_strUpgradeNotify, SS_LEFT | WS_CHILD | WS_VISIBLE, rectDummy, this, IDC_STATIC);
 
 	// 以编辑框高度为所有控件高度标准;
 	CRect rcCtrl;
@@ -213,7 +213,10 @@ void CUpgradeWnd::OnUpgradeBtnClick()
 		}
 
 		p->m_btnUpgrade.EnableWindow(FALSE);
-		p->m_text_notify.SetWindowText("升级中,请稍等……!");
+		if ( Global::g_Config.nLanguage)
+			p->m_text_notify.SetWindowText("升级中,请稍等……!");
+		else
+			p->m_text_notify.SetWindowText("Upgrading, please wait!");
 		Sleep(1000);
 		
 		CCallPython pycall;
@@ -222,7 +225,10 @@ void CUpgradeWnd::OnUpgradeBtnClick()
 		PyObject* pRet = pycall.CallPython(szPath, _T("API_TVUpgrade"), 3, _variant_t(strPath.GetString()), _variant_t(strFtpUser.GetString()), _variant_t(strFtpPassword.GetString()));
 		if (pRet == NULL)
 		{
-			p->m_text_notify.SetWindowText("运行出错,请检查脚本!");
+			if (Global::g_Config.nLanguage)
+				p->m_text_notify.SetWindowText("Running error, please check the script!");
+			else
+				p->m_text_notify.SetWindowText("运行出错,请检查脚本!");
 		}
 		else
 		{

+ 16 - 6
SATHelper/SATHelper/resource.h

@@ -26,26 +26,36 @@
 #define IDB_FILESMALL                   115
 #define IDS_ACTUATOR_TASKID             115
 #define IDS_ACTUATOR_TASK_STATUS        116
-#define IDS_STRING117                   117
-#define IDS_STRING118                   118
+#define IDS_LIST_DEVICE_TYPE            117
+#define IDS_LIST_DEVICE_NAME            118
 #define IDR_POPUP_EDIT                  119
-#define IDS_STRING119                   119
+#define IDS_LIST_DEVICE_STATUS          119
 #define ID_STATUSBAR_PANE1              120
-#define IDS_STRING120                   120
+#define IDS_LIST_TASK_NO                120
 #define ID_STATUSBAR_PANE2              121
-#define IDS_STRING121                   121
+#define IDS_LIST_TASK_NAME              121
 #define IDS_STATUS_PANE1                122
 #define IDS_STATUS_PANE2                123
+#define IDS_LIST_TASK_RUN_STATUS        124
+#define IDS_LIST_TASK_RESULT            125
+#define IDS_LIST_TASK_LOG               126
+#define IDS_UPGRADE_PATH                127
 #define IDR_MAINFRAME                   128
 #define IDR_MAINFRAME_256               129
+#define IDS_UPGRADE_FTP_USER            129
 #define IDR_SATHelperTYPE               130
 #define ID_WINDOW_MANAGER               131
+#define IDS_UPGRADE_FTP_PASSWORD        132
 #define ID_VIEW_FILEVIEW                133
+#define IDS_UPGRADE_CHECK_FTP           133
 #define ID_VIEW_CLASSVIEW               134
+#define IDS_UPGRADE_BTN_UPGRADE         134
 #define ID_PROPERTIES                   135
-#define IDS_STRING135                   135
+#define IDS_UPGRADE_NOTIFY              135
 #define ID_OPEN                         136
+#define IDS_UPGRADE_OPEN_FILE           136
 #define ID_OPEN_WITH                    137
+#define IDS_STRING137                   137
 #define ID_DUMMY_COMPILE                138
 #define ID_CLASS_ADD_MEMBER_FUNCTION    139
 #define ID_CLASS_ADD_MEMBER_VARIABLE    140