aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/options/optw_servers.cpp
diff options
context:
space:
mode:
authorGravatar Elvio Basello2008-04-08 23:46:37 +0000
committerGravatar Elvio Basello2008-04-08 23:46:37 +0000
commit86fc13a3dabbc218896247605a75f0c847af7839 (patch)
treeec82ccf45e579411219600493b4b3c03fea16f74 /src/modules/options/optw_servers.cpp
parentTODO-cmake update (diff)
downloadKVIrc-86fc13a3dabbc218896247605a75f0c847af7839.tar.gz
KVIrc-86fc13a3dabbc218896247605a75f0c847af7839.tar.bz2
KVIrc-86fc13a3dabbc218896247605a75f0c847af7839.zip
more code clean
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1440 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/options/optw_servers.cpp')
-rw-r--r--src/modules/options/optw_servers.cpp218
1 files changed, 56 insertions, 162 deletions
diff --git a/src/modules/options/optw_servers.cpp b/src/modules/options/optw_servers.cpp
index cf806c504..0acdeaecd 100644
--- a/src/modules/options/optw_servers.cpp
+++ b/src/modules/options/optw_servers.cpp
@@ -24,6 +24,8 @@
#include "optw_servers.h"
#include "optw_proxy.h"
+#include "optw_nickserv.h" // for the NickServ rule editor
+
#include "kvi_query.h"
#include "kvi_channel.h"
#include "kvi_locale.h"
@@ -36,7 +38,6 @@
#include "kvi_config.h"
#include "kvi_scripteditor.h"
#include "kvi_options.h"
-
#include "kvi_app.h"
#include "kvi_console.h"
#include "kvi_ircurl.h"
@@ -46,25 +47,22 @@
#include "kvi_msgbox.h"
#include "kvi_mexserverimport.h"
#include "kvi_nickserv.h"
-#include "optw_nickserv.h" // for the NickServ rule editor
#include "kvi_proxydb.h"
#include "kvi_kvs_script.h"
#include "kvi_styled_controls.h"
-
-#include <qtoolbutton.h>
-#include <qlineedit.h>
-#include <qcheckbox.h>
+#include "kvi_pointerhashtable.h"
#include "kvi_tal_popupmenu.h"
-#include <qcursor.h>
#include "kvi_tal_tooltip.h"
-#include <qvalidator.h>
-#include <qmessagebox.h>
-#include "kvi_pointerhashtable.h"
-#include <qcombobox.h>
-#include <qbuttongroup.h>
-#include <qmessagebox.h>
-#include <qinputdialog.h>
-#include <qmessagebox.h>
+
+#include <QToolButton>
+#include <QLineEdit>
+#include <QCheckBox>
+#include <QCursor>
+#include <QValidator>
+#include <QMessageBox>
+#include <QComboBox>
+#include <QButtonGroup>
+#include <QInputDialog>
KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n)
@@ -112,9 +110,7 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
m_pDescEditor = new QLineEdit(this);
g->addMultiCellWidget(m_pDescEditor,1,1,1,3);
m_pDescEditor->setText(n->description());
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pDescEditor,__tr2qs_ctx("<center>Put here a brief description of the network.</center>","options"));
-#endif
// Identity tab
@@ -130,41 +126,34 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
l = new QLabel(__tr2qs_ctx("Username:","options"),gbox);
m_pUserEditor = new QLineEdit(gbox);
m_pUserEditor->setText(n->userName());
-#ifdef COMPILE_INFO_TIPS
+
KviTalToolTip::add(m_pUserEditor,__tr2qs_ctx("<center>This is the <b>username</b> that KVIrc will use to login to servers on this network.\n" \
- "If this field is left empty (most common case), KVIrc will use the default username " \
- "specified in the \"Identity\" options tab.</center>","options"));
-#endif
+ "If this field is left empty (most common case), KVIrc will use the default username " \
+ "specified in the \"Identity\" options tab.</center>","options"));
+
l = new QLabel(__tr2qs_ctx("Nickname:","options"),gbox);
m_pNickEditor = new QLineEdit(gbox);
QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*","options"),gbox);
m_pNickEditor->setValidator(v);
m_pNickEditor->setText(n->nickName());
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pNickEditor,__tr2qs_ctx("<center>You can specify a \"special\" <b>nickname</b> that will be used to log in to the servers on this network.<br>" \
- "If this field is left empty (most common case), the default nickname (specified in the \"Identity\" settings) will be used.</center>","options"));
-#endif
+ "If this field is left empty (most common case), the default nickname (specified in the \"Identity\" settings) will be used.</center>","options"));
l = new QLabel(__tr2qs_ctx("Real name:","options"),gbox);
m_pRealEditor = new QLineEdit(gbox);
m_pRealEditor->setText(n->realName());
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pRealEditor,__tr2qs_ctx("<center>You can specify a \"special\" <b>real name</b> that will be used to login with the servers on this network.<br>" \
- "If you leave this field empty (most common case), the default \"real name\" (specified in the \"Identity\" settings) will be used.</center>","options"));
-#endif
-
+ "If you leave this field empty (most common case), the default \"real name\" (specified in the \"Identity\" settings) will be used.</center>","options"));
l = new QLabel(__tr2qs_ctx("Encoding:","options"),tab);
gl->addWidget(l,1,0);
m_pEncodingEditor = new QComboBox(false,tab);
m_pEncodingEditor->setDuplicatesEnabled(false);
gl->addWidget(m_pEncodingEditor,1,1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pEncodingEditor,__tr2qs_ctx("<center>This box allows you to choose the preferred encoding for the servers in this network. " \
- "If you choose \"Use System Encoding\" then the encoding will be set to the systemwide " \
- "value that you choose in the \"Encoding\" page of the options dialog.</center>","options"));
-#endif
+ "If you choose \"Use System Encoding\" then the encoding will be set to the systemwide " \
+ "value that you choose in the \"Encoding\" page of the options dialog.</center>","options"));
int i = 0;
int current = 0;
@@ -185,9 +174,7 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
m_pAutoConnectCheck = new KviStyledCheckBox(__tr2qs_ctx("Connect to this network at startup","options"),tab);
m_pAutoConnectCheck->setChecked(n->autoConnect());
gl->addMultiCellWidget(m_pAutoConnectCheck,2,2,0,1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pAutoConnectCheck,__tr2qs_ctx("<center>This option will cause KVIrc to automatically connect to this network at startup</center>","options"));
-#endif
l = new QLabel("",tab);
@@ -207,11 +194,11 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
m_lstChannels = *(n->autoJoinChannelList());
m_pChannelListSelector = new KviCahnnelListSelector(tab,
__tr2qs_ctx("Channels to join automatically upon connect:","options"),&m_lstChannels,true);
-#ifdef COMPILE_INFO_TIPS
- KviTalToolTip::add(m_pChannelListSelector,__tr2qs_ctx("<center>Here you can set a list of channels to be joined automatically " \
+
+ KviTalToolTip::add(m_pChannelListSelector,__tr2qs_ctx("<center>Here you can set a list of channels to be joined automatically " \
"after a connection to a server in this network has been established. To add a channel, type its name in the " \
"text input below and click \"<b>Add</b>\".</center>","options"));
-#endif
+
gl->addWidget(m_pChannelListSelector,0,0);
tw->addTab(tab,__tr2qs_ctx("Join Channels","options"));
@@ -224,12 +211,10 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
gl->addWidget(m_pOnConnectEditor,0,0);
m_pOnConnectEditor->setText(n->onConnectCommand());
m_pOnConnectEditor->setMinimumHeight(150);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pOnConnectEditor,__tr2qs_ctx("<center>The following commands will be executed after a connection to a server in this network has been established.<br>" \
"<b>Important:</b> Enter commands <b>without</b> a preceding slash (e.g. <tt>quote pass secret</tt> instead of <tt>/quote pass secret</tt>).<br>"\
"KVIrc will first send the USER command, then eventually PASS and NICK and then execute this " \
"command sequence.</center>","options"));
-#endif
tw->addTab(tab,__tr2qs_ctx("On Connect","options"));
@@ -244,12 +229,10 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
m_pOnLoginEditor->setMinimumHeight(150);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pOnLoginEditor,
- __tr2qs_ctx("<center>The following commands will be executed after a successful login to a server in this network.<br>" \
- "<b>Important:</b> Enter commands <b>without</b> a preceding slash (e.g. <tt>quote privatelog</tt> instead of <tt>/quote privatelog</tt>).<br>"
- "This is useful for automatically opening queries, setting variables, etc.</center>","options"));
-#endif
+ __tr2qs_ctx("<center>The following commands will be executed after a successful login to a server in this network.<br>" \
+ "<b>Important:</b> Enter commands <b>without</b> a preceding slash (e.g. <tt>quote privatelog</tt> instead of <tt>/quote privatelog</tt>).<br>"
+ "This is useful for automatically opening queries, setting variables, etc.</center>","options"));
tw->addTab(tab,__tr2qs_ctx("On Login","options"));
@@ -264,10 +247,8 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
m_pNickServCheck = new KviStyledCheckBox(__tr2qs_ctx("Enable NickServ Identification","options"),tab);
gl->addMultiCellWidget(m_pNickServCheck,0,0,0,2);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pNickServCheck,
__tr2qs_ctx("This check enables the automatic identification with NickServ","options"));
-#endif
m_pNickServCheck->setChecked(bNickServEnabled);
m_pNickServListView = new KviTalListView(tab);
@@ -280,7 +261,6 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
connect(m_pNickServListView,SIGNAL(selectionChanged()),this,SLOT(enableDisableNickServControls()));
gl->addMultiCellWidget(m_pNickServListView,1,1,0,2);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pNickServListView,
__tr2qs_ctx("<center>This is a list of NickServ identification rules. " \
"KVIrc will use them to model its automatic interaction with NickServ on this network.<br>" \
@@ -288,7 +268,6 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
"if used improperly. Make sure that you fully understand the NickServ authentication protocol.<br>" \
"In other words, be sure to know what you're doing.<br>" \
"Also note that the password that you provide is stored as <b>PLAIN TEXT</b>.</center>","options"));
-#endif
m_pAddRuleButton = new QPushButton(__tr2qs_ctx("Add Rule","options"),tab);
connect(m_pAddRuleButton,SIGNAL(clicked()),this,SLOT(addNickServRule()));
@@ -331,7 +310,6 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
b->setMinimumWidth(80);
connect(b,SIGNAL(clicked()),this,SLOT(reject()));
-
g->setRowStretch(2,1);
g->setColStretch(1,1);
@@ -339,7 +317,6 @@ KviNetworkDetailsWidget::KviNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n
}
-
KviNetworkDetailsWidget::~KviNetworkDetailsWidget()
{
if(m_pOnConnectEditor) KviScriptEditor::destroyInstance(m_pOnConnectEditor);
@@ -435,11 +412,6 @@ void KviNetworkDetailsWidget::fillData(KviIrcNetwork * n)
}
-
-
-
-
-
KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
: QDialog(par,"server_details",true)
{
@@ -461,10 +433,8 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
m_pDescEditor = new QLineEdit(this);
g->addMultiCellWidget(m_pDescEditor,1,1,1,3);
m_pDescEditor->setText(s->description());
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pDescEditor,__tr2qs_ctx("<center>This is a brief description of this server. " \
- "This field has no restrictions but many server lists use it to describe the server's physical location</center>","options"));
-#endif
+ "This field has no restrictions but many server lists use it to describe the server's physical location</center>","options"));
// Identity tab
@@ -480,48 +450,38 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
l = new QLabel(__tr2qs_ctx("Username:","options"),gbox);
m_pUserEditor = new QLineEdit(gbox);
m_pUserEditor->setText(s->userName());
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pUserEditor,__tr2qs_ctx("<center>This is the <b>username</b> that KVIrc will use to login to this server.\n" \
- "If this field is left empty (most common case), KVIrc will first look if an username is specified " \
- "for the network that this server belongs to, and if that is empty then KVIrc will use the default username " \
- "specified in the \"Identity\" options tab.</center>","options"));
-#endif
+ "If this field is left empty (most common case), KVIrc will first look if an username is specified " \
+ "for the network that this server belongs to, and if that is empty then KVIrc will use the default username " \
+ "specified in the \"Identity\" options tab.</center>","options"));
l = new QLabel(__tr2qs_ctx("Password:","options"),gbox);
m_pPassEditor = new QLineEdit(gbox);
m_pPassEditor->setEchoMode(QLineEdit::Password);
m_pPassEditor->setText(s->password());
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pPassEditor,__tr2qs_ctx("<center>If this server requires a password, put it in this field, otherwise leave it empty.</center>","options"));
-#endif
l = new QLabel(__tr2qs_ctx("Nickname:","options"),gbox);
m_pNickEditor = new QLineEdit(gbox);
QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*"),gbox);
m_pNickEditor->setValidator(v);
m_pNickEditor->setText(s->nickName());
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pNickEditor,__tr2qs_ctx("<center>You can specify a \"special\" <b>nickname</b> that will be used to log in to this server.<br>" \
- "If this field is left empty (most common case), KVIrc will first look if a nickname is specified " \
- "for the network that this server belongs to, and if that is empty then the default nickname (specified in the \"Identity\" settings) will be used.</center>","options"));
-#endif
+ "If this field is left empty (most common case), KVIrc will first look if a nickname is specified " \
+ "for the network that this server belongs to, and if that is empty then the default nickname (specified in the \"Identity\" settings) will be used.</center>","options"));
l = new QLabel(__tr2qs_ctx("Real name:","options"),gbox);
m_pRealEditor = new QLineEdit(gbox);
m_pRealEditor->setText(s->realName());
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pRealEditor,__tr2qs_ctx("<center>You can specify a \"special\" <b>real name</b> that will be used to login with this server.<br>" \
- "If you leave this field empty (most common case), KVIrc will first look if a real name is specified " \
- "for the network that this server belongs to, and if that is empty the default \"real name\" (specified in the \"Identity\" settings) will be used.</center>","options"));
-#endif
+ "If you leave this field empty (most common case), KVIrc will first look if a real name is specified " \
+ "for the network that this server belongs to, and if that is empty the default \"real name\" (specified in the \"Identity\" settings) will be used.</center>","options"));
gbox = new KviTalGroupBox(1,Qt::Horizontal,__tr2qs_ctx("User Mode","options"),tab);
gl->addWidget(gbox,1,0);
m_pUseDefaultInitUMode = new KviStyledCheckBox(__tr2qs_ctx("Use default user mode","options"),gbox);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pUseDefaultInitUMode,__tr2qs_ctx("<center>If this is enabled, the global initial <b>user mode</b> (configured from"\
- " the identity dialog) will be used. If disabled, you can configure an initial user mode for this server","options"));
-#endif
+ " the identity dialog) will be used. If disabled, you can configure an initial user mode for this server","options"));
bool bHasUmode = !(s->initUMode().isEmpty());
KviStr szDefUMode = KVI_OPTION_STRING(KviOption_stringDefaultUserMode);
m_pUseDefaultInitUMode->setChecked(!bHasUmode);
@@ -561,9 +521,7 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
QString tmpz;
tmpz.setNum(s->port());
m_pPortEditor->setText(tmpz);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pPortEditor,__tr2qs_ctx("<center>This is the default <b>port</b> that this server will be contacted on.<br>Usually <b>6667</b> is OK.</center>","options"));
-#endif
connect(m_pPortEditor,SIGNAL(textChanged(const QString &)),this,SLOT(portEditorTextChanged(const QString &)));
@@ -572,12 +530,10 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
gl->addWidget(l,1,0);
m_pIpEditor = new KviIpEditor(tab,KviIpEditor::IpV4);
gl->addWidget(m_pIpEditor,1,1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pIpEditor,__tr2qs_ctx("<center>This is the <b>IP address</b> of this server, it is here for caching purposes.<br>" \
- "If you leave this field empty, KVIrc will fill it in the first time it connects to the server. " \
- "If you enable the \"cache IP address\" option below, KVIrc will use it as a \"cached result\" " \
- "and avoid looking it up again.</center>","options"));
-#endif
+ "If you leave this field empty, KVIrc will fill it in the first time it connects to the server. " \
+ "If you enable the \"cache IP address\" option below, KVIrc will use it as a \"cached result\" " \
+ "and avoid looking it up again.</center>","options"));
#ifdef COMPILE_IPV6_SUPPORT
m_pIpEditor->setAddressType(s->isIpV6() ? KviIpEditor::IpV6 : KviIpEditor::IpV4);
#else
@@ -595,14 +551,12 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
m_pCacheIpCheck = new KviStyledCheckBox(__tr2qs_ctx("Cache IP address","options"),tab);
gl->addMultiCellWidget(m_pCacheIpCheck,2,2,0,1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pCacheIpCheck,__tr2qs_ctx("<center>This check will enable <b>IP address caching</b> for this server:<br>" \
- "DNS lookups can be time-consuming and might be blocking on some platforms; " \
- "this option will cause KVIrc to look up the server hostname only once.<br><br> " \
- "Advanced: you can also use this option to force a certain server name to resolve " \
- "to a fixed ip address when either the dns for that server is temporairly " \
- "unreachable or you want to avoid the round-robin lookups.</center>","options"));
-#endif
+ "DNS lookups can be time-consuming and might be blocking on some platforms; " \
+ "this option will cause KVIrc to look up the server hostname only once.<br><br> " \
+ "Advanced: you can also use this option to force a certain server name to resolve " \
+ "to a fixed ip address when either the dns for that server is temporairly " \
+ "unreachable or you want to avoid the round-robin lookups.</center>","options"));
m_pCacheIpCheck->setChecked(s->cacheIp());
@@ -615,18 +569,13 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
#endif
connect(m_pUseIPV6Check,SIGNAL(toggled(bool)),this,SLOT(useIPV6CheckToggled(bool)));
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pUseIPV6Check,__tr2qs_ctx("<center>This check identifies IPv6 servers.<br>If enabled, KVIrc will attempt to use the IPv6 protocol " \
- "(thus your OS <b>must</b> have a working IPv6 stack and you <b>must</b> have an IPv6 connection).</center>","options"));
-#endif
-
+ "(thus your OS <b>must</b> have a working IPv6 stack and you <b>must</b> have an IPv6 connection).</center>","options"));
m_pUseSSLCheck = new KviStyledCheckBox(__tr2qs_ctx("Use SSL protocol","options"),tab);
gl->addMultiCellWidget(m_pUseSSLCheck,4,4,0,1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pUseSSLCheck,__tr2qs_ctx("<center>This check will cause the connection to use the <b>Secure Socket Layer</b> " \
- "encryption support. Obviously, this server must have support for this, too. :)</center>","options"));
-#endif
+ "encryption support. Obviously, this server must have support for this, too. :)</center>","options"));
#ifndef COMPILE_SSL_SUPPORT
m_pUseSSLCheck->setEnabled(false);
#endif
@@ -637,20 +586,16 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
m_pUseAutoConnect->setChecked(s->autoConnect());
gl->addMultiCellWidget(m_pUseAutoConnect,5,5,0,1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pUseAutoConnect,__tr2qs_ctx("<center>This option will cause KVIrc to connect to the IRC server when it is started.</center>","options"));
-#endif
l = new QLabel(__tr2qs_ctx("Encoding:","options"),tab);
gl->addWidget(l,6,0);
m_pEncodingEditor = new QComboBox(false,tab);
m_pEncodingEditor->setDuplicatesEnabled(false);
gl->addWidget(m_pEncodingEditor,6,1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pEncodingEditor,__tr2qs_ctx("<center>This box allows you to choose the preferred encoding for this sever. " \
- "If you choose \"Use Network Encoding\" then the encoding will be inherited from the " \
- "network that this server belongs to.</center>","options"));
-#endif
+ "If you choose \"Use Network Encoding\" then the encoding will be inherited from the " \
+ "network that this server belongs to.</center>","options"));
int i = 0;
int current = 0;
@@ -697,10 +642,8 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
m_pLinkFilterEditor->setCurrentText("");
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pLinkFilterEditor,__tr2qs_ctx("<center>This field specifies the name of a module that exports a link filter for this type of server.<br>" \
"For plain IRC connections, you don't need any link filters; this is used for incompatible protocols.</center>","options"));
-#endif
l = new QLabel(__tr2qs_ctx("Id:","options"),tab);
gl->addWidget(l,8,0);
@@ -709,22 +652,18 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
m_pIdEditor->setText(s->id());
gl->addWidget(m_pIdEditor,8,1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pIdEditor,__tr2qs_ctx("<center>This field allows you to specify a really unique id for this server. " \
"You will then be able to use /server -x &lt;this_id&gt; to make the connection. This is especially " \
"useful when you have multiple server entries with the same hostname and port in different networks (bouncers?)</center>","options"));
-#endif
l = new QLabel(__tr2qs_ctx("Proxy server:","options"),tab);
gl->addWidget(l,9,0);
m_pProxyEditor = new QComboBox(tab);
gl->addWidget(m_pProxyEditor,9,1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pProxyEditor,__tr2qs_ctx("<center>This is the <b>proxy</b> that KVIrc will use to connect to thos server.\n" \
- "If this field is set in \"Default\" KVirc will use global proxy settings, if it is set in \"Direct connection\" " \
- "KVirc will connect to this server without proxy. You can define new proxy server in global options' \"Proxy servers\" menu.</center>","options"));
-#endif
+ "If this field is set in \"Default\" KVirc will use global proxy settings, if it is set in \"Direct connection\" " \
+ "KVirc will connect to this server without proxy. You can define new proxy server in global options' \"Proxy servers\" menu.</center>","options"));
m_pProxyEditor->insertItem(__tr2qs_ctx("Default","options"));
m_pProxyEditor->insertItem(__tr2qs_ctx("Direct connection","options"));
@@ -754,11 +693,9 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
m_lstChannels = *(s->autoJoinChannelList());
m_pChannelListSelector = new KviCahnnelListSelector(tab,
__tr2qs_ctx("Channels to join automatically upon connect:","options"),&m_lstChannels,true);
-#ifdef COMPILE_INFO_TIPS
- KviTalToolTip::add(m_pChannelListSelector,__tr2qs_ctx("<center>Here you can set a list of channels to be joined automatically " \
+ KviTalToolTip::add(m_pChannelListSelector,__tr2qs_ctx("<center>Here you can set a list of channels to be joined automatically " \
"after a connection to this server has been established. To add a channel, type its name in the " \
"text input below and click \"<b>Add</b>\".</center>","options"));
-#endif
gl->addWidget(m_pChannelListSelector,0,0);
tw->addTab(tab,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)),__tr2qs_ctx("Join Channels","options"));
@@ -772,12 +709,10 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
gl->addWidget(m_pOnConnectEditor,0,0);
m_pOnConnectEditor->setText(s->onConnectCommand());
m_pOnConnectEditor->setMinimumHeight(150);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pOnConnectEditor,__tr2qs_ctx("<center>The following commands will be executed after a connection has been established.<br>" \
"<b>Important:</b> Enter commands <b>without</b> a preceding slash (e.g. <tt>quote pass secret</tt> instead of <tt>/quote pass secret</tt>).<br>"\
"KVIrc will first send the USER command, then eventually PASS and NICK and then execute this " \
"command sequence.<br>This is particularly useful for IRC bouncers that require login commands.</center>","options"));
-#endif
tw->addTab(tab,__tr2qs_ctx("On Connect","options"));
// after login execute
@@ -791,12 +726,10 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviIrcServer * s)
m_pOnLoginEditor->setMinimumHeight(150);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pOnLoginEditor,
- __tr2qs_ctx("<center>The following commands will be executed after a successful login to this server.<br>" \
- "<b>Important:</b> Enter commands <b>without</b> a preceding slash (e.g. <tt>quote privatelog</tt> instead of <tt>/quote privatelog</tt>).<br>"
- "This is useful for automatically opening queries, setting variables, etc.</center>","options"));
-#endif
+ __tr2qs_ctx("<center>The following commands will be executed after a successful login to this server.<br>" \
+ "<b>Important:</b> Enter commands <b>without</b> a preceding slash (e.g. <tt>quote privatelog</tt> instead of <tt>/quote privatelog</tt>).<br>"
+ "This is useful for automatically opening queries, setting variables, etc.</center>","options"));
tw->addTab(tab,__tr2qs_ctx("On Login","options"));
@@ -1015,12 +948,6 @@ void KviServerOptionsListViewItem::updateVisibleStrings()
}
-
-
-
-
-
-
KviServerOptionsWidget::KviServerOptionsWidget(QWidget * parent)
: KviOptionsWidget(parent,"server_options_widget")
{
@@ -1050,13 +977,11 @@ KviServerOptionsWidget::KviServerOptionsWidget(QWidget * parent)
connect(m_pListView,SIGNAL(doubleClicked(KviTalListViewItem*, const QPoint&, int )),
this,SLOT(detailsClicked()));
-#ifdef COMPILE_INFO_TIPS
QString tiptxt = __tr2qs_ctx("<center>This is the list of available IRC servers.<br>" \
- "Right-click on the list to add or remove servers and perform other actions.<br>"\
- "Double-click on a item for advanced options.</center>","options");
+ "Right-click on the list to add or remove servers and perform other actions.<br>"\
+ "Double-click on a item for advanced options.</center>","options");
KviTalToolTip::add(m_pListView,tiptxt);
KviTalToolTip::add(m_pListView->viewport(),tiptxt);
-#endif
KviTalVBox * vbox = new KviTalVBox(this);
addWidgetToLayout(vbox,1,0,1,0);
@@ -1065,26 +990,20 @@ KviServerOptionsWidget::KviServerOptionsWidget(QWidget * parent)
m_pNewNetworkButton->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_WORLD)));
m_pNewNetworkButton->setAutoRaise(true);
connect(m_pNewNetworkButton,SIGNAL(clicked()),this,SLOT(newNetwork()));
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pNewNetworkButton,__tr2qs_ctx("New Network","options"));
-#endif
m_pNewServerButton = new KviStyledToolButton(vbox);
m_pNewServerButton->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SERVER)));
m_pNewServerButton->setAutoRaise(true);
connect(m_pNewServerButton,SIGNAL(clicked()),this,SLOT(newServer()));
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pNewServerButton,__tr2qs_ctx("New Server","options"));
-#endif
m_pRemoveButton = new KviStyledToolButton(vbox);
m_pRemoveButton->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CUT)));
m_pRemoveButton->setEnabled(false);
m_pRemoveButton->setAutoRaise(true);
connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeCurrent()));
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pRemoveButton,__tr2qs_ctx("Remove Network/Server","options"));
-#endif
QFrame * f = new QFrame(vbox);
f->setFrameStyle(QFrame::Sunken | QFrame::HLine);
@@ -1094,18 +1013,14 @@ KviServerOptionsWidget::KviServerOptionsWidget(QWidget * parent)
m_pCopyServerButton->setEnabled(false);
m_pCopyServerButton->setAutoRaise(true);
connect(m_pCopyServerButton,SIGNAL(clicked()),this,SLOT(copyServer()));
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pCopyServerButton,__tr2qs_ctx("Copy Server","options"));
-#endif
m_pPasteServerButton = new KviStyledToolButton(vbox);
m_pPasteServerButton->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_PASTE)));
m_pPasteServerButton->setEnabled(false);
m_pPasteServerButton->setAutoRaise(true);
connect(m_pPasteServerButton,SIGNAL(clicked()),this,SLOT(pasteServer()));
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pPasteServerButton,__tr2qs_ctx("Paste Server","options"));
-#endif
f = new QFrame(vbox);
f->setFrameStyle(QFrame::Sunken | QFrame::HLine);
@@ -1115,9 +1030,7 @@ KviServerOptionsWidget::KviServerOptionsWidget(QWidget * parent)
m_pImportButton->setAutoRaise(true);
m_pImportButton->setPopup(m_pImportPopup);
m_pImportButton->setPopupDelay(1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pImportButton,__tr2qs_ctx("Import List","options"));
-#endif
QFrame * lll = new QFrame(vbox);
vbox->setStretchFactor(lll,100);
@@ -1126,9 +1039,7 @@ KviServerOptionsWidget::KviServerOptionsWidget(QWidget * parent)
m_pSrvNetLabel = new QLabel(__tr2qs_ctx("Server:","options"),gbox);
m_pSrvNetEdit = new QLineEdit(gbox);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pSrvNetEdit,__tr2qs_ctx("<center>This is the name of the currently selected server or network</center>","options"));
-#endif
/*
m_pIpV6Check = new KviStyledCheckBox(__tr2qs_ctx("Use IPv6 protocol","options"),gbox);
@@ -1137,32 +1048,24 @@ KviServerOptionsWidget::KviServerOptionsWidget(QWidget * parent)
m_pIpV6Check->setEnabled(false);
#endif
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pIpV6Check,__tr2qs_ctx("<center>This check identifies IPv6 servers.<br>If enabled, KVIrc will attempt to use the IPv6 protocol " \
"(thus your OS <b>must</b> have a working IPv6 stack and you <b>must</b> have an IPv6 connection).</center>","options"));
-#endif
m_pPortLabel = new QLabel(__tr2qs_ctx("Port:","options"),gbox);
m_pPortEdit = new QLineEdit(gbox);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pPortEdit,__tr2qs_ctx("<center>This is the default <b>port</b> that this server will be contacted on.<br>Usually <b>6667</b> is OK.</center>","options"));
-#endif
*/
m_pDetailsButton = new QPushButton(__tr2qs_ctx("Advanced...","options"),gbox);
connect(m_pDetailsButton,SIGNAL(clicked()),this,SLOT(detailsClicked()));
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pDetailsButton,__tr2qs_ctx("<center>Click here to edit advanced options for this entry</center>","options"));
-#endif
m_pConnectCurrent = new QPushButton(__tr2qs_ctx("Connect &Now","options"),this);
addWidgetToLayout(m_pConnectCurrent,0,2,0,2);
connect(m_pConnectCurrent,SIGNAL(clicked()),this,SLOT(connectCurrentClicked()));
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(m_pConnectCurrent,__tr2qs_ctx("<center>Hit this button to connect to the currently selected server.</center>","options"));
-#endif
m_pRecentPopup = new KviTalPopupMenu(this);
connect(m_pRecentPopup,SIGNAL(aboutToShow()),this,SLOT(recentServersPopupAboutToShow()));
@@ -1173,16 +1076,11 @@ KviServerOptionsWidget::KviServerOptionsWidget(QWidget * parent)
tb->setPixmap(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_TIME)));
tb->setPopup(m_pRecentPopup);
tb->setPopupDelay(1);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(tb,__tr2qs_ctx("<center>This button shows a list of recently used servers. It allows you to quickly find them in the list.</center>","options"));
-#endif
-
KviBoolSelector * b = addBoolSelector(0,3,1,3,__tr2qs_ctx("Show this dialog at startup","options"),KviOption_boolShowServersConnectDialogOnStart);
-#ifdef COMPILE_INFO_TIPS
KviTalToolTip::add(b,__tr2qs_ctx("<center>If this option is enabled, the Servers dialog will appear every time you start KVIrc</center>","options"));
-#endif
// KviBoolSelector * c = addBoolSelector(0,6,2,6,__tr("Close after connection","options"),KviOption_boolCloseServerWidgetAfterConnect);
@@ -1272,7 +1170,6 @@ void KviServerOptionsWidget::recentServersPopupClicked(int id)
}
}
-
void KviServerOptionsWidget::connectCurrentClicked()
{
saveLastItem();
@@ -1282,7 +1179,6 @@ void KviServerOptionsWidget::connectCurrentClicked()
KviKvsScript::run("server -u",g_pApp->activeConsole());
}
-
void KviServerOptionsWidget::fillServerList()
{
KviServerOptionsListViewItem * net;
@@ -1347,8 +1243,6 @@ void KviServerOptionsWidget::listViewItemSelectionChanged(KviTalListViewItem *it
}
}
-
-
void KviServerOptionsWidget::saveLastItem()
{
if(!m_pLastEditedItem)return;