~kubuntu-members/kgpg/4.11

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/***************************************************************************
                          kgpgoptions.h  -  description
                             -------------------
    begin                : Mon Jul 8 2002
    copyright          : (C) 2002 by Jean-Baptiste Mardelle
    email                : bj@altern.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef KGPGOPTIONS_H
#define KGPGOPTIONS_H

#include "ui_conf_gpg.h"
#include "ui_conf_ui2.h"
#include "ui_conf_servers.h"
#include "ui_conf_misc.h"
#include "ui_conf_decryption.h"

#include "core/kgpgkey.h"

#include <QPixmap>
#include <QString>

#include <KConfigDialog>

class KFontChooser;
class KConfig;

class Encryption;
class KGpgItemModel;
class KeyListProxyModel;

class Decryption : public QWidget, public Ui::Decryption
{
public:
  explicit Decryption( QWidget *parent = 0 )
    : QWidget( parent)
  {
    setupUi(this);
  }
};

class MiscConf : public QWidget, public Ui::MiscConf
{
public:
  explicit MiscConf( QWidget *parent = 0 )
    : QWidget( parent )
  {
    setupUi( this );
  }
};


class UIConf : public QWidget, public Ui::UIConf
{
public:
  explicit UIConf( QWidget *parent = 0 )
    : QWidget( parent )
  {
    setupUi( this );
  }
};

class ServerConf : public QWidget, public Ui::ServerConf
{
public:
  explicit ServerConf( QWidget *parent = 0 )
    : QWidget( parent )
  {
    setupUi( this );
  }
};


class GPGConf : public QWidget, public Ui::GPGConf
{
public:
  explicit GPGConf( QWidget *parent = 0 )
    : QWidget( parent )
  {
    setupUi( this );
  }
};


class kgpgOptions : public KConfigDialog
{
    Q_OBJECT

public:
    explicit kgpgOptions(QWidget *parent = 0, KGpgItemModel *model = 0);
    ~kgpgOptions();

signals:
    void updateDisplay();
    void settingsUpdated();
    void changeFont(QFont);
    void homeChanged();
    void refreshTrust(KgpgCore::KgpgKeyTrust, QColor);

private slots:
    void slotChangeHome();
    void slotAddKeyServer();
	void slotChangeEncryptTo();
    void slotDelKeyServer();
    void slotEditKeyServer();
    void slotEditKeyServer(QListWidgetItem *);
    void slotChangeKeyServerButtonEnable();
    void slotDefaultKeyServer();
    void updateWidgets();
    void updateWidgetsDefault();
    void updateSettings();
    void listKeys();
    void slotInstallDecrypt(const QString &mimetype);
    void slotInstallSign(const QString &mimetype);
    void slotRemoveMenu(const QString &menu);
    void slotSystrayEnable();

protected:
    virtual bool hasChanged();
    virtual bool isDefault();

private:
    QStringList names;
    QStringList ids;
    QString alwaysKeyID;
    QString fileEncryptionKey;
    QString gpgConfigPath;
    QString keyServer;              // Server stored in GnuPG config
    QStringList serverList;         // Servers stored in kgpgrc
    QString defaultKeyServer;       // Default keyserver
    QStringList defaultServerList;  // Default list of servers including the default key server;
    QString defaultConfigPath;
    QString defaultHomePath;
    QString defaultBinPath;
    QPixmap pixkeySingle;
    QPixmap pixkeyDouble;
    QColor keyUltimate;
    QColor keyGood;
    QColor keyExpired;
    QColor keyMarginal;
    QColor keyBad;
    QColor keyUnknown;
    QColor keyRev;

    KConfig *m_config;

    Encryption * const m_page1;
    Decryption * const m_page2;
    UIConf * const m_page3;
    GPGConf * const m_page4;
    ServerConf * const m_page6;
    MiscConf * const m_page7;

    KFontChooser * const m_fontchooser;

    bool m_useagent;
    bool m_defaultuseagent;
    bool m_encrypttoalways;
    bool m_defaultencrypttoalways;
    bool m_showsystray;
    int m_trayaction;
    int m_mailUats;
    int m_emailSortingIndex;
    QString m_emailTemplate;

    KGpgItemModel * const m_model;
    KeyListProxyModel * const m_combomodel;

    bool isValidKeyserver(const QString &);
};

#endif // KGPGOPTIONS_H