2 Copyright (C) 2010-2024 Ben Kibbey <bjk@luxsci.net>
4 This file is part of qpwmc.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
23 #include <QStringList>
24 #include <QCommonStyle>
28 #include "pwmdSocketWidget.h"
29 #include "pwmdRemoteHost.h"
30 #include "pwmdFileDialog.h"
32 #include "pwmdAndroidJNI.h"
34 extern PwmdAndroidJNI
*androidJni
;
37 PwmdSocketWidget::PwmdSocketWidget (QWidget
*p
)
42 QSettings
cfg ("qpwmc");
44 QStringList list
= cfg
.value ("localSockets").toStringList ();
45 for (int i
= 0; i
< list
.size(); i
++)
46 ui
.cb_socket
->addItem (list
.at (i
));
48 int size
= cfg
.beginReadArray ("remoteHosts");
49 unsigned features
= pwmd_features ();
51 for (int i
= 0; i
< size
; ++i
)
53 cfg
.setArrayIndex (i
);
54 if (cfg
.value ("name").toString ().isEmpty ())
57 QListWidgetItem
*item
= new QListWidgetItem (ui
.lb_remoteHosts
);
58 PwmdRemoteHost data
= PwmdRemoteHost (cfg
.value ("name").toString ());
59 Qt::ItemFlags flags
= item
->flags ();
61 data
.setType (cfg
.value ("type").toInt ());
62 data
.setHostname (cfg
.value ("hostname").toString ());
63 data
.setPort (cfg
.value ("port").toInt ());
64 data
.setIpProtocol (cfg
.value ("ipProtocol").toInt ());
65 data
.setSocketArgs (cfg
.value ("socketArgs").toStringList ());
66 data
.setTlsVerify (cfg
.value ("tlsVerify").toBool ());
67 data
.setTlsPriority (cfg
.value ("tlsPriority").toString ());
68 data
.setConnectTimeout (cfg
.value ("connectTimeout").toInt ());
69 data
.setSocketTimeout (cfg
.value ("socketTimeout").toInt ());
70 data
.setSshUsername (cfg
.value ("sshUsername").toString ());
71 data
.setSshAgent (cfg
.value ("sshAgent").toBool ());
73 data
.setClientCertificateAlias (cfg
.value ("clientCertificateAlias").toString ());
75 item
->setData (Qt::UserRole
, QVariant::fromValue (data
));
76 item
->setText (data
.name ());
78 if (data
.type () == PWMD_SOCKET_SSH
&& !(features
& PWMD_FEATURE_SSH
))
79 flags
&= ~(Qt::ItemIsSelectable
| Qt::ItemIsEnabled
);
82 else if (data
.type () == PWMD_SOCKET_TLS
83 && !(features
& PWMD_FEATURE_GNUTLS
))
84 flags
&= ~(Qt::ItemIsSelectable
| Qt::ItemIsEnabled
);
87 item
->setFlags (flags
);
92 connect (ui
.cb_socket
, SIGNAL (activated (int)), this,
93 SLOT (slotLocalSocketChanged (int)));
94 connect (ui
.pb_clearLocalSocket
, SIGNAL (clicked()), this,
95 SLOT (slotClearLocalSocket ()));
96 connect (ui
.pb_selectSocket
, SIGNAL (clicked()), this,
97 SLOT (slotSelectSocket ()));
98 connect (ui
.rb_ipany
, SIGNAL (toggled (bool)),
99 SLOT (slotIpVersionToggled (bool)));
100 connect (ui
.rb_ipv4
, SIGNAL (toggled (bool)),
101 SLOT (slotIpVersionToggled (bool)));
102 connect (ui
.rb_ipv6
, SIGNAL (toggled (bool)),
103 SLOT (slotIpVersionToggled (bool)));
104 connect (ui
.ck_remote
, SIGNAL (toggled (bool)),
105 SLOT (slotRemoteToggled (bool)));
106 connect (ui
.ck_agent
, SIGNAL (toggled (bool)),
107 SLOT (slotUseAgentToggled (bool)));
109 connect (ui
.cb_connectionType
, SIGNAL (activated (int)), this,
110 SLOT (slotConnectionTypeChanged (int)));
111 ui
.cb_connectionType
->setCurrentIndex (cfg
.value ("connectionType", 0).
113 connect (ui
.pb_clientCert
, SIGNAL (clicked ()), this,
114 SLOT (slotSelectTlsClientCert ()));
115 connect (ui
.pb_clientKey
, SIGNAL (clicked ()), this,
116 SLOT (slotSelectTlsClientKey ()));
117 connect (ui
.pb_caCert
, SIGNAL (clicked ()), this,
118 SLOT (slotSelectTlsCaCert ()));
119 connect (ui
.pb_newHost
, SIGNAL (clicked ()), this,
120 SLOT (slotNewRemoteHost ()));
121 ui
.pb_newHost
->setIcon (QIcon (":icons/matt-icons_list-add.svg"));
122 connect (ui
.pb_removeHost
, SIGNAL (clicked ()), this,
123 SLOT (slotRemoveRemoteHost ()));
124 ui
.pb_removeHost
->setIcon (QIcon (":icons/matt-icons_list-remove.svg"));
125 connect (ui
.lb_remoteHosts
,
126 SIGNAL (currentItemChanged (QListWidgetItem
*, QListWidgetItem
*)),
127 SLOT (slotRemoteHostItemChanged
128 (QListWidgetItem
*, QListWidgetItem
*)));
129 connect (ui
.le_remoteName
, SIGNAL (textEdited (const QString
&)),
130 SLOT (slotRemoteHostNameChanged (const QString
&)));
132 connect (ui
.pb_identity
, SIGNAL (clicked ()),
133 SLOT (slotChooseIdentityFile ()));
134 connect (ui
.pb_knownhosts
, SIGNAL (clicked ()),
135 SLOT (slotChooseKnownhostsFile ()));
137 if (!ui
.ck_remote
->isChecked ())
138 ui
.gr_hostDetails
->setEnabled (false);
140 if (features
& PWMD_FEATURE_SSH
)
141 ui
.cb_connectionType
->addItem (tr ("SSH"));
144 if (features
& PWMD_FEATURE_GNUTLS
)
146 ui
.cb_connectionType
->addItem (tr ("TLS"));
148 #if !defined (Q_OS_ANDROID) && !defined (__MINGW32__)
149 if (!(features
& PWMD_FEATURE_GNUTLS
) && !(features
& PWMD_FEATURE_SSH
))
150 ui
.ck_remote
->setEnabled (false);
152 ui
.f_uds
->setHidden (true);
153 ui
.ck_remote
->setEnabled (true);
154 ui
.ck_remote
->setChecked (true);
158 QScroller::grabGesture (ui
.scrollArea
, QScroller::TouchGesture
);
160 ui
.cb_socket
->lineEdit()->setPlaceholderText (tr ("Default"));
161 ui
.pb_clearLocalSocket
->setIcon (QIcon (":icons/nicubunu-Broom.svg"));
162 ui
.pb_selectSocket
->setIcon (QIcon (":icons/rodentia-icons_folder-open-blue.svg"));
163 ui
.pb_knownhosts
->setIcon (QIcon (":icons/rodentia-icons_folder-open-blue.svg"));
164 ui
.pb_identity
->setIcon (QIcon (":icons/rodentia-icons_folder-open-blue.svg"));
165 ui
.pb_caCert
->setIcon (QIcon (":icons/rodentia-icons_folder-open-blue.svg"));
166 ui
.pb_clientCert
->setIcon (QIcon (":icons/rodentia-icons_folder-open-blue.svg"));
167 ui
.pb_clientKey
->setIcon (QIcon (":icons/rodentia-icons_folder-open-blue.svg"));
169 ui
.pb_certificateAlias
->setIcon (QIcon (":icons/rodentia-icons_folder-open-blue.svg"));
170 connect (ui
.pb_certificateAlias
, SIGNAL (clicked ()), this,
171 SLOT (slotSelectCertificateAlias ()));
174 ui
.fr_certificateAlias
->setHidden (true);
175 ui
.fr_ssh
->setHidden (true);
176 ui
.fr_tls
->setHidden (true);
179 PwmdSocketWidget::~PwmdSocketWidget ()
186 PwmdSocketWidget::slotSelectCertificateAlias ()
188 androidJni
->selectCertificateAlias (ui
.le_certificateAlias
);
193 PwmdSocketWidget::slotSelectSocket ()
195 PwmdFileDialog
d (this, tr ("Local socket"));
197 d
.setFilter (d
.filter () | QDir::System
);
198 d
.setFileMode (PwmdFileDialog::ExistingFile
);
199 d
.setOption (PwmdFileDialog::ReadOnly
);
201 d
.setWindowState (Qt::WindowFullScreen
);
204 if (!d
.exec () || !d
.selectedFiles ().count ())
207 ui
.cb_socket
->lineEdit ()->setText (d
.selectedFiles ().at (0));
208 ui
.cb_socket
->addItem (d
.selectedFiles ().at (0));
212 PwmdSocketWidget::slotClearLocalSocket ()
214 ui
.cb_socket
->lineEdit ()->setText ("");
218 PwmdSocketWidget::slotLocalSocketChanged (int)
223 PwmdSocketWidget::saveHosts ()
225 QSettings
cfg ("qpwmc");
228 for (int i
= 0; i
< ui
.cb_socket
->count (); i
++)
230 QString s
= ui
.cb_socket
->itemText (i
);
232 for (int l
= 0; l
< list
.size (); l
++)
233 if (list
.at (l
) == s
)
239 cfg
.setValue ("localSockets", list
);
241 cfg
.beginWriteArray ("remoteHosts");
242 QList
< QListWidgetItem
* >items
= ui
.lb_remoteHosts
->findItems ("*", Qt::MatchWildcard
);
244 for (int i
= 0; i
< items
.size (); i
++)
246 QListWidgetItem
*item
= items
.at (i
);
247 PwmdRemoteHost data
= item
->data (Qt::UserRole
).value
< PwmdRemoteHost
> ();
249 cfg
.setArrayIndex (i
);
250 cfg
.setValue ("name", data
.name ());
251 cfg
.setValue ("type", data
.type ());
252 cfg
.setValue ("hostname", data
.hostname ());
253 cfg
.setValue ("port", data
.port ());
254 cfg
.setValue ("ipProtocol", data
.ipProtocol ());
255 cfg
.setValue ("socketArgs", data
.socketArgs ());
256 cfg
.setValue ("tlsVerify", data
.tlsVerify ());
257 cfg
.setValue ("tlsPriority", data
.tlsPriority ());
258 cfg
.setValue ("connectTimeout", data
.connectTimeout ());
259 cfg
.setValue ("socketTimeout", data
.socketTimeout ());
260 cfg
.setValue ("sshUsername", data
.sshUsername ());
261 cfg
.setValue ("sshAgent", data
.sshAgent ());
263 cfg
.setValue ("clientCertificateAlias", data
.clientCertificateAlias ());
271 PwmdSocketWidget::currentHostData (PwmdRemoteHost
&hostData
)
273 if (ui
.ck_remote
->isChecked ())
274 return PwmdRemoteHost::fillRemoteHost (ui
.lb_remoteHosts
->currentItem ()->text (), hostData
);
280 PwmdSocketWidget::slotConnectionTypeChanged (int idx
)
282 unsigned features
= pwmd_features ();
284 if (!(features
& PWMD_FEATURE_GNUTLS
) && !(features
& PWMD_FEATURE_SSH
))
288 QSettings
cfg ("qpwmc");
290 if (idx
== 0 && (features
& PWMD_FEATURE_SSH
))
293 ui
.fr_certificateAlias
->setHidden (true);
295 ui
.fr_tls
->setHidden (true);
297 ui
.fr_ssh
->setHidden (false);
298 ui
.sp_port
->setValue (cfg
.value ("sshPort", 22).toInt ());
303 ui
.fr_certificateAlias
->setHidden (false);
305 ui
.fr_tls
->setHidden (false);
307 ui
.fr_ssh
->setHidden (true);
308 ui
.sp_port
->setValue (cfg
.value ("tlsPort", 6466).toInt ());
313 PwmdSocketWidget::slotIpVersionToggled (bool b
)
317 if (ui
.rb_ipany
->isChecked ())
319 else if (ui
.rb_ipv4
->isChecked ())
321 else if (ui
.rb_ipv6
->isChecked ())
326 PwmdSocketWidget::slotChooseIdentityFile ()
328 PwmdFileDialog
d (this, tr ("SSH identity file"));
330 d
.setFileMode (PwmdFileDialog::ExistingFile
);
331 d
.setOption (PwmdFileDialog::ReadOnly
);
333 d
.setWindowState (Qt::WindowFullScreen
);
336 if (!d
.exec () || !d
.selectedFiles ().count ())
338 ui
.le_identity
->setText (d
.selectedFiles ().at (0));
342 PwmdSocketWidget::slotChooseKnownhostsFile ()
344 PwmdFileDialog
d (this, tr ("SSH knownhosts file"),
348 QDir::home ().path ()
352 d
.setFileMode (PwmdFileDialog::ExistingFile
);
353 d
.setOption (PwmdFileDialog::ReadOnly
);
355 d
.setWindowState (Qt::WindowFullScreen
);
358 if (!d
.exec () || !d
.selectedFiles ().count ())
360 ui
.le_knownhosts
->setText (d
.selectedFiles ().at (0));
364 PwmdSocketWidget::toggleRemote (bool b
)
366 QListWidgetItem
*item
= ui
.lb_remoteHosts
->currentItem ();
370 flags
= item
->flags ();
372 ui
.cb_socket
->setEnabled (!b
);
373 ui
.pb_clearLocalSocket
->setEnabled (!b
);
374 ui
.pb_selectSocket
->setEnabled (!b
);
375 ui
.ck_agent
->setEnabled (b
&& getenv ("SSH_AUTH_SOCK") != nullptr);
376 slotConnectionTypeChanged (ui
.cb_connectionType
->currentIndex ());
377 ui
.gr_hostDetails
->setEnabled (b
? item
&& (flags
& Qt::ItemIsEnabled
)
381 slotUseAgentToggled (ui
.ck_agent
->isEnabled ()
382 && ui
.ck_agent
->isChecked ());
386 PwmdSocketWidget::slotRemoteToggled (bool b
)
388 #if defined(Q_OS_ANDROID) || defined (__MINGW32__)
390 ui
.ck_remote
->setChecked (true);
398 PwmdSocketWidget::slotUseAgentToggled (bool b
)
400 ui
.le_identity
->setEnabled (!b
);
401 ui
.pb_identity
->setEnabled (!b
);
406 PwmdSocketWidget::slotSelectTlsClientCert ()
408 PwmdFileDialog
d (this, tr ("TLS client certificate file"),
412 QDir::home ().path ()
416 d
.setFileMode (PwmdFileDialog::ExistingFile
);
417 d
.setOption (PwmdFileDialog::ReadOnly
);
419 d
.setWindowState (Qt::WindowFullScreen
);
422 if (!d
.exec () || !d
.selectedFiles ().count ())
424 ui
.le_clientCert
->setText (d
.selectedFiles ().at (0));
428 PwmdSocketWidget::slotSelectTlsClientKey ()
430 PwmdFileDialog
d (this, tr ("TLS client certificate key file"),
434 QDir::home ().path ()
438 d
.setFileMode (PwmdFileDialog::ExistingFile
);
439 d
.setOption (PwmdFileDialog::ReadOnly
);
441 d
.setWindowState (Qt::WindowFullScreen
);
444 if (!d
.exec () || !d
.selectedFiles ().count ())
446 ui
.le_clientKey
->setText (d
.selectedFiles ().at (0));
450 PwmdSocketWidget::slotSelectTlsCaCert ()
452 PwmdFileDialog
d (this, tr ("TLS CA certificate file"),
456 QDir::home ().path ()
460 d
.setFileMode (PwmdFileDialog::ExistingFile
);
461 d
.setOption (PwmdFileDialog::ReadOnly
);
463 d
.setWindowState (Qt::WindowFullScreen
);
466 if (!d
.exec () || !d
.selectedFiles ().count ())
468 ui
.le_caCert
->setText (d
.selectedFiles ().at (0));
472 PwmdSocketWidget::initNewRemoteHost ()
474 ui
.le_remoteName
->setText ("");
475 ui
.cb_connectionType
->setCurrentIndex (0);
476 slotConnectionTypeChanged (0);
477 ui
.le_hostname
->setText ("");
478 ui
.rb_ipany
->setChecked (true);
479 ui
.sp_port
->setValue (22);
480 ui
.le_identity
->setText ("");
481 ui
.ck_agent
->setChecked (ui
.ck_agent
->isEnabled ());
482 ui
.le_knownhosts
->setText ("");
483 ui
.sp_connectTimeout
->setValue (120);
484 ui
.sp_socketTimeout
->setValue (300);
485 ui
.le_clientCert
->setText ("");
486 ui
.le_clientKey
->setText ("");
487 ui
.le_caCert
->setText ("");
488 ui
.le_tlsServerFingerprint
->setText ("");
489 ui
.ck_tlsVerify
->setChecked (true);
490 ui
.le_tlsPriority
->setText ("");
492 ui
.le_username
->setText (getlogin () ? getlogin () : "");
497 PwmdSocketWidget::updateRemoteHost ()
499 updateRemoteHost (ui
.lb_remoteHosts
->currentItem ());
503 PwmdSocketWidget::updateRemoteHost (QListWidgetItem
* item
)
508 PwmdRemoteHost data
= item
->data (Qt::UserRole
).value
< PwmdRemoteHost
> ();
509 data
.setName (ui
.le_remoteName
->text ());
511 if (ui
.cb_connectionType
->currentText () == "SSH")
512 data
.setType (PWMD_SOCKET_SSH
);
515 data
.setType (PWMD_SOCKET_USER
);
517 data
.setType (PWMD_SOCKET_TLS
);
520 data
.setHostname (ui
.le_hostname
->text ());
521 data
.setPort (ui
.sp_port
->value ());
523 if (ui
.rb_ipany
->isChecked ())
524 data
.setIpProtocol (0);
525 else if (ui
.rb_ipv4
->isChecked ())
526 data
.setIpProtocol (1);
527 else if (ui
.rb_ipv6
->isChecked ())
528 data
.setIpProtocol (2);
531 if (data
.type () == PWMD_SOCKET_SSH
)
533 list
.append (ui
.le_identity
->text ());
534 list
.append (ui
.le_knownhosts
->text ());
538 list
.append (ui
.le_clientCert
->text ());
539 list
.append (ui
.le_clientKey
->text ());
540 list
.append (ui
.le_caCert
->text ());
541 list
.append (ui
.le_tlsServerFingerprint
->text ());
544 data
.setSocketArgs (list
);
545 data
.setTlsVerify (ui
.ck_tlsVerify
->isChecked ());
546 data
.setTlsPriority (ui
.le_tlsPriority
->text ());
547 data
.setConnectTimeout (ui
.sp_connectTimeout
->value ());
548 data
.setSocketTimeout (ui
.sp_socketTimeout
->value ());
549 data
.setSshUsername (ui
.le_username
->text ());
550 data
.setSshAgent (ui
.ck_agent
->isChecked ());
552 data
.setClientCertificateAlias (ui
.le_certificateAlias
->text ());
554 item
->setData (Qt::UserRole
, QVariant::fromValue (data
));
558 PwmdSocketWidget::slotNewRemoteHost ()
560 QListWidgetItem
*item
= ui
.lb_remoteHosts
->currentItem ();
562 updateRemoteHost (item
);
563 ui
.lb_remoteHosts
->addItem (new QListWidgetItem (tr ("New host")));
564 ui
.lb_remoteHosts
->setCurrentItem (ui
.lb_remoteHosts
->item (ui
.lb_remoteHosts
->count () - 1));
565 ui
.le_remoteName
->setFocus (Qt::MouseFocusReason
);
566 initNewRemoteHost ();
567 ui
.gr_hostDetails
->setEnabled (true);
571 PwmdSocketWidget::slotRemoveRemoteHost ()
573 if (!ui
.lb_remoteHosts
->currentItem ())
576 QListWidgetItem
*item
=
577 ui
.lb_remoteHosts
->takeItem (ui
.lb_remoteHosts
->row (ui
.lb_remoteHosts
->currentItem ()));
582 PwmdSocketWidget::slotRemoteHostItemChanged (QListWidgetItem
* item
,
583 QListWidgetItem
* old
)
586 if (!(pwmd_features () & PWMD_FEATURE_SSH
)
587 && !(pwmd_features () & PWMD_FEATURE_GNUTLS
))
589 ui
.ck_remote
->setChecked (false);
594 updateRemoteHost (old
);
597 ui
.gr_hostDetails
->setEnabled (false);
598 initNewRemoteHost ();
602 PwmdRemoteHost data
= item
->data (Qt::UserRole
).value
< PwmdRemoteHost
> ();
603 ui
.le_remoteName
->setText (data
.name ());
605 if (!data
.type () || data
.type () == PWMD_SOCKET_SSH
)
607 ui
.cb_connectionType
->setCurrentIndex (0);
608 ui
.fr_tls
->setHidden (true);
610 ui
.fr_certificateAlias
->setHidden (true);
611 ui
.fr_socketProtocol
->setHidden(false);
613 ui
.fr_ssh
->setHidden (false);
615 else if (data
.type () == PWMD_SOCKET_TLS
|| data
.type () == PWMD_SOCKET_USER
)
617 if (!(pwmd_features () & PWMD_FEATURE_SSH
))
618 ui
.cb_connectionType
->setCurrentIndex (0);
620 ui
.cb_connectionType
->setCurrentIndex (1);
623 ui
.fr_certificateAlias
->setHidden (false);
624 ui
.fr_socketProtocol
->setHidden(true);
626 ui
.fr_tls
->setHidden (false);
628 ui
.fr_ssh
->setHidden (true);
631 ui
.le_hostname
->setText (data
.hostname ());
632 switch (data
.ipProtocol ())
635 ui
.rb_ipany
->setChecked (true);
638 ui
.rb_ipv4
->setChecked (true);
641 ui
.rb_ipv6
->setChecked (true);
645 ui
.sp_port
->setValue (data
.port ());
647 /* Fill the argument list. 6 is the maximum to pass to pwmd_connect() but
648 * any amount more than the known 5 used can be appended. */
649 QStringList args
= data
.socketArgs ();
650 for (int n
= args
.count () - 1; n
< 6; n
++)
651 args
.append (QString (""));
653 if (data
.type () == PWMD_SOCKET_SSH
)
655 ui
.le_identity
->setText (args
.at (0));
656 ui
.le_knownhosts
->setText (args
.at (1));
660 ui
.le_clientCert
->setText (args
.at (0));
661 ui
.le_clientKey
->setText (args
.at (1));
662 ui
.le_caCert
->setText (args
.at (2));
663 ui
.le_tlsServerFingerprint
->setText (args
.at (3));
666 ui
.le_username
->setText (data
.sshUsername ());
667 ui
.sp_connectTimeout
->setValue (data
.connectTimeout ());
668 ui
.sp_socketTimeout
->setValue (data
.socketTimeout ());
669 ui
.ck_tlsVerify
->setChecked (data
.tlsVerify ());
670 ui
.le_tlsPriority
->setText (data
.tlsPriority ());
671 ui
.ck_agent
->setChecked (data
.sshAgent ());
673 ui
.le_certificateAlias
->setText (data
.clientCertificateAlias ());
675 ui
.gr_hostDetails
->setEnabled (true);
679 PwmdSocketWidget::slotRemoteHostNameChanged (const QString
& str
)
681 QListWidgetItem
*item
= ui
.lb_remoteHosts
->currentItem ();
685 ui
.gr_hostDetails
->setEnabled (false);
689 PwmdRemoteHost data
= item
->data (Qt::UserRole
).value
< PwmdRemoteHost
> ();
691 item
->setData (Qt::UserRole
, QVariant::fromValue (data
));
696 PwmdSocketWidget::socket ()
698 if (ui
.ck_remote
->isChecked ())
699 return ui
.lb_remoteHosts
->currentItem ()->text ();
701 return ui
.cb_socket
->lineEdit()->text ();
705 PwmdSocketWidget::setSelected (const QString
&sock
)
707 foreach (QListWidgetItem
*item
, ui
.lb_remoteHosts
->findItems ("*", Qt::MatchWildcard
))
709 if (item
->text () == sock
)
711 ui
.ck_remote
->setChecked (true);
712 ui
.lb_remoteHosts
->setCurrentItem (item
);
713 if (!(item
->flags () & Qt::ItemIsEnabled
))
714 ui
.gr_hostDetails
->setEnabled (false);
719 ui
.cb_socket
->lineEdit()->setText (sock
);