changeset 7:8e2271761d28

pass the window title as argument to ConnectionDialog
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sat, 20 Sep 2014 05:27:44 +0200
parents 369bc16e7441
children fc866be7843c
files RemoteViewer/ConnectionDialog.py RemoteViewer/RemoteViewer.py
diffstat 2 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/RemoteViewer/ConnectionDialog.py	Sat Sep 20 05:25:30 2014 +0200
+++ b/RemoteViewer/ConnectionDialog.py	Sat Sep 20 05:27:44 2014 +0200
@@ -3,18 +3,19 @@
 from .Ui_ConnectionDialog import Ui_ConnectionDialog
 
 class ConnectionDialog(QDialog):
-    def __init__(self):
+    def __init__(self,  windowTitle=''):
         super(QDialog, self).__init__()
         self.__initDefaultValues()
-        self.__initUi()
+        self.__initUi(windowTitle)
         self.__connectConnection()
 
     def __initDefaultValues(self):
         self.connection = Connection()
 
-    def __initUi(self):
+    def __initUi(self, windowTitle):
         self.ui = Ui_ConnectionDialog()
         self.ui.setupUi(self)
+        self.setWindowTitle(windowTitle)
         self.ui.type.addItem('rdp')
         self.ui.type.addItem('vnc')
 
--- a/RemoteViewer/RemoteViewer.py	Sat Sep 20 05:25:30 2014 +0200
+++ b/RemoteViewer/RemoteViewer.py	Sat Sep 20 05:27:44 2014 +0200
@@ -24,9 +24,7 @@
 
     @ExceptionSafeSlot()
     def newConnection(self):
-        # TODO: make the window title a ctor argument
-        dialog = ConnectionDialog()
-        dialog.setWindowTitle('New Connection')
+        dialog = ConnectionDialog('New Connection')
         success = dialog.exec_()
         if success:
             connection = dialog.connection