Store the last used port and use it as default.
This commit is contained in:
parent
3804d38040
commit
12fb6c3932
@ -201,11 +201,14 @@ 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()))
|
||||
if self.connect_dialog.exec_() == QtGui.QDialog.Accepted:
|
||||
if not self.device_closed:
|
||||
self.device_closed = True
|
||||
self.device.close()
|
||||
try:
|
||||
settings.setValue(u'previous-port', self.connect_dialog.get_port())
|
||||
self.device = Serial(
|
||||
port=self.connect_dialog.get_port(),
|
||||
baudrate=self.connect_dialog.get_baud(),
|
||||
|
Loading…
Reference in New Issue
Block a user