Changeset View
Changeset View
Standalone View
Standalone View
ksmserver/policykit-agent/AuthDialog.h
- This file was added.
1 | /* This file is part of the KDE project | ||||
---|---|---|---|---|---|
2 | Copyright (C) 2007-2008 Gökçen Eraslan <gokcen@pardus.org.tr> | ||||
3 | Copyright (C) 2008 Daniel Nicoletti <dantti85-pk@yahoo.com.br> | ||||
4 | Copyright (C) 2010 Dario Freddi <drf@kde.org> | ||||
5 | | ||||
6 | This program is free software; you can redistribute it and/or | ||||
7 | modify it under the terms of the GNU General Public | ||||
8 | License as published by the Free Software Foundation; either | ||||
9 | version 2 of the License, or (at your option) any later version. | ||||
10 | | ||||
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 | Library General Public License for more details. | ||||
15 | | ||||
16 | You should have received a copy of the GNU Library General Public License | ||||
17 | along with this library; see the file COPYING.LIB. If not, write to | ||||
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
19 | Boston, MA 02110-1301, USA. | ||||
20 | | ||||
21 | */ | ||||
22 | | ||||
23 | #ifndef AUTHDIALOG_H | ||||
24 | #define AUTHDIALOG_H | ||||
25 | | ||||
26 | #include <QDialog> | ||||
27 | #include <QDialogButtonBox> | ||||
28 | | ||||
29 | #include <PolkitQt1/Identity> | ||||
30 | #include <PolkitQt1/ActionDescription> | ||||
31 | | ||||
32 | #include "ui_AuthDialog.h" | ||||
33 | #include "ui_authdetails.h" | ||||
34 | | ||||
35 | namespace PolkitQt1 | ||||
36 | { | ||||
37 | class Details; | ||||
38 | } | ||||
39 | | ||||
40 | class AuthDialog : public QDialog, private Ui::AuthDialog | ||||
41 | { | ||||
42 | Q_OBJECT | ||||
43 | public: | ||||
44 | AuthDialog(const QString &actionId, | ||||
45 | const QString &message, | ||||
46 | const QString &iconName, | ||||
47 | const PolkitQt1::Details &details, | ||||
48 | const PolkitQt1::Identity::List &identities, | ||||
49 | WId parent); | ||||
50 | ~AuthDialog(); | ||||
51 | | ||||
52 | void setRequest(const QString &request, bool requiresAdmin); | ||||
53 | void setOptions(); | ||||
54 | QString password() const; | ||||
55 | void authenticationFailure(); | ||||
56 | | ||||
57 | PolkitQt1::Identity adminUserSelected() const; | ||||
58 | | ||||
59 | PolkitQt1::ActionDescription m_actionDescription; | ||||
60 | | ||||
61 | signals: | ||||
62 | void adminUserSelected(PolkitQt1::Identity); | ||||
63 | void okClicked(); | ||||
64 | | ||||
65 | public slots: | ||||
66 | virtual void accept() Q_DECL_OVERRIDE; | ||||
67 | | ||||
68 | private slots: | ||||
69 | void on_userCB_currentIndexChanged(int index); | ||||
70 | | ||||
71 | private: | ||||
72 | QString m_appname; | ||||
73 | QString m_message; | ||||
74 | | ||||
75 | void createUserCB(const PolkitQt1::Identity::List &identities); | ||||
76 | }; | ||||
77 | | ||||
78 | class AuthDetails : public QWidget, private Ui::AuthDetails | ||||
79 | { | ||||
80 | Q_OBJECT | ||||
81 | public: | ||||
82 | AuthDetails(const PolkitQt1::Details &details, | ||||
83 | const PolkitQt1::ActionDescription &actionDescription, | ||||
84 | const QString &appname, | ||||
85 | QWidget *parent); | ||||
86 | | ||||
87 | private slots: | ||||
88 | void openUrl(const QString&); | ||||
89 | void openAction(const QString&); | ||||
90 | }; | ||||
91 | | ||||
92 | #endif // AUTHDIALOG_H |