def OnNotify(self, sendor, sType, wParam, lParam): # 用户点击事件 if sType == DUI_MSGTYPE_CLICK: if sendor == "minbtn": pass elif sendor == "maxbtn": pass elif sendor == "restorebtn": pass elif sendor == "closebtn": pass elif sendor == "btnOpenLog": if os.path.isfile(PyWin32Util.GetExeDirectory() + '\\applog.ini'): #用ctypes会导致程序崩溃 #shell32 = ctypes.windll.LoadLibrary("shell32.dll"); #shell32.ShellExecuteA(None,'open', 'notepad',PyWin32Util.GetExeDirectory() + '\\applog.ini','',1); PyWin32Util.ShellExcute(0, 'open', PyWin32Util.GetExeDirectory() + '\\applog.ini', '', '', 1) else: UICommon.ShowMessageBox(self.GetHWnd(), '错误', '日志文件不存在') elif sendor == "btnClearLog": self.txtDiagnose.SetText('') if os.path.isfile(PyWin32Util.GetExeDirectory() + '\\applog.ini'): os.remove(PyWin32Util.GetExeDirectory() + '\\applog.ini') elif sendor == "btnExcute": t = threading.Thread(target=PyThreadPythonExecute,args=(self,)) t.start() #self.ExecutePython() elif sendor == "OU_home": pass elif sendor == "OU_back": pass elif sendor == "OU_forward": pass elif sendor == "OU_genPwd3": pass elif sendor == "OU_genPwd4": pass elif sendor == "OU_genPwd5": pass elif sendor == "OU_genPwd6": pass elif sendor == "OU_enableProxy": pass elif sendor == "OU_disableProxy": pass # 用户选择事件 if sType == DUI_MSGTYPE_ITEMSELECT: pass
def OnNotify(self, sendor, sType, wParam, lParam): if sType == DUI_MSGTYPE_CLICK: if sendor == "BtnDownloadTooSlow": PyWin32Util.ShellExcute(0, 'open', 'http://www.xiaoniuhui.com/index.php#!/%E5%B0%8F%E5%A6%9E%E4%BC%9A%E8%A3%85%E6%9C%BA', '', '', 1) elif sendor == "BtnWin7" or sendor == "BtnXP": self.OnBtnWin7orBtnXP(sendor, sType, wParam, lParam) elif sendor == "ButtonUIReboot": UICommon.ShowMessageBox(self.GetHWnd(), '准备安装', '重启安装部分未实现,请耐心等待...') elif sendor == "adv1": pass elif sendor == "adv2": pass elif sendor == "adv3": pass elif sendor == "adv4": pass elif sendor == "adv5": pass if sType == DUI_MSGTYPE_ITEMSELECT: pass
def OnNotify(self, sendor, sType, wParam, lParam): if sType == DUI_MSGTYPE_ITEMSELECT: pass if sType == DUI_MSGTYPE_CLICK: if sendor == "BtnClose": log = PyLog() PyTest().Test(log) #execute_dos_cmd('adb kill-server') self.ExitApp() # elif sendor == "btnPyTest": # self.funcTabLayout.SelectItem(0) # #UICommon.ShowMessageBox(self.GetHWnd(), '对话框标题', '你点击了对话框按钮') # infPath = PyWinUtils().SelectFile(self.GetHWnd(), "py(*.py)\0*.py\0") # if len(infPath) > 0: # dirs = infPath.split('\\') # dirname = dirs[-1] # module = dirname.split('.') # PyScript().RunPy(module[0], 'test') elif sendor == "btnStartAnimation": self.AnimationJuhua.StartAnimation() elif sendor == "btnStopAnimation": self.AnimationJuhua.StopAnimation() elif sendor == "btnPyTest": self.funcTabLayout.SelectItem(3) elif sendor == "test_add_btn": UICommon.ShowMessageBox(self.GetHWnd(), '对话框标题', '你点击了test_add_btn') elif sendor == "btnPyDec": self.funcTabLayout.SelectItem(4) self.newbtn = self.PyCreateButton() attrlist = """name="test_add_btn" text="运行时生成" float="true" pos="278,346,0,0" width="175" height="53" textcolor="#00FFFBF0" disabledtextcolor="#FFA7A6AA" font="1" align="center" normalimage="reboot.png" hotimage="file='reboot-hot.png' corner='20,20,20,20'" pushedimage="reboot.png" focusedimage="reboot.png"" """ self.newbtn.ApplyAttributeList(attrlist) self.DecTab.Add(self.newbtn.GetSelf()) elif sendor == "btnEncrypt": self.funcTabLayout.SelectItem(3) self.txtDiagnose.SetText('') solPath = PyWinUtils().SelectFolder(self.GetHWnd(), "请选择解决方案包:", "solutionpath") if len(solPath): # PyWinUtils().SetWaitCursor() # self.EncryptAndPack(solPath) # PyWinUtils().SetArrowCursor() t = threading.Thread(target=PyThreadEncrypt,args=(self,solPath)) t.start() #t.join(1) elif sendor == 'btnExcuteCompile': t = threading.Thread(target=PyThreadExecuteCompile,args=(self,)) t.start() #self.ChkRoot.SetCheck(False) # # elif sendor == 'ButtonRoot': # t = threading.Thread(target=PyThread_root_compileAndSign,args=(self,)) # t.start() # # elif sendor == 'ButtonUIDebug': # self.txtDiagnose.SetText('') # t = threading.Thread(target=PyThread_compile_featureUI_DEBUG,args=(self,)) # t.start() # # elif sendor == 'ButtonUIRelease': # self.txtDiagnose.SetText('') # t = threading.Thread(target=PyThread_compile_featureUI_RELEASE,args=(self,)) # t.start() # # elif sendor == 'ButtonZSDebug': # self.txtDiagnose.SetText('') # t = threading.Thread(target=PyThread_compile_sjzs_DEBUG,args=(self,)) # t.start() # # elif sendor == 'ButtonZSRelease': # self.txtDiagnose.SetText('') # t = threading.Thread(target=PyThread_compile_sjzs_RELEASE,args=(self,)) # t.start() elif sendor == "btnDriverDiagnose": self.funcTabLayout.SelectItem(3) #self.diagnose() t = threading.Thread(target=PyThreaddiagnose,args=(self,)) t.start() elif sendor == 'btnOpenLog': if os.path.isfile(PyWinUtils().GetExeDirectory() + '\\applog.ini'): PyWinUtils().ShellExcute(0, 'open', PyWinUtils().GetExeDirectory() + '\\applog.ini', '', '', 1) else: UICommon.ShowMessageBox(self.GetHWnd(), '错误', '日志文件不存在') #win32api.ShellExecute(0, 'open', 'e:\\applog.ini', None, "", 1) elif sendor == 'btnClearLog': self.txtDiagnose.SetText('') if os.path.isfile(PyWinUtils().GetExeDirectory() + '\\applog.ini'): os.remove(PyWinUtils().GetExeDirectory() + '\\applog.ini') #win32api.ShellExecute(0, 'open', 'e:\\applog.ini', None, "", 1) elif sendor == 'btnDriverInstall': self.funcTabLayout.SelectItem(1) self.txtInstallLog.SetText('') elif sendor == 'btnChooseInf': infPath = PyWinUtils().SelectFile(self.GetHWnd(), "inf(*.inf)\0*.inf\0") if len(infPath) > 0: self.edtRomPath.SetText(infPath) UICommon.ShowMessageBox(self.GetHWnd(), self.edtRomPath.GetText(), '不支持') infpaht = self.edtRomPath.GetText() elif sendor == 'btnDecSolution': msg = self.txtEnc.GetText() UICommon.ShowMessageBox(self.GetHWnd(), '错误', '不支持') elif sendor == 'btnInstallDriver': msg = self.edtRomPath.GetText() UICommon.ShowMessageBox(self.GetHWnd(), '错误', '不支持')
def test(): UICommon.ShowMessageBox(0, '自定义测试', '自定义测试')