src/eric7/RemoteServerInterface/EricServerConnectionDialog.py

branch
eric7
changeset 11033
6b197c3389f7
parent 10785
82d8a5606135
child 11090
f5f5f5803935
equal deleted inserted replaced
11032:84a66daa5e34 11033:6b197c3389f7
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
140 @type str 146 @type str
141 @param port port number 147 @param port port number
142 @type int 148 @type int
143 @param timeout timeout value in seconds 149 @param timeout timeout value in seconds
144 @type int 150 @type int
151 @param clientId client ID string (defaults to "")
152 @type str (optional)
145 """ 153 """
146 # adjust some values 154 # adjust some values
147 if not bool(port): 155 if not bool(port):
148 port = self.portSpinBox.minimum() 156 port = self.portSpinBox.minimum()
149 if not bool(timeout): 157 if not bool(timeout):
153 161
154 self.nameEdit.setText(name) 162 self.nameEdit.setText(name)
155 self.hostnameEdit.setText(hostname) 163 self.hostnameEdit.setText(hostname)
156 self.portSpinBox.setValue(port) 164 self.portSpinBox.setValue(port)
157 self.timeoutSpinBox.setValue(timeout) 165 self.timeoutSpinBox.setValue(timeout)
166 self.clientIdEdit.setText(clientId)

eric ide

mercurial