changeset 15:d8958cb11043

allow editing the title
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 23 Sep 2014 01:44:24 +0200
parents 07d74b88ac8d
children 6a62de088c00
files RemoteViewer/Connection.py RemoteViewer/ConnectionDialog.py RemoteViewer/ConnectionDialog.ui
diffstat 3 files changed, 29 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/RemoteViewer/Connection.py	Mon Sep 22 06:11:22 2014 +0200
+++ b/RemoteViewer/Connection.py	Tue Sep 23 01:44:24 2014 +0200
@@ -23,6 +23,10 @@
     def __str__(self):
         return 'connection "{}" of type {} to {} with user {} and geometry {}'.format(self.title, self.type,  self.host, self.user, self.geometry)
 
+    def setTitle(self, title):
+        '''This is a slot that is connected to a signal in the GUI'''
+        self.title = title
+
     def setType(self, type):
         '''This is a slot that is connected to a signal in the GUI'''
         self.type = type
@@ -46,6 +50,7 @@
             return self.host
 
     def validate(self):
+        # TODO: implement proper validation
         pass
 
     def toJson(self):
--- a/RemoteViewer/ConnectionDialog.py	Mon Sep 22 06:11:22 2014 +0200
+++ b/RemoteViewer/ConnectionDialog.py	Tue Sep 23 01:44:24 2014 +0200
@@ -20,6 +20,7 @@
         self.ui.type.addItem('vnc')
 
     def __connectConnection(self):
+        self.ui.title.textChanged.connect(self.connection.setTitle)
         self.ui.type.activated[str].connect(self.connection.setType)
         self.ui.hostname.textChanged.connect(self.connection.setHost)
         self.ui.username.textChanged.connect(self.connection.setUser)
--- a/RemoteViewer/ConnectionDialog.ui	Mon Sep 22 06:11:22 2014 +0200
+++ b/RemoteViewer/ConnectionDialog.ui	Tue Sep 23 01:44:24 2014 +0200
@@ -7,14 +7,14 @@
     <x>0</x>
     <y>0</y>
     <width>400</width>
-    <height>181</height>
+    <height>212</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string/>
   </property>
   <layout class="QFormLayout" name="formLayout">
-   <item row="0" column="0">
+   <item row="1" column="0">
     <widget class="QLabel" name="label">
      <property name="text">
       <string>Type:</string>
@@ -24,10 +24,10 @@
      </property>
     </widget>
    </item>
-   <item row="0" column="1">
+   <item row="1" column="1">
     <widget class="QComboBox" name="type"/>
    </item>
-   <item row="1" column="0">
+   <item row="2" column="0">
     <widget class="QLabel" name="label_2">
      <property name="text">
       <string>Host:</string>
@@ -37,10 +37,10 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="1">
+   <item row="2" column="1">
     <widget class="QLineEdit" name="hostname"/>
    </item>
-   <item row="2" column="0">
+   <item row="3" column="0">
     <widget class="QLabel" name="label_3">
      <property name="text">
       <string>User:</string>
@@ -50,7 +50,7 @@
      </property>
     </widget>
    </item>
-   <item row="3" column="0">
+   <item row="4" column="0">
     <widget class="QLabel" name="label_4">
      <property name="text">
       <string>Geometry:</string>
@@ -60,10 +60,10 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="1">
+   <item row="3" column="1">
     <widget class="QLineEdit" name="username"/>
    </item>
-   <item row="5" column="1">
+   <item row="6" column="1">
     <widget class="QDialogButtonBox" name="buttonBox">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
@@ -73,9 +73,22 @@
      </property>
     </widget>
    </item>
-   <item row="3" column="1">
+   <item row="4" column="1">
     <widget class="QLineEdit" name="geometry"/>
    </item>
+   <item row="0" column="0">
+    <widget class="QLabel" name="label_5">
+     <property name="text">
+      <string>Title:</string>
+     </property>
+     <property name="buddy">
+      <cstring>title</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QLineEdit" name="title"/>
+   </item>
   </layout>
  </widget>
  <tabstops>