File indexing completed on 2021-12-21 14:36:53

0001 /*
0002     SPDX-FileCopyrightText: 2008 Rolf Eike Beer <kde@opensource.sf-tec.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 #ifndef KGPGFIRSTASSISTANT_H
0007 #define KGPGFIRSTASSISTANT_H
0008 
0009 #include <KAssistantDialog>
0010 
0011 class QCheckBox;
0012 class QComboBox;
0013 class QLabel;
0014 class KPageWidgetItem;
0015 class KUrlRequester;
0016 
0017 class KGpgFirstAssistant : public KAssistantDialog
0018 {
0019     Q_OBJECT
0020 
0021 private:
0022     KPageWidgetItem *page_welcome;
0023     KPageWidgetItem *page_binary;
0024     KPageWidgetItem *page_config;
0025     KPageWidgetItem *page_defaultkey;
0026     KPageWidgetItem *page_done;
0027 
0028     QLabel *defaultkeylabel;
0029     QLabel *txtGpgVersion;
0030     QLabel *text_optionsfound;
0031     QLabel *versionLabel;
0032     QLabel *binlabel;
0033 
0034     QCheckBox *generateCB;
0035     QCheckBox *autostartCB;
0036 
0037     QComboBox *CBdefault;
0038 
0039     KUrlRequester *binURL;
0040     KUrlRequester *pathURL;
0041     
0042     QString m_gpgVersion;
0043     QString m_confPath;
0044 
0045     void findConfigPath(const QString &gpgBinary);
0046 
0047 public:
0048     /**
0049      * @brief constructor of KGpgFirstAssistant
0050      */
0051     explicit KGpgFirstAssistant(QWidget *parent = nullptr);
0052 
0053     /**
0054      * @brief check if key generation dialog should be started
0055      * @return if user requests dialog to be started
0056      */
0057     bool runKeyGenerate() const;
0058     /**
0059      * @brief get user selected GnuPG home directory
0060      * @return path to users GnuPG directory
0061      */
0062     QString getConfigPath() const;
0063     /**
0064      * @brief get fingerprint of default key
0065      * @return full fingerprint or empty string if user has not selected a default key
0066      */
0067     QString getDefaultKey() const;
0068     /**
0069      * @brief check if KGpg autostart should be activated
0070      * @return if user requests autostart or not
0071      */
0072     bool getAutoStart() const;
0073 
0074 public Q_SLOTS:
0075     /**
0076      * @brief called when "next" button is pressed
0077      */
0078         void next() override;
0079 
0080 private Q_SLOTS:
0081     void slotBinaryChanged(const QString &binary);
0082 };
0083 
0084 #endif