def handle_sel(): global entries global lb sel=appuifw.popup_menu([u'Switch',u'Kill']) if sel==0:#switch appswitch.switch_to_fg(entries[lb.current()][0]) elif sel==1:#kill appswitch.kill_app(entries[lb.current()][0]) display() else: pass #cancel
def zj(cz): li = m.current() for ii in range(0, len(list_2)): if li == ii: if cz == 0: appswitch.switch_to_fg(list_2[ii]) if cz == 1: if A.query(cn("确认关闭吗?\n线程:") + list_2[ii], "query"): try: appswitch.end_app(list_2[ii]) except: appswitch.kill_app(list_2[ii]) page2()
def select(mode='s'): index=a.current() cur=list[index] if mode=='s': appswitch.switch_to_fg(cur) elif mode=='c': appswitch.end_app(cur) if index==0: return self.tasks() else: return self.tasks(index-1) elif mode=='k': appswitch.kill_app(cur) if index==0: return self.tasks() else: return self.tasks(index-1) else: return 1
import appuifw, e32 select_list=[u'Menu: Backup',u'Menu: Restore'] i=appuifw.popup_menu(select_list) if not appuifw.query(u'Confirm\n'+select_list[i],'query'): i=None if i in (0,1): import appswitch dirs=r'E:\Backup\OS\Applications.dat',r'C:\System\Data\Applications.dat' if u'Menu' in appswitch.application_list(0): m = appuifw.popup_menu([u'End',u'Kill'],u'Menu') if m==0: appswitch.end_app(u'Menu') if m==1: appswitch.kill_app(u'Menu') if i==0: e32.file_copy(dirs[0],dirs[1]) if i==1: e32.file_copy(dirs[1],dirs[0]) if i>=0: appuifw.note(u'Done\n'+select_list[i],'conf')