Add a set_port method to ConnectDialog and use that instead of accessing the port_edit widget directly.
This commit is contained in:
parent
99e00ab612
commit
ec3009950b
@ -209,6 +209,9 @@ class ConnectDialog(QtGui.QDialog, UiConnectDialog):
|
|||||||
def get_hardware_handshake(self):
|
def get_hardware_handshake(self):
|
||||||
return self.hardware_checkbox.isChecked()
|
return self.hardware_checkbox.isChecked()
|
||||||
|
|
||||||
|
def set_port(self, port):
|
||||||
|
self.port_edit.setEditText(port)
|
||||||
|
|
||||||
def update_port_combobox(self):
|
def update_port_combobox(self):
|
||||||
self.port_edit.clear()
|
self.port_edit.clear()
|
||||||
ports = []
|
ports = []
|
||||||
|
@ -202,7 +202,7 @@ class MainWindow(QtGui.QMainWindow, UiMainWindow):
|
|||||||
def on_open_action_triggered(self):
|
def on_open_action_triggered(self):
|
||||||
self.connect_dialog.update_port_combobox()
|
self.connect_dialog.update_port_combobox()
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
self.connect_dialog.port_edit.setEditText(unicode(settings.value(u'previous-port', u'').toString()))
|
self.connect_dialog.set_port(unicode(settings.value(u'previous-port', u'').toString()))
|
||||||
if self.connect_dialog.exec_() == QtGui.QDialog.Accepted:
|
if self.connect_dialog.exec_() == QtGui.QDialog.Accepted:
|
||||||
if not self.device_closed:
|
if not self.device_closed:
|
||||||
self.device_closed = True
|
self.device_closed = True
|
||||||
|
Loading…
Reference in New Issue
Block a user