This commit is contained in:
Gerrit Vermeulen 2013-12-10 16:21:29 +02:00
commit 99e00ab612

View File

@ -201,11 +201,14 @@ 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()
self.connect_dialog.port_edit.setEditText(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
self.device.close() self.device.close()
try: try:
settings.setValue(u'previous-port', self.connect_dialog.get_port())
self.device = Serial( self.device = Serial(
port=self.connect_dialog.get_port(), port=self.connect_dialog.get_port(),
baudrate=self.connect_dialog.get_baud(), baudrate=self.connect_dialog.get_baud(),