KVIrc  4.9.2
DeveloperAPIs
OptionsWidget_identity.h
Go to the documentation of this file.
1 #ifndef _OPTW_IDENTITY_H_
2 #define _OPTW_IDENTITY_H_
3 
4 //=============================================================================
5 //
6 // File : OptionsWidget_identity.h
7 // Creation date : Tue Nov 14 2000 23:06:12 CEST by Szymon Stefanek
8 //
9 // This file is part of the KVIrc IRC client distribution
10 // Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
11 // Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)
12 //
13 // This program is FREE software. You can redistribute it and/or
14 // modify it under the terms of the GNU General Public License
15 // as published by the Free Software Foundation; either version 2
16 // of the License, or (at your option) any later version.
17 //
18 // This program is distributed in the HOPE that it will be USEFUL,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 // See the GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program. If not, write to the Free Software Foundation,
25 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 //
27 //=============================================================================
28 
29 #include "KviOptionsWidget.h"
30 #include "kvi_settings.h"
31 #include "KviSelectors.h"
32 #include "KviPixmap.h"
33 
34 #include <QDialog>
35 
36 class QCheckBox;
37 class QLineEdit;
38 class QPushButton;
39 class QComboBox;
40 class KviHttpRequest;
41 class QTreeWidget;
42 class KviIdentityProfile;
43 
44 class NickAlternativesDialog : public QDialog
45 {
47  Q_OBJECT
48 protected:
49  NickAlternativesDialog(QWidget * par, const QString & n1, const QString & n2, const QString & n3);
51 
52 protected:
53  QLineEdit * m_pNickEdit1;
54  QLineEdit * m_pNickEdit2;
55  QLineEdit * m_pNickEdit3;
56 
57 protected:
58  void fill(QString & n1, QString & n2, QString & n3);
59 };
60 
61 class AvatarSelectionDialog : public QDialog
62 {
64  Q_OBJECT
65 public:
66  AvatarSelectionDialog(QWidget * par, const QString & szInitialPath);
68 
69 protected:
70  QLineEdit * m_pLineEdit;
71  QString m_szAvatarName;
72 
73 protected:
74  virtual void closeEvent(QCloseEvent * e);
75  const QString & avatarName() { return m_szAvatarName; };
76 protected slots:
77  void okClicked();
78  void cancelClicked();
79  void chooseFileClicked();
80 };
81 
82 class AvatarDownloadDialog : public QDialog
83 {
85  Q_OBJECT
86 public:
87  AvatarDownloadDialog(QWidget * par, const QString & szUrl);
89 
90 protected:
92  QLabel * m_pOutput;
95  QString m_szUrl;
96 
97 protected:
98  virtual void closeEvent(QCloseEvent * e);
99  const QString & localFileName() { return m_szLocalFileName; };
100  const QString & errorMessage() { return m_szErrorMessage; };
101 protected slots:
102  void startDownload();
103  void cancelClicked();
104  void downloadTerminated(bool bSuccess);
105  void downloadMessage(const QString & szMsg);
106 };
107 
108 class IdentityProfileEditor : public QDialog
109 {
111  Q_OBJECT
112 public:
113  IdentityProfileEditor(QWidget * pParent);
115 
116 protected:
117  QLineEdit * m_pNameEdit;
118  QLineEdit * m_pNetworkEdit;
119  QLineEdit * m_pNickEdit;
120  QLineEdit * m_pAltNickEdit;
121  QLineEdit * m_pUserNameEdit;
122  QLineEdit * m_pRealNameEdit;
123  QPushButton * m_pBtnOk;
124 
125 public:
126  bool editProfile(KviIdentityProfile * pProfile);
127 protected slots:
128  void toggleButton();
129 };
130 
131 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identity KviIconManager::Ident
132 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identity __tr2qs_no_lookup("Identity")
133 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identity 99998
134 #define KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identity true
135 
137 {
138  Q_OBJECT
139 public:
140  OptionsWidget_identity(QWidget * parent);
142 };
143 
144 #define KVI_OPTIONS_WIDGET_ICON_KviIdentityGeneralOptionsWidget KviIconManager::Ident
145 #define KVI_OPTIONS_WIDGET_NAME_KviIdentityGeneralOptionsWidget __tr2qs_no_lookup("General")
146 #define KVI_OPTIONS_WIDGET_PRIORITY_KviIdentityGeneralOptionsWidget 90000
147 #define KVI_OPTIONS_WIDGET_PARENT_KviIdentityGeneralOptionsWidget OptionsWidget_identity
148 
150 {
151  Q_OBJECT
152 public:
153  KviIdentityGeneralOptionsWidget(QWidget * pParent);
155 
156 protected:
157  QString m_szAltNicknames[3];
158 
159  QComboBox * m_pAgeCombo;
160  QComboBox * m_pGenderCombo;
161 protected slots:
162  void setNickAlternatives();
163 
164 protected:
165  virtual void commit();
166 };
167 
168 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityAvatar KviIconManager::Avatar
169 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAvatar __tr2qs_no_lookup("Avatar")
170 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAvatar 80000
171 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_identityAvatar OptionsWidget_identity
172 
174 {
175  Q_OBJECT
176 public:
177  OptionsWidget_identityAvatar(QWidget * pParent);
179 
180 protected:
181  QCheckBox * m_pUseAvatarCheck;
182  QLineEdit * m_pAvatarNameEdit;
183  QPushButton * m_pChooseAvatarButton;
186 protected slots:
187  void chooseAvatar();
188 
189 protected:
190  virtual void commit();
191 };
192 
193 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityAdvanced KviIconManager::Gui
194 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAdvanced __tr2qs_no_lookup("Advanced")
195 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAdvanced 70000
196 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_identityAdvanced OptionsWidget_identity
197 
199 {
200  Q_OBJECT
201 public:
202  OptionsWidget_identityAdvanced(QWidget * pParent);
204 
205 protected:
206  bool m_bI;
207  bool m_bW;
208  bool m_bS;
213 
214 protected:
215  virtual void commit();
216 };
217 
218 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityProfile KviIconManager::UserWindow
219 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityProfile __tr2qs_no_lookup("Profiles")
220 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityProfile 60000
221 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_identityProfile OptionsWidget_identity
222 
224 {
225  Q_OBJECT
226 public:
227  OptionsWidget_identityProfile(QWidget * pParent);
229 
230 protected:
231  QTreeWidget * m_pTreeWidget;
232  QCheckBox * m_pProfilesCheck;
233  QPushButton * m_pBtnAddProfile;
234  QPushButton * m_pBtnEditProfile;
235  QPushButton * m_pBtnDelProfile;
238 
239 public:
240  virtual void commit();
241 protected slots:
242  void toggleControls();
243  void addProfileEntry();
244  void editProfileEntry();
245  void delProfileEntry();
246  void editProfileOkPressed();
247 };
248 
249 #endif //_OPTW_IDENTITY_H_
NickAlternativesDialog(QWidget *par, const QString &n1, const QString &n2, const QString &n3)
Definition: OptionsWidget_identity.cpp:56
AvatarSelectionDialog(QWidget *par, const QString &szInitialPath)
Definition: OptionsWidget_identity.cpp:200
virtual void closeEvent(QCloseEvent *e)
Definition: OptionsWidget_identity.cpp:165
Definition: OptionsWidget_identity.h:108
Definition: KviCString.h:105
QLineEdit * m_pUserNameEdit
Definition: OptionsWidget_identity.h:121
Definition: KviSelectors.h:59
void chooseFileClicked()
Definition: OptionsWidget_identity.cpp:265
Definition: OptionsWidget_identity.h:173
void downloadMessage(const QString &szMsg)
Definition: OptionsWidget_identity.cpp:178
void editProfileEntry()
Definition: OptionsWidget_identity.cpp:827
KviHttpRequest * m_pRequest
Definition: OptionsWidget_identity.h:91
void delProfileEntry()
Definition: OptionsWidget_identity.cpp:872
IdentityProfileEditor * m_pEditor
Definition: OptionsWidget_identity.h:236
Definition: OptionsWidget_identity.h:61
virtual void commit()
Definition: OptionsWidget_identity.cpp:424
Definition: OptionsWidget_identity.h:149
QCheckBox * m_pUseAvatarCheck
Definition: OptionsWidget_identity.h:181
Definition: KviSelectors.h:149
~AvatarDownloadDialog()
Definition: OptionsWidget_identity.cpp:143
QLabel * m_pOutput
Definition: OptionsWidget_identity.h:92
bool m_bW
Definition: OptionsWidget_identity.h:207
QPushButton * m_pBtnOk
Definition: OptionsWidget_identity.h:123
QPushButton * m_pChooseAvatarButton
Definition: OptionsWidget_identity.h:183
const QString & localFileName()
Definition: OptionsWidget_identity.h:99
AvatarDownloadDialog(QWidget *par, const QString &szUrl)
Definition: OptionsWidget_identity.cpp:117
void startDownload()
Definition: OptionsWidget_identity.cpp:148
Definition: OptionsWidget_identity.h:198
#define e
Definition: detector.cpp:69
QString m_szAvatarName
Definition: OptionsWidget_identity.h:71
QLineEdit * m_pNetworkEdit
Definition: OptionsWidget_identity.h:118
void addProfileEntry()
Definition: OptionsWidget_identity.cpp:806
bool editProfile(KviIdentityProfile *pProfile)
Definition: OptionsWidget_identity.cpp:981
Definition: KviOptionsWidget.h:40
Definition: KviPixmap.h:33
void cancelClicked()
Definition: OptionsWidget_identity.cpp:260
OptionsWidget_identity(QWidget *parent)
Definition: OptionsWidget_identity.cpp:280
QLineEdit * m_pNickEdit1
Definition: OptionsWidget_identity.h:53
void toggleControls()
Definition: OptionsWidget_identity.cpp:795
void downloadTerminated(bool bSuccess)
Definition: OptionsWidget_identity.cpp:187
OptionsWidget_identityProfile(QWidget *pParent)
Definition: OptionsWidget_identity.cpp:715
Definition: OptionsWidget_identity.h:136
bool m_bI
Definition: OptionsWidget_identity.h:206
~OptionsWidget_identityAvatar()
Definition: OptionsWidget_identity.cpp:513
QString m_szLocalFileName
Definition: OptionsWidget_identity.h:94
KviBoolSelector * m_pISelector
Definition: OptionsWidget_identity.h:210
virtual void closeEvent(QCloseEvent *e)
Definition: OptionsWidget_identity.cpp:274
KviPixmapPreview * m_pAvatarPreview
Definition: OptionsWidget_identity.h:185
OptionsWidget_identityAdvanced(QWidget *pParent)
Definition: OptionsWidget_identity.cpp:661
KviIdentityGeneralOptionsWidget(QWidget *pParent)
Definition: OptionsWidget_identity.cpp:288
QLineEdit * m_pLineEdit
Definition: OptionsWidget_identity.h:70
QLineEdit * m_pNameEdit
Definition: OptionsWidget_identity.h:117
QTreeWidget * m_pTreeWidget
Definition: OptionsWidget_identity.h:231
void fill(QString &n1, QString &n2, QString &n3)
Definition: OptionsWidget_identity.cpp:110
Definition: KviHttpRequest.h:58
QLineEdit * m_pNickEdit
Definition: OptionsWidget_identity.h:119
QString m_szAltNicknames[3]
Definition: OptionsWidget_identity.h:157
KviCString m_sModeStr
Definition: OptionsWidget_identity.h:209
QPushButton * m_pBtnDelProfile
Definition: OptionsWidget_identity.h:235
OptionsWidget_identityAvatar(QWidget *pParent)
Definition: OptionsWidget_identity.cpp:464
QComboBox * m_pGenderCombo
Definition: OptionsWidget_identity.h:160
QPushButton * m_pBtnEditProfile
Definition: OptionsWidget_identity.h:234
QPushButton * m_pBtnAddProfile
Definition: OptionsWidget_identity.h:233
bool m_bS
Definition: OptionsWidget_identity.h:208
const QString & errorMessage()
Definition: OptionsWidget_identity.h:100
KviPixmap * m_pLocalAvatar
Definition: OptionsWidget_identity.h:184
Class which manages the identity profile.
Definition: KviIdentityProfile.h:45
void cancelClicked()
Definition: OptionsWidget_identity.cpp:172
const QString & avatarName()
Definition: OptionsWidget_identity.h:75
QString m_szUrl
Definition: OptionsWidget_identity.h:95
Definition: OptionsWidget_identity.h:82
QString szUrl
Definition: libkvisetup.cpp:46
Definition: OptionsWidget_identity.h:44
virtual void commit()
Definition: OptionsWidget_identity.cpp:882
void editProfileOkPressed()
Definition: OptionsWidget_identity.cpp:858
KviBoolSelector * m_pSSelector
Definition: OptionsWidget_identity.h:212
QString m_szErrorMessage
Definition: OptionsWidget_identity.h:93
This file contains compile time settings.
QLineEdit * m_pAvatarNameEdit
Definition: OptionsWidget_identity.h:182
QLineEdit * m_pNickEdit3
Definition: OptionsWidget_identity.h:55
void chooseAvatar()
Definition: OptionsWidget_identity.cpp:537
void setNickAlternatives()
Definition: OptionsWidget_identity.cpp:415
virtual void commit()
Definition: OptionsWidget_identity.cpp:518
QCheckBox * m_pProfilesCheck
Definition: OptionsWidget_identity.h:232
int m_iCurrentEditedProfile
Definition: OptionsWidget_identity.h:237
Definition: OptionsWidget_identity.h:223
QLineEdit * m_pRealNameEdit
Definition: OptionsWidget_identity.h:122
void toggleButton()
Definition: OptionsWidget_identity.cpp:1009
virtual void commit()
Definition: OptionsWidget_identity.cpp:702
IdentityProfileEditor(QWidget *pParent)
Definition: OptionsWidget_identity.cpp:908
QLineEdit * m_pNickEdit2
Definition: OptionsWidget_identity.h:54
KviBoolSelector * m_pWSelector
Definition: OptionsWidget_identity.h:211
void okClicked()
Definition: OptionsWidget_identity.cpp:254
QLineEdit * m_pAltNickEdit
Definition: OptionsWidget_identity.h:120
QComboBox * m_pAgeCombo
Definition: OptionsWidget_identity.h:159