Add help text for attribute S/R.
[qpwmc.git] / pwmdSocketWidget.h
blob3442ee4681e31e83f25f8697a93f2319b848d6cd
1 /*
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
19 USA
21 #ifndef PWMDSOCKETWIDGET_H
22 #define PWMDSOCKETWIDGET_H
24 #include <QFrame>
25 #include <QListWidgetItem>
26 #include "ui_pwmdSocketWidget.h"
27 #include "pwmdRemoteHost.h"
29 class PwmdSocketWidget : public QFrame
31 Q_OBJECT
32 public:
33 PwmdSocketWidget (QWidget * = 0);
34 ~PwmdSocketWidget ();
35 Ui::PwmdSocketWidget ui;
37 // Return the socket string needed by pwmd_connect().
38 QString socket ();
40 // Set the current QListWidgetItem host to name.
41 void setSelected (const QString &name);
43 // Used in PwmdSocketDialog to update changes during QDialog::accept().
44 void updateRemoteHost ();
46 /* Write the remote hosts to disk. May be needed if the widget is not part
47 * of a QDialog. */
48 void saveHosts ();
50 /* Returns true and fills hostData with the currently selected hostname.
51 * Returns false if a local socket or no remote host is selected. */
52 bool currentHostData (PwmdRemoteHost &hostData);
54 private slots:
55 void slotRemoteToggled (bool);
56 void slotUseAgentToggled (bool);
57 void slotChooseIdentityFile ();
58 void slotChooseKnownhostsFile ();
59 void slotIpVersionToggled (bool);
60 void slotSelectTlsClientCert ();
61 void slotSelectTlsClientKey ();
62 void slotSelectTlsCaCert ();
63 void slotNewRemoteHost ();
64 void slotRemoveRemoteHost ();
65 void slotRemoteHostItemChanged (QListWidgetItem *, QListWidgetItem *);
66 void slotRemoteHostNameChanged (const QString &);
67 void slotConnectionTypeChanged (int);
68 void slotLocalSocketChanged (int);
69 void slotClearLocalSocket ();
70 void slotSelectSocket ();
71 #ifdef Q_OS_ANDROID
72 void slotSelectCertificateAlias ();
73 #endif
75 private:
76 void initNewRemoteHost ();
77 void updateRemoteHost (QListWidgetItem *);
78 void toggleRemote (bool);
80 int ipVersion;
83 #endif