Add help text for attribute S/R.
[qpwmc.git] / pwmdClientDialog.h
blobf8c0f2b17da245531781349def8c362a67bbedc0
1 /*
2 Copyright (C) 2015-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 PWMDCLIENTDIALOG_H
22 #define PWMDCLIENTDIALOG_H
24 #include <QDialog>
25 #include <QTimer>
26 #include <QColor>
27 #include "pwmd.h"
28 #include "pwmdClientInfo.h"
29 #include "ui_pwmdClientDialog.h"
31 class PwmdMainWindow;
32 class PwmdClientDialog : public QDialog
34 Q_OBJECT
35 public:
36 PwmdClientDialog (Pwmd *, const QStringList &, const QString &,
37 PwmdMainWindow *);
38 ~PwmdClientDialog ();
39 void refreshClientList();
41 typedef enum {
42 Name, Time, File, Lock, State, Host, Uid, MaxFields
43 } Field;
45 private slots:
46 void slotKillClient ();
47 void slotRefreshClientList ();
48 void slotClientItemChanged (QTreeWidgetItem *, QTreeWidgetItem *);
49 void slotCommandResult (PwmdCommandQueueItem *item,
50 QString result, gpg_error_t rc, bool queued);
51 void slotStatusMessage (QString line, void *data);
52 void slotConnectionStateChanged (Pwmd::ConnectionState s);
53 void slotRemoveStaleClients ();
54 void slotBusy (int, bool);
55 void slotMainClientLockStateChanged (bool);
57 private:
58 QString clientState (unsigned);
59 void clearClientList (bool stale = false);
60 QTreeWidgetItem *buildClientStateItem (const QString &,
61 QTreeWidgetItem * = 0);
62 void refreshClientListFinalize (const QString &);
63 void disable (bool = true);
64 QList <QTreeWidgetItem *> staleList;
65 void setClientState (unsigned);
66 void updateStateForClient (const QString &);
67 void setLocked (bool);
69 Ui::PwmdClientDialog ui;
70 QStringList invokingUser;
71 QString connectedUser;
72 Pwmd *pwm;
73 QTimer *staleTimer;
74 QColor staleColor;
77 Q_DECLARE_METATYPE (ClientInfo *);
79 #endif