KVIrc  4.9.2
DeveloperAPIs
OptionsWidget_servers.h
Go to the documentation of this file.
1 #ifndef _OPTW_SERVERS_H_
2 #define _OPTW_SERVERS_H_
3 
4 //=============================================================================
5 //
6 // File : OptionsWidget_servers.h
7 // Creation date : Wed Jun 12 2000 03:29:01 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 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 #include "KviOptionsWidget.h"
29 #include <QTreeWidget>
30 
31 #include <QDialog>
32 #include <QButtonGroup>
33 #include <QTabWidget>
34 #include <QCheckBox>
35 #include <QToolButton>
36 
37 class QLabel;
38 class QLineEdit;
39 class QComboBox;
40 class QPushButton;
41 class KviIpEditor;
42 class KviIrcServer;
43 class QMenu;
44 class KviScriptEditor;
45 class KviNickServRule;
46 class NickServRuleEditor;
47 class KviIrcServer;
48 class KviIrcNetwork;
49 class KviIrcNetworkData;
50 class KviMexServerImport;
51 
52 class IrcServerOptionsTreeWidgetItem : public QTreeWidgetItem
53 {
54 public:
55  IrcServerOptionsTreeWidgetItem(QTreeWidget * parent, const QPixmap & pm, const KviIrcNetwork * n);
56  IrcServerOptionsTreeWidgetItem(QTreeWidgetItem * parent, const QPixmap & pm, const KviIrcServer * s);
58 
59 public:
62 
63 public:
65  {
66  return m_pServerData;
67  }
68 
70  {
71  return m_pNetworkData;
72  }
73 
74 public:
75  void updateVisibleStrings();
76 };
77 
78 class IrcNetworkDetailsWidget : public QDialog
79 {
80  Q_OBJECT
81 public:
82  IrcNetworkDetailsWidget(QWidget * par, KviIrcNetwork * d);
84 
85 protected:
88 
89  QLineEdit * m_pUserEditor;
91  QLineEdit * m_pNickEditor;
93  QLineEdit * m_pRealEditor;
94  QLineEdit * m_pDescEditor;
95 
96  QComboBox * m_pEncodingEditor;
97  QComboBox * m_pTextEncodingEditor;
98 
99  QCheckBox * m_pAutoConnectCheck;
100 
101  QTreeWidget * m_pNickServTreeWidget;
102  QCheckBox * m_pNickServCheck;
103  QPushButton * m_pAddRuleButton;
104  QPushButton * m_pDelRuleButton;
105  QPushButton * m_pEditRuleButton;
106 
107  QStringList m_lstChannels;
109 
110 public:
111  void fillData(KviIrcNetwork * d);
112 protected slots:
114  void addNickServRule();
115  void delNickServRule();
116  void editNickServRule();
117 };
118 
119 class IrcServerDetailsWidget : public QDialog
120 {
121  Q_OBJECT
122 public:
123  IrcServerDetailsWidget(QWidget * par, KviIrcServer * s);
125 
126 protected:
127  QString m_szHostname;
128  QLabel * m_pHeaderLabel;
131  QLineEdit * m_pUserEditor;
134  QLineEdit * m_pNickEditor;
136  QLineEdit * m_pSaslNickEditor;
137  QLineEdit * m_pRealEditor;
138  QLineEdit * m_pDescEditor;
139  QLineEdit * m_pIdEditor;
140  QComboBox * m_pLinkFilterEditor;
141  QComboBox * m_pEncodingEditor;
144  QCheckBox * m_pCacheIpCheck;
145  QCheckBox * m_pUseSSLCheck;
146  QCheckBox * m_pEnableCAPCheck;
148  QCheckBox * m_pEnableSASLCheck;
150  QCheckBox * m_pIMode;
151  QCheckBox * m_pWMode;
152  QCheckBox * m_pSMode;
153  QCheckBox * m_pUseAutoConnect;
154  QCheckBox * m_pUseIPV6Check;
155  QLineEdit * m_pPortEditor;
156  QStringList m_lstChannels;
158 
159  QComboBox * m_pProxyEditor;
160 protected slots:
161  void useDefaultInitUModeToggled(bool);
162  void portEditorTextChanged(const QString &);
163  void useIPV6CheckToggled(bool);
164  void useSSLCheckToggled(bool);
165 
166 public:
167  void setHeaderLabelText();
168  void fillData(KviIrcServer * s);
169 };
170 
171 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_servers KviIconManager::ServerConfiguration
172 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_servers __tr2qs_no_lookup("Servers and Configuration")
173 #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_servers __tr2qs_no_lookup("connection")
174 //#define KVI_OPTIONS_WIDGET_NOPARENT_OptionsWidget_servers OptionsWidget_connection
175 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_servers 99000
176 
178 {
179  Q_OBJECT
180 public:
181  OptionsWidget_servers(QWidget * parent);
183 
184 protected:
185  QTreeWidget * m_pTreeWidget;
186  QLabel * m_pSrvNetLabel;
187  QLineEdit * m_pSrvNetEdit;
188  QLabel * m_pFilterLabel;
189  QLineEdit * m_pFilterEdit;
190  QPushButton * m_pDetailsButton;
191  QMenu * m_pRecentPopup;
193  QMenu * m_pImportPopup;
195  QPushButton * m_pConnectCurrent;
196  QPushButton * m_pConnectNew;
203 
204  QToolButton * m_pNewServerButton;
205  QToolButton * m_pNewNetworkButton;
206  QToolButton * m_pRemoveButton;
207  QToolButton * m_pFavoriteServer;
208  QToolButton * m_pCopyServerButton;
209  QToolButton * m_pPasteServerButton;
210  QToolButton * m_pImportButton;
211  QToolButton * m_pFavoriteServerButton;
214 
215 private:
216  void fillServerList();
217  void saveLastItem();
218  IrcServerOptionsTreeWidgetItem * findNetItem(const QString & netname);
219  void selectBestServerByUrl(const QString & szUrl);
220 protected slots:
222  void importerDead();
223  void importServer(const KviIrcServer & s, const QString & network);
224  void importPopupAboutToShow();
225  void currentItemChanged(QTreeWidgetItem * cur, QTreeWidgetItem * prev);
226  void customContextMenuRequested(const QPoint & pnt);
227  void newNetwork();
228  void removeCurrent();
229  void newServer();
230  void updateFavoritesFilter(bool bSet);
231  void favoriteServer();
232  void copyServer();
233  void pasteServer();
234  void clearList();
235  void itemDoubleClicked(QTreeWidgetItem *, int);
236  void detailsClicked();
237  void connectCurrentClicked();
239  void recentServersPopupClicked(QAction * pAction);
240  void importPopupActivated(QAction * pAction);
241  void serverNetworkEditTextEdited(const QString & szNewText);
242  void filterTextEdited(const QString & szNewText);
243 
244 public:
245  virtual void commit();
246 };
247 
248 #endif
QCheckBox * m_pEnableSASLCheck
Definition: OptionsWidget_servers.h:148
KviChannelListSelector * m_pChannelListSelector
Definition: OptionsWidget_servers.h:157
void newServer()
Definition: OptionsWidget_servers.cpp:2016
KviPasswordLineEdit * m_pPassEditor
Definition: OptionsWidget_servers.h:90
QStringList m_lstChannels
Definition: OptionsWidget_servers.h:156
IrcNetworkDetailsWidget * m_pNetworkDetailsDialog
Definition: OptionsWidget_servers.h:199
QLineEdit * m_pUserEditor
Definition: OptionsWidget_servers.h:131
QLineEdit * m_pDescEditor
Definition: OptionsWidget_servers.h:138
~OptionsWidget_servers()
Definition: OptionsWidget_servers.cpp:1488
QCheckBox * m_pNickServCheck
Definition: OptionsWidget_servers.h:102
Definition: KviSelectors.h:59
void useSSLCheckToggled(bool)
Definition: OptionsWidget_servers.cpp:1019
KviBoolSelector * m_pShowThisDialogAtStartupSelector
Definition: OptionsWidget_servers.h:201
The class which manages the irc servers.
Definition: KviIrcServer.h:51
void updateVisibleStrings()
Definition: OptionsWidget_servers.cpp:1248
QCheckBox * m_pUseAutoConnect
Definition: OptionsWidget_servers.h:153
QLineEdit * m_pRealEditor
Definition: OptionsWidget_servers.h:137
QMenu * m_pImportPopup
Definition: OptionsWidget_servers.h:193
KviBoolSelector * m_pShowFavoritesOnly
Definition: OptionsWidget_servers.h:202
~IrcServerOptionsTreeWidgetItem()
Definition: OptionsWidget_servers.cpp:1240
void delNickServRule()
Definition: OptionsWidget_servers.cpp:415
QComboBox * m_pEncodingEditor
Definition: OptionsWidget_servers.h:96
QTreeWidget * m_pTreeWidget
Definition: OptionsWidget_servers.h:185
void itemDoubleClicked(QTreeWidgetItem *, int)
Definition: OptionsWidget_servers.cpp:1668
QString m_szHostname
Definition: OptionsWidget_servers.h:127
QLabel * m_pHeaderLabel
Definition: OptionsWidget_servers.h:128
Definition: KviScriptEditor.h:43
QMenu * m_pRecentPopup
Definition: OptionsWidget_servers.h:191
Definition: KviIpEditor.h:36
void newNetwork()
Definition: OptionsWidget_servers.cpp:2006
void useDefaultInitUModeToggled(bool)
Definition: OptionsWidget_servers.cpp:1210
IrcServerDetailsWidget * m_pServerDetailsDialog
Definition: OptionsWidget_servers.h:198
QLineEdit * m_pSaslNickEditor
Definition: OptionsWidget_servers.h:136
QComboBox * m_pLinkFilterEditor
Definition: OptionsWidget_servers.h:140
KviIrcNetwork * m_pNetworkData
Definition: OptionsWidget_servers.h:61
QLineEdit * m_pAlternativeNickEditor
Definition: OptionsWidget_servers.h:92
Definition: KviMexServerImport.h:33
Definition: OptionsWidget_servers.h:119
KviChannelListSelector * m_pChannelListSelector
Definition: OptionsWidget_servers.h:108
QToolButton * m_pCopyServerButton
Definition: OptionsWidget_servers.h:208
QLineEdit * m_pRealEditor
Definition: OptionsWidget_servers.h:93
QLabel * m_pSrvNetLabel
Definition: OptionsWidget_servers.h:186
void importPopupAboutToShow()
Definition: OptionsWidget_servers.cpp:1894
#define n
Definition: detector.cpp:78
QLineEdit * m_pPortEditor
Definition: OptionsWidget_servers.h:155
QComboBox * m_pEncodingEditor
Definition: OptionsWidget_servers.h:141
void fillServerList()
Definition: OptionsWidget_servers.cpp:1627
void detailsClicked()
Definition: OptionsWidget_servers.cpp:2192
void importPopupActivated(QAction *pAction)
Definition: OptionsWidget_servers.cpp:1916
QLineEdit * m_pDescEditor
Definition: OptionsWidget_servers.h:94
KviIrcNetwork * networkData() const
Definition: OptionsWidget_servers.h:69
bool m_bShowingFavoritesOnly
Definition: OptionsWidget_servers.h:212
QPushButton * m_pDetailsButton
Definition: OptionsWidget_servers.h:190
QComboBox * m_pProxyEditor
Definition: OptionsWidget_servers.h:159
~IrcServerDetailsWidget()
Definition: OptionsWidget_servers.cpp:1001
KviIpEditor * m_pIpEditor
Definition: OptionsWidget_servers.h:143
QMenu * m_pContextPopup
Definition: OptionsWidget_servers.h:192
QCheckBox * m_pEnableSTARTTLSCheck
Definition: OptionsWidget_servers.h:147
QLineEdit * m_pNickEditor
Definition: OptionsWidget_servers.h:91
QComboBox * m_pTextEncodingEditor
Definition: OptionsWidget_servers.h:142
void importServer(const KviIrcServer &s, const QString &network)
Definition: OptionsWidget_servers.cpp:1963
QCheckBox * m_pWMode
Definition: OptionsWidget_servers.h:151
QCheckBox * m_pSMode
Definition: OptionsWidget_servers.h:152
Network handling class.
Definition: KviIrcNetwork.h:47
QCheckBox * m_pIMode
Definition: OptionsWidget_servers.h:150
QLineEdit * m_pAlternativeNickEditor
Definition: OptionsWidget_servers.h:135
QToolButton * m_pFavoriteServer
Definition: OptionsWidget_servers.h:207
Definition: OptionsWidget_servers.h:52
void pasteServer()
Definition: OptionsWidget_servers.cpp:2106
void setHeaderLabelText()
Definition: OptionsWidget_servers.cpp:1029
IrcServerDetailsWidget(QWidget *par, KviIrcServer *s)
Definition: OptionsWidget_servers.cpp:512
Definition: KviOptionsWidget.h:40
QPushButton * m_pDelRuleButton
Definition: OptionsWidget_servers.h:104
void fillData(KviIrcNetwork *d)
Definition: OptionsWidget_servers.cpp:434
void customContextMenuRequested(const QPoint &pnt)
Definition: OptionsWidget_servers.cpp:1864
KviScriptEditor * m_pOnLoginEditor
Definition: OptionsWidget_servers.h:87
QLineEdit * m_pFilterEdit
Definition: OptionsWidget_servers.h:189
char s d
Definition: KviIrcNumericCodes.h:391
char s char s s
Definition: KviIrcNumericCodes.h:391
QCheckBox * m_pCacheIpCheck
Definition: OptionsWidget_servers.h:144
KviPasswordLineEdit * m_pPassEditor
Definition: OptionsWidget_servers.h:132
QLineEdit * m_pUserEditor
Definition: OptionsWidget_servers.h:89
void favoriteServer()
Definition: OptionsWidget_servers.cpp:2046
virtual void commit()
Definition: OptionsWidget_servers.cpp:1798
QToolButton * m_pFavoriteServerButton
Definition: OptionsWidget_servers.h:211
void editNickServRule()
Definition: OptionsWidget_servers.cpp:385
IrcServerOptionsTreeWidgetItem * m_pLastEditedItem
Definition: OptionsWidget_servers.h:197
void fillData(KviIrcServer *s)
Definition: OptionsWidget_servers.cpp:1053
void filterTextEdited(const QString &szNewText)
Definition: OptionsWidget_servers.cpp:1729
KviScriptEditor * m_pOnLoginEditor
Definition: OptionsWidget_servers.h:130
QToolButton * m_pImportButton
Definition: OptionsWidget_servers.h:210
QToolButton * m_pNewServerButton
Definition: OptionsWidget_servers.h:204
KviMexServerImport * m_pImportFilter
Definition: OptionsWidget_servers.h:200
KviScriptEditor * m_pOnConnectEditor
Definition: OptionsWidget_servers.h:86
OptionsWidget_servers(QWidget *parent)
Definition: OptionsWidget_servers.cpp:1264
IrcServerOptionsTreeWidgetItem(QTreeWidget *parent, const QPixmap &pm, const KviIrcNetwork *n)
Definition: OptionsWidget_servers.cpp:1220
QToolButton * m_pRemoveButton
Definition: OptionsWidget_servers.h:206
void copyServer()
Definition: OptionsWidget_servers.cpp:2092
QToolButton * m_pShowFavoritesOnlyButton
Definition: OptionsWidget_servers.h:213
void useIPV6CheckToggled(bool)
Definition: OptionsWidget_servers.cpp:1009
Definition: KviSelectors.h:407
QCheckBox * m_pUseSSLCheck
Definition: OptionsWidget_servers.h:145
KviIrcServer * m_pServerData
Definition: OptionsWidget_servers.h:60
Definition: KviNickServRule.h:35
void recentServersPopupAboutToShow()
Definition: OptionsWidget_servers.cpp:1515
Definition: KviSelectors.h:129
KviIrcServer * m_pClipboard
Definition: OptionsWidget_servers.h:194
QLineEdit * m_pIdEditor
Definition: OptionsWidget_servers.h:139
KviScriptEditor * m_pOnConnectEditor
Definition: OptionsWidget_servers.h:129
QLineEdit * m_pNickEditor
Definition: OptionsWidget_servers.h:134
QPushButton * m_pConnectCurrent
Definition: OptionsWidget_servers.h:195
void saveLastItem()
Definition: OptionsWidget_servers.cpp:1773
QComboBox * m_pTextEncodingEditor
Definition: OptionsWidget_servers.h:97
Definition: OptionsWidget_nickserv.h:46
~IrcNetworkDetailsWidget()
Definition: OptionsWidget_servers.cpp:377
QCheckBox * m_pEnableCAPCheck
Definition: OptionsWidget_servers.h:146
IrcNetworkDetailsWidget(QWidget *par, KviIrcNetwork *d)
Definition: OptionsWidget_servers.cpp:74
void connectCurrentClicked()
Definition: OptionsWidget_servers.cpp:1617
QPushButton * m_pAddRuleButton
Definition: OptionsWidget_servers.h:103
void enableDisableNickServControls()
Definition: OptionsWidget_servers.cpp:424
QPushButton * m_pEditRuleButton
Definition: OptionsWidget_servers.h:105
void clearList()
Definition: OptionsWidget_servers.cpp:2179
void serverNetworkEditTextEdited(const QString &szNewText)
Definition: OptionsWidget_servers.cpp:1717
void removeCurrent()
Definition: OptionsWidget_servers.cpp:2135
void slotShowThisDialogAtStartupSelectorDestroyed()
Definition: OptionsWidget_servers.cpp:1507
void importerDead()
Definition: OptionsWidget_servers.cpp:1958
IrcServerOptionsTreeWidgetItem * findNetItem(const QString &netname)
Definition: OptionsWidget_servers.cpp:2166
QPushButton * m_pConnectNew
Definition: OptionsWidget_servers.h:196
QLabel * m_pFilterLabel
Definition: OptionsWidget_servers.h:188
void recentServersPopupClicked(QAction *pAction)
Definition: OptionsWidget_servers.cpp:1523
QTreeWidget * m_pNickServTreeWidget
Definition: OptionsWidget_servers.h:101
QString szUrl
Definition: libkvisetup.cpp:46
QLineEdit * m_pSrvNetEdit
Definition: OptionsWidget_servers.h:187
void selectBestServerByUrl(const QString &szUrl)
Definition: OptionsWidget_servers.cpp:1546
QCheckBox * m_pUseIPV6Check
Definition: OptionsWidget_servers.h:154
void addNickServRule()
Definition: OptionsWidget_servers.cpp:401
QCheckBox * m_pAutoConnectCheck
Definition: OptionsWidget_servers.h:99
QToolButton * m_pNewNetworkButton
Definition: OptionsWidget_servers.h:205
void currentItemChanged(QTreeWidgetItem *cur, QTreeWidgetItem *prev)
Definition: OptionsWidget_servers.cpp:1673
KviPasswordLineEdit * m_pSaslPassEditor
Definition: OptionsWidget_servers.h:133
void updateFavoritesFilter(bool bSet)
Definition: OptionsWidget_servers.cpp:2063
QStringList m_lstChannels
Definition: OptionsWidget_servers.h:107
QCheckBox * m_pUseDefaultInitUMode
Definition: OptionsWidget_servers.h:149
QToolButton * m_pPasteServerButton
Definition: OptionsWidget_servers.h:209
KviIrcServer * serverData() const
Definition: OptionsWidget_servers.h:64
Definition: OptionsWidget_servers.h:177
void portEditorTextChanged(const QString &)
Definition: OptionsWidget_servers.cpp:1024
Definition: OptionsWidget_servers.h:78