File indexing completed on 2024-09-15 10:40:31
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2007-2008 Gökçen Eraslan <gokcen@pardus.org.tr> 0003 SPDX-FileCopyrightText: 2008 Daniel Nicoletti <dantti85-pk@yahoo.com.br> 0004 SPDX-FileCopyrightText: 2010 Dario Freddi <drf@kde.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef AUTHDIALOG_H 0010 #define AUTHDIALOG_H 0011 0012 #include <QDialog> 0013 0014 #include <PolkitQt1/ActionDescription> 0015 #include <PolkitQt1/Identity> 0016 0017 #include "ui_AuthDialog.h" 0018 #include "ui_authdetails.h" 0019 0020 namespace PolkitQt1 0021 { 0022 class Details; 0023 } 0024 0025 class AuthDialog : public QDialog, private Ui::AuthDialog 0026 { 0027 Q_OBJECT 0028 public: 0029 AuthDialog(const QString &actionId, 0030 const QString &message, 0031 const QString &iconName, 0032 const PolkitQt1::Details &details, 0033 const PolkitQt1::Identity::List &identities, 0034 WId parent); 0035 ~AuthDialog() override; 0036 0037 void setRequest(const QString &request, bool requiresAdmin); 0038 void setOptions(); 0039 QString password() const; 0040 void showError(const QString &message); 0041 void showInfo(const QString &message); 0042 void authenticationFailure(); 0043 0044 PolkitQt1::Identity adminUserSelected() const; 0045 0046 PolkitQt1::ActionDescription m_actionDescription; 0047 0048 Q_SIGNALS: 0049 void adminUserSelected(PolkitQt1::Identity); 0050 void okClicked(); 0051 0052 public Q_SLOTS: 0053 void accept() override; 0054 0055 private Q_SLOTS: 0056 void checkSelectedUser(); 0057 0058 private: 0059 QString m_message; 0060 0061 void createUserCB(const PolkitQt1::Identity::List &identities); 0062 }; 0063 0064 class AuthDetails : public QWidget, private Ui::AuthDetails 0065 { 0066 Q_OBJECT 0067 public: 0068 AuthDetails(const PolkitQt1::Details &details, const PolkitQt1::ActionDescription &actionDescription, QWidget *parent); 0069 0070 private Q_SLOTS: 0071 void openUrl(const QString &); 0072 }; 0073 0074 #endif // AUTHDIALOG_H