def press_bar_handle(key): if key == 'TB_EXPAND': tree_inst.expand_trees() elif key in ['TB_ABOUT', "MENU_ABOUT"]: TopAbout() elif key in ['TB_SCREEN', 'MENU_SCREEN']: ScreenShot() elif key in ['TB_HELP', 'MENU_HELP']: pdf = 'SystemController.pdf' if not Common.is_file(pdf): WidgetTip.error('{}不存在,请确认!'.format(pdf)) return Common.create_thread(lambda: Common.system_open(pdf)) elif key in ['MENU_SET', 'TB_SET']: GuiSettings.pack() elif key == 'MENU_EXIT': app_gate.close() elif key == 'TB_LAST': tree_inst.last() elif key == 'TB_NEXT': tree_inst.next() elif key in ["MENU_WHITE", "MENU_BLACK"]: WidgetTip.info("敬请期待 !") else: # 根据界面 image 值即可进入对应界面 # tree_inst.selection(key)
def login_result(self, data): index, state, info = data if index == 'ALL': # 最后结果 self.top_prog.destroy() WidgetTip.info(info) if state: self.destroy() app_gate.switch_main() else: # 单个登录结果 instance = self.sub_login[index] self.top_prog.update(info) instance.set_status(Global.G_TIP_FG_COLOR[state])
def confirm(cls): cls.top.wm_attributes('-topmost', 0) data = {} data['tool_alias'] = cls.tool_alias.get() data['tool_version'] = cls.tool_version.get() data['log_level'] = cls.log_level.get() data['login_count_limit'] = int(cls.count_limit.get()) data['retry_times'] = int(cls.retry_times.get()) data['refresh_json_period'] = int(cls.refresh_json.get()) data['passwords'] = {} data['passwords']['username'] = cls.user_name.get() data['passwords']['userpassword'] = cls.user_password.get() data['passwords']['rootpassword'] = cls.root_password.get() data['server_home'] = cls.server_home.get() data['keepalive_period'] = int(cls.keepalive_period.get()) view_gate.update_settings_data.set_data(data) WidgetTip.info('设置成功') cls.cancel()
def add_sublogin(): if len(self.sub_login) >= self.count_limit: WidgetTip.info('最多支持%s个登录' % self.count_limit) return SubLogin(entry_fm, preference_ip, self.default_pwd, self.sub_login)