summaryrefslogtreecommitdiffstats
path: root/src/modules/options/optw_servers.h
blob: 54142e04f9a118d8f98c75fd008690bfd9662768 (plain)
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#ifndef _OPTW_SERVERS_H_
#define _OPTW_SERVERS_H_

//=============================================================================
//
//   File : optw_servers.h
//   Creation date : Wed Jun 12 2000 03:29:01 by Szymon Stefanek
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)
//
//   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 opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//=============================================================================

#include "kvi_optionswidget.h"
#include "kvi_tal_listview.h"
#include <tqdialog.h>
#include <tqbuttongroup.h>
#include <tqtabwidget.h>

class KviIrcServer;
class KviIrcNetwork;
class KviIrcNetworkData;
class KviMexServerImport;



class KviServerOptionsListViewItem : public KviTalListViewItem
{
public:
	KviServerOptionsListViewItem(KviTalListView *parent,const TQPixmap &pm,const KviIrcNetwork *n);
	KviServerOptionsListViewItem(KviTalListViewItem *parent,const TQPixmap &pm,const KviIrcServer *s);
	~KviServerOptionsListViewItem();
public:
	KviIrcServer * m_pServerData;
	KviIrcNetwork * m_pNetworkData;
public:
	void updateVisibleStrings();
};

class TQLabel;
class TQLineEdit;
class KviIpEditor;
class KviIrcServer;
class TQCheckBox;
class KviTalPopupMenu;
class KviScriptEditor;
class TQComboBox;
class TQPushButton;
class TQToolButton;
class KviNickServRule;
class KviNickServRuleEditor;


class KviNetworkDetailsWidget : public TQDialog
{
	TQ_OBJECT
  
public:
	KviNetworkDetailsWidget(TQWidget * par,KviIrcNetwork * d);
	~KviNetworkDetailsWidget();
protected:
	KviScriptEditor       * m_pOnConnectEditor;
	KviScriptEditor       * m_pOnLoginEditor;

	TQLineEdit             * m_pUserEditor;
	TQLineEdit             * m_pPassEditor;
	TQLineEdit             * m_pNickEditor;
	TQLineEdit             * m_pRealEditor;
	TQLineEdit             * m_pDescEditor;

	TQComboBox             * m_pEncodingEditor;
	
	TQCheckBox             * m_pAutoConnectCheck;
	
	KviTalListView             * m_pNickServListView;
	TQCheckBox             * m_pNickServCheck;
	TQPushButton           * m_pAddRuleButton;
	TQPushButton           * m_pDelRuleButton;
	TQPushButton           * m_pEditRuleButton;

	TQStringList             m_lstChannels;
	KviCahnnelListSelector * m_pChannelListSelector;
public:
	void fillData(KviIrcNetwork * d);
protected slots:
	void enableDisableNickServControls();
	void addNickServRule();
	void delNickServRule();
	void editNickServRule();
};

class KviServerDetailsWidget : public TQDialog
{
	TQ_OBJECT
  
public:
	KviServerDetailsWidget(TQWidget * par,KviIrcServer * s);
	~KviServerDetailsWidget();
protected:
	TQString                 m_szHostname;
	TQLabel                * m_pHeaderLabel;
	KviScriptEditor       * m_pOnConnectEditor;
	KviScriptEditor       * m_pOnLoginEditor;
	TQLineEdit             * m_pUserEditor;
	TQLineEdit             * m_pPassEditor;
	TQLineEdit             * m_pNickEditor;
	TQLineEdit             * m_pRealEditor;
	TQLineEdit             * m_pDescEditor;
	TQLineEdit             * m_pIdEditor;
	TQComboBox             * m_pLinkFilterEditor;
	TQComboBox             * m_pEncodingEditor;
	KviIpEditor           * m_pIpEditor;
	TQCheckBox             * m_pCacheIpCheck;
	TQCheckBox             * m_pUseSSLCheck;
	TQCheckBox             * m_pUseDefaultInitUMode;
	TQCheckBox             * m_pIMode;
	TQCheckBox             * m_pWMode;
	TQCheckBox             * m_pSMode;
	TQCheckBox             * m_pUseAutoConnect;
	TQCheckBox             * m_pUseIPV6Check;
	TQLineEdit             * m_pPortEditor;
	TQStringList             m_lstChannels;
	KviCahnnelListSelector * m_pChannelListSelector;
	
	TQComboBox             * m_pProxyEditor;
protected slots:
	void useDefaultInitUModeToggled(bool);
	void portEditorTextChanged(const TQString &);
	void useIPV6CheckToggled(bool);
public:
	void setHeaderLabelText();
	void fillData(KviIrcServer *s);
};


#define KVI_OPTIONS_WIDGET_ICON_KviServerOptionsWidget KVI_SMALLICON_SERVER
#define KVI_OPTIONS_WIDGET_NAME_KviServerOptionsWidget __tr2qs_no_lookup("Servers")
#define KVI_OPTIONS_WIDGET_KEYWORDS_KviServerOptionsWidget __tr2qs_no_lookup("connection")
//#define KVI_OPTIONS_WIDGET_NOPARENT_KviServerOptionsWidget KviConnectionOptionsWidget
#define KVI_OPTIONS_WIDGET_PRIORITY_KviServerOptionsWidget 99000

class KviServerOptionsWidget : public KviOptionsWidget
{
	TQ_OBJECT
  
public:
	KviServerOptionsWidget(TQWidget * parent);
	~KviServerOptionsWidget();
protected:
	KviTalListView                    * m_pListView;
	TQLabel                       * m_pSrvNetLabel;
	TQLineEdit                    * m_pSrvNetEdit;
	//TQLabel                       * m_pPortLabel;
	//TQLineEdit                    * m_pPortEdit;
	TQPushButton                  * m_pDetailsButton;
	KviTalPopupMenu                   * m_pRecentPopup;
	KviTalPopupMenu                   * m_pContextPopup;
	KviTalPopupMenu                   * m_pImportPopup;
	KviIrcServer                 * m_pClipboard;
	//TQCheckBox                    * m_pIpV6Check;
	TQPushButton                  * m_pConnectCurrent;
	TQPushButton                  * m_pConnectNew;
	KviServerOptionsListViewItem * m_pLastEditedItem;
	KviServerDetailsWidget       * m_pServerDetailsDialog;
	KviNetworkDetailsWidget      * m_pNetworkDetailsDialog;
	KviMexServerImport           * m_pImportFilter;

	TQToolButton                  * m_pNewServerButton;
	TQToolButton                  * m_pNewNetworkButton;
	TQToolButton                  * m_pRemoveButton;
	TQToolButton                  * m_pCopyServerButton;
	TQToolButton                  * m_pPasteServerButton;
	TQToolButton                  * m_pImportButton;
private:
	void fillServerList();
	void saveLastItem();
	KviServerOptionsListViewItem * findNetItem(const char * netname);
protected slots:
	void importerDead();
	void importServer(const KviIrcServer & s,const char * network);
	void importPopupAboutToShow();
	void listViewItemSelectionChanged(KviTalListViewItem *it);
	void listViewRightButtonPressed(KviTalListViewItem *it,const TQPoint &pnt,int col);
	void newNetwork();
	void removeCurrent();
	void newServer();
	void copyServer();
	void pasteServer();
	void clearList();
	void detailsClicked();
	void connectCurrentClicked();
	void recentServersPopupAboutToShow();
	void recentServersPopupClicked(int id);
	void importPopupActivated(int id);
public:
	virtual void commit();
};

#endif //!_OPTW_SERVERS_H_