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):
|
||||
return self.hardware_checkbox.isChecked()
|
||||
|
||||
def set_port(self, port):
|
||||
self.port_edit.setEditText(port)
|
||||
|
||||
def update_port_combobox(self):
|
||||
self.port_edit.clear()
|
||||
ports = []
|
||||
|
@ -202,7 +202,7 @@ class MainWindow(QtGui.QMainWindow, UiMainWindow):
|
||||
def on_open_action_triggered(self):
|
||||
self.connect_dialog.update_port_combobox()
|
||||
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 not self.device_closed:
|
||||
self.device_closed = True
|
||||
|
Loading…
Reference in New Issue
Block a user