root/trunk/qt4-gui/src/dialogs/gpgkeymanager.h

Revision 6463, 2.0 kB (checked in by flynd, 4 months ago)

Use a const pointer for user objects that are only fetched for read access. Fixed some places where we changed the user even though we just had a read lock.

  • Property svn:eol-style set to native
Line 
1/*
2 * This file is part of Licq, an instant messaging client for UNIX.
3 * Copyright (C) 2005-2006 Licq developers
4 *
5 * Licq is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * Licq is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with Licq; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19
20#ifndef GPGKEYMANAGER_H
21#define GPGKEYMANAGER_H
22
23#include <QDialog>
24#include <QTreeWidget>
25
26class ICQUser;
27
28namespace LicqQtGui
29{
30class GPGKeySelect;
31class KeyList;
32
33class GPGKeyManager : public QDialog
34{
35  Q_OBJECT
36
37public:
38  GPGKeyManager(QWidget* parent = 0);
39
40private:
41  KeyList* lst_keyList;
42  void initKeyList();
43
44private slots:
45  void slot_add();
46  void slot_edit();
47  void slot_remove();
48  void slot_doubleClicked(QTreeWidgetItem* item);
49};
50
51class KeyList : public QTreeWidget
52{
53  Q_OBJECT
54
55public:
56  KeyList(QWidget* parent = 0);
57
58  void editUser(QString id, unsigned long ppid);
59  void resizeColumnsToContents();
60
61private:
62  void dragEnterEvent(QDragEnterEvent* event);
63  void dragMoveEvent(QDragMoveEvent* /* event */) {};
64  void dropEvent(QDropEvent* event);
65  virtual void resizeEvent(QResizeEvent* event);
66};
67
68class KeyListItem : public QObject, public QTreeWidgetItem
69{
70  Q_OBJECT
71
72public:
73  KeyListItem(QTreeWidget* parent, const ICQUser* u);
74
75  void edit();
76  void unsetKey();
77
78  QString getszId() { return szId; };
79  unsigned long getnPPID() { return nPPID; };
80
81private:
82  QString szId;
83  unsigned long nPPID;
84  GPGKeySelect* keySelect;
85  void updateText(const ICQUser* u);
86
87private slots:
88  void slot_done();
89};
90
91} // namespace LicqQtGui
92
93#endif
Note: See TracBrowser for help on using the browser.