96 |
96 |
97 def getData(self): |
97 def getData(self): |
98 """ |
98 """ |
99 Public method to get the entered data. |
99 Public method to get the entered data. |
100 |
100 |
101 @return tuple containing the entered host name or IP address, the port number |
101 @return tuple containing the entered host name or IP address, the port number, |
102 and the timeout (in seconds) |
102 the timeout in seconds and the client ID string |
103 @rtype tuple of (str, int, int) |
103 @rtype tuple of (str, int, int, str) |
104 """ |
104 """ |
105 port = self.portSpinBox.value() |
105 port = self.portSpinBox.value() |
106 if port == self.portSpinBox.minimum(): |
106 if port == self.portSpinBox.minimum(): |
107 port = None |
107 port = None |
108 |
108 |
109 timeout = self.timeoutSpinBox.value() |
109 timeout = self.timeoutSpinBox.value() |
110 if timeout == self.timeoutSpinBox.minimum(): |
110 if timeout == self.timeoutSpinBox.minimum(): |
111 timeout = None |
111 timeout = None |
112 |
112 |
113 return self.hostnameEdit.text(), port, timeout |
113 return self.hostnameEdit.text(), port, timeout, self.clientIdEdit.text() |
114 |
114 |
115 def getProfileData(self): |
115 def getProfileData(self): |
116 """ |
116 """ |
117 Public method to get the entered data for connection profile mode. |
117 Public method to get the entered data for connection profile mode. |
118 |
118 |
119 @return tuple containing the profile name, host name or IP address, |
119 @return tuple containing the profile name, host name or IP address, |
120 the port number and the timeout (in seconds) |
120 the port number, the timeout in seconds and the client ID string |
121 @rtype tuple of (str, str, int, int) |
121 @rtype tuple of (str, str, int, int, str) |
122 """ |
122 """ |
123 port = self.portSpinBox.value() |
123 port = self.portSpinBox.value() |
124 if port == self.portSpinBox.minimum(): |
124 if port == self.portSpinBox.minimum(): |
125 port = 0 |
125 port = 0 |
126 |
126 |
127 timeout = self.timeoutSpinBox.value() |
127 timeout = self.timeoutSpinBox.value() |
128 if timeout == self.timeoutSpinBox.minimum(): |
128 if timeout == self.timeoutSpinBox.minimum(): |
129 timeout = 0 |
129 timeout = 0 |
130 |
130 |
131 return self.nameEdit.text(), self.hostnameEdit.text(), port, timeout |
131 return ( |
|
132 self.nameEdit.text(), |
|
133 self.hostnameEdit.text(), |
|
134 port, |
|
135 timeout, |
|
136 self.clientIdEdit.text(), |
|
137 ) |
132 |
138 |
133 def setProfileData(self, name, hostname, port, timeout): |
139 def setProfileData(self, name, hostname, port, timeout, clientId=""): |
134 """ |
140 """ |
135 Public method to set the connection profile data to be edited. |
141 Public method to set the connection profile data to be edited. |
136 |
142 |
137 @param name profile name |
143 @param name profile name |
138 @type str |
144 @type str |