changeset 6:369bc16e7441

do not add a connection if cancel was pressed on the dialog
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sat, 20 Sep 2014 05:25:30 +0200
parents f48a0a320815
children 8e2271761d28
files RemoteViewer/RemoteViewer.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/RemoteViewer/RemoteViewer.py	Sat Sep 20 05:18:05 2014 +0200
+++ b/RemoteViewer/RemoteViewer.py	Sat Sep 20 05:25:30 2014 +0200
@@ -27,9 +27,10 @@
         # TODO: make the window title a ctor argument
         dialog = ConnectionDialog()
         dialog.setWindowTitle('New Connection')
-        dialog.exec_()
-        connection = dialog.connection
-        self.settings.addConnection(connection)
+        success = dialog.exec_()
+        if success:
+            connection = dialog.connection
+            self.settings.addConnection(connection)
 
     @ExceptionSafeSlot('QModelIndex')
     def openConnection(self, index):