Example #1
0
 def emulator_call(self, event):
     """ 点击 模拟器 按钮 """
     is_right = utils.is_right_click(event.num)
     if is_right:
         serial = self.serial2
     else:
         serial = self.serial1
     utils.thread_func(self.thread_emulator, args=(serial, ""))
Example #2
0
 def btn_group_call(self, event):
     is_right = utils.is_right_click(event.num)
     op = ''
     if event.widget == self.btn_screen:
         op = OP.SCREEN_SHOT
     elif event.widget == self.btn_install:
         op = OP.INSTALL
     elif event.widget == self.btn_log:
         if is_right:
             op = OP.LOG_CLEAR
             is_right = False
         else:
             op = OP.LOG_FAST
     if op:
         self.process(is_right, op)
Example #3
0
    def btn_click(self, event):
        """点击按钮"""
        w = event.widget
        if utils.is_right_click(event.num):
            # 鼠标右键键
            if w == self.btn_refresh:
                self.show_devices_force()
            elif w == self.btn_apk:
                self.show_apk_info(utils.clipboard_get(), True)
            elif w == self.btn_wifi:
                win_wifi_connect.connect_one()

        else:
            # 鼠标左键
            if w == self.btn_refresh:
                self.show_devices()

            elif w == self.btn_apk:
                self.show_apk_info()

            elif w == self.btn_folder:
                f = setting_atool.last_screen_shot
                s = str(f)

                if os.path.exists(f):
                    utils.open_file(f, True)  # 如果有文件记录 则定位到文件
                else:
                    s = str(setting_atool.output_dir)
                    success = utils.open_dir(s)
                    if not success:
                        utils.showinfo("文件夹不存在,请查看设置")
                utils.clipboard_set(s)  # 将路径拷贝到剪贴板中

            # wifi链接
            elif w == self.btn_wifi:
                if not utils.lift_and_check(self.win_wifi):
                    self.win_wifi = win_wifi_connect.WifiConnect()
            # 遥控器
            elif w == self.btn_remote:
                util_atool.show_remote()
            # 设置
            elif w == self.btn_setting:
                if not utils.lift_and_check(self.win_pref):
                    self.win_pref = win_preferences.Main()
Example #4
0
    def btn_call(self, event):
        """点击按钮"""
        # 鼠标单击
        if not utils.is_right_click(event.num):
            types = [("apk文件", "*.apk")]
            init_dir = ''
            # init_dir = str( Path(init_dir).parent )
            f = filedialog.askopenfilename(filetypes=types,
                                           title='选择文件',
                                           initialdir=init_dir)
            if f:
                self.__show_info(str(f))

        # 鼠标右键点击
        else:
            arr = utils.clipboard_get_files()
            if len(arr):
                f = arr[0]
                self.__show_info(f)
Example #5
0
 def scan_call(event):
     """ 点击 网络发现 按钮 """
     is_right = utils.is_right_click(event.num)
     port = "7555" if is_right else "5555"
     ScanPort(port).search_routers()
Example #6
0
 def btn_call(self, event):
     is_right = utils.is_right_click(event.num)
     self.process(is_right)