Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
Require adb instance instead of path
Browse files Browse the repository at this point in the history
  • Loading branch information
srevinsaju committed Aug 26, 2020
1 parent 8e6292d commit 6653988
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions guiscrcpy/ux/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from qtpy.QtWidgets import QMainWindow

from guiscrcpy.lib.check import adb
from guiscrcpy.network.network import NetworkManager
from guiscrcpy.platform.platform import System
from guiscrcpy.ux import Ui_NetworkUI
Expand All @@ -35,12 +34,12 @@ class InterfaceNetwork(QMainWindow, Ui_NetworkUI):
Does not work satisfactorily on Windows.
"""

def __init__(self, adb_path=None):
def __init__(self, adb):
QMainWindow.__init__(self)
Ui_NetworkUI.__init__(self)
self.os = System()
self.setupUi(self)
adb.path = adb_path
self.adb = adb
self.nm = NetworkManager()

def init(self):
Expand All @@ -60,7 +59,7 @@ def init(self):
self.tcpip.pressed.connect(self.tcpip_launch)

def tcpip_launch(self):
adb.command(adb.path, '-d tcpip 5555')
self.adb.command('-d tcpip 5555')
self.nm_det.setText(
"Now disconnect your device, and enter the IP address, and connect"
)
Expand Down Expand Up @@ -93,7 +92,7 @@ def connect(self):
"Click refresh")
return

sp = adb.command(adb.path, 'connect {}:5555'.format(ip))
sp = self.adb.command('connect {}:5555'.format(ip))
count = 0
while True:
count += 1
Expand Down

0 comments on commit 6653988

Please sign in to comment.