diff options
| author | 2010-05-28 19:28:28 +0000 | |
|---|---|---|
| committer | 2010-05-28 19:28:28 +0000 | |
| commit | 0f6b9eadf1682b494785f5a9e8e45f2e8211e1c1 (patch) | |
| tree | 98a65e1fa37ac6f64e041bf9af930e561ea93765 /src/modules | |
| parent | Reworked the initial CAP LS/REQ machinery so it actually (diff) | |
| download | KVIrc-0f6b9eadf1682b494785f5a9e8e45f2e8211e1c1.tar.gz KVIrc-0f6b9eadf1682b494785f5a9e8e45f2e8211e1c1.tar.bz2 KVIrc-0f6b9eadf1682b494785f5a9e8e45f2e8211e1c1.zip | |
Some work on the server options dialog.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4392 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/options/optw_servers.cpp | 141 |
1 files changed, 96 insertions, 45 deletions
diff --git a/src/modules/options/optw_servers.cpp b/src/modules/options/optw_servers.cpp index dbf5faa7e..592c72c6c 100644 --- a/src/modules/options/optw_servers.cpp +++ b/src/modules/options/optw_servers.cpp @@ -570,25 +570,29 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s) // Connection tab + int iRow = 0; + tab = new QWidget(tw); gl = new QGridLayout(tab); l = new QLabel(__tr2qs_ctx("Port:","options"),tab); - gl->addWidget(l,0,0); + gl->addWidget(l,iRow,0); m_pPortEditor = new QLineEdit(tab); - gl->addWidget(m_pPortEditor,0,1); + gl->addWidget(m_pPortEditor,iRow,1); QString tmpz; tmpz.setNum(s->port()); m_pPortEditor->setText(tmpz); 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")); connect(m_pPortEditor,SIGNAL(textChanged(const QString &)),this,SLOT(portEditorTextChanged(const QString &))); + iRow++; + l = new QLabel(__tr2qs_ctx("IP address:","options"),tab); - gl->addWidget(l,1,0); + gl->addWidget(l,iRow,0); m_pIpEditor = new KviIpEditor(tab,KviIpEditor::IPv4); - gl->addWidget(m_pIpEditor,1,1); + gl->addWidget(m_pIpEditor,iRow,1); 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\" " \ @@ -608,8 +612,13 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s) #endif } + iRow++; + + QGridLayout * pCheckBoxLayout = new QGridLayout(); + gl->addLayout(pCheckBoxLayout,iRow,0,1,2); + m_pCacheIpCheck = new QCheckBox(__tr2qs_ctx("Cache IP address","options"),tab); - gl->addWidget(m_pCacheIpCheck,2,0,1,2); + pCheckBoxLayout->addWidget(m_pCacheIpCheck,0,0); 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; " \ @@ -619,8 +628,20 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s) "unreachable or you want to avoid the round-robin lookups.</center>","options")); m_pCacheIpCheck->setChecked(s->cacheIp()); + + + + m_pUseAutoConnect = new QCheckBox(__tr2qs_ctx("Connect to this server at startup","options"),tab); + m_pUseAutoConnect->setChecked(s->autoConnect()); + + pCheckBoxLayout->addWidget(m_pUseAutoConnect,0,1); + + KviTalToolTip::add(m_pUseAutoConnect,__tr2qs_ctx("<center>This option will cause KVIrc to connect to the IRC server when it is started.</center>","options")); + + + m_pUseIPV6Check = new QCheckBox(__tr2qs_ctx("Use IPv6 protocol","options"),tab); - gl->addWidget(m_pUseIPV6Check,3,0,1,2); + pCheckBoxLayout->addWidget(m_pUseIPV6Check,1,0); #ifdef COMPILE_IPV6_SUPPORT m_pUseIPV6Check->setChecked(s->isIPv6()); @@ -632,8 +653,11 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s) 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")); + + + m_pUseSSLCheck = new QCheckBox(__tr2qs_ctx("Use SSL protocol","options"),tab); - gl->addWidget(m_pUseSSLCheck,4,0,1,2); + pCheckBoxLayout->addWidget(m_pUseSSLCheck,1,1); 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")); @@ -642,49 +666,85 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s) #endif m_pUseSSLCheck->setChecked(s->useSSL()); + + m_pEnableCAPCheck = new QCheckBox(__tr2qs_ctx("Use CAP protocol","options"),tab); - gl->addWidget(m_pEnableCAPCheck,5,0,1,2); + pCheckBoxLayout->addWidget(m_pEnableCAPCheck,2,0); KviTalToolTip::add(m_pEnableCAPCheck,__tr2qs_ctx("<center>This check will cause the connection to use the <b>Extended Capability</b> " \ "support. Obviously, this server must have support for this, too. Disable this for irc bouncers.</center>","options")); m_pEnableCAPCheck->setChecked(s->enabledCAP()); + + m_pEnableSTARTTLSCheck = new QCheckBox(__tr2qs_ctx("Enable STARTTLS protocol","options"),tab); - gl->addWidget(m_pEnableSTARTTLSCheck,6,0,1,2); + pCheckBoxLayout->addWidget(m_pEnableSTARTTLSCheck,2,1); + m_pEnableSTARTTLSCheck->setEnabled(s->enabledCAP()); + QObject::connect(m_pEnableCAPCheck,SIGNAL(toggled(bool)),m_pEnableSTARTTLSCheck,SLOT(setEnabled(bool))); KviTalToolTip::add(m_pEnableSTARTTLSCheck,__tr2qs_ctx("<center>This check enables the use of the <b>Transport Layer Security</b> " \ "protocol. If you enable the proper global option in the Connection/SSL tab, the TLS protocol will be used for this server if available.</center>","options")); #ifndef COMPILE_SSL_SUPPORT m_pEnableSTARTTLSCheck->setEnabled(false); #endif - m_pEnableSTARTTLSCheck->setChecked(s->enabledSTARTTLS()); + m_pEnableSTARTTLSCheck->setChecked(s->enabledCAP() && s->enabledSTARTTLS()); - m_pUseAutoConnect = new QCheckBox(__tr2qs_ctx("Connect to this server at startup","options"),tab); - m_pUseAutoConnect->setChecked(s->autoConnect()); + iRow++; + + + QGroupBox * pSASLGroup = new QGroupBox(__tr2qs_ctx("SASL Authentication","options"),tab); + gl->addWidget(pSASLGroup,iRow,0,1,2); + + QGridLayout * pSASLLayout = new QGridLayout(pSASLGroup); + + m_pEnableSASLCheck = new QCheckBox(__tr2qs_ctx("Enable SASL authentication","options"),pSASLGroup); + pSASLLayout->addWidget(m_pEnableSASLCheck,0,0,1,2); + KviTalToolTip::add(m_pEnableSASLCheck,__tr2qs_ctx("<center>This check enables the use of the <b>SASL</b> authentication procotol " \ + "If you enable the proper global option in the Connection/SSL tab and fill the Sasl Nickname and Sasl Password fields in this page, the SASL protocol will be used for this server if available.</center>","options")); + m_pEnableSASLCheck->setChecked(s->enabledSASL()); + + l = new QLabel(__tr2qs_ctx("Sasl Nickname:","options"),pSASLGroup); + pSASLLayout->addWidget(l,1,0); + m_pSaslNickEditor = new QLineEdit(pSASLGroup); + m_pSaslNickEditor->setText(s->saslNick()); + KviTalToolTip::add(m_pSaslNickEditor,__tr2qs_ctx("<center>If you want to enable SASL authentication, insert your nickname here.</center>","options")); + pSASLLayout->addWidget(m_pSaslNickEditor,1,1); + + l = new QLabel(__tr2qs_ctx("Sasl Password:","options"),pSASLGroup); + pSASLLayout->addWidget(l,2,0); + m_pSaslPassEditor = new KviPasswordLineEdit(pSASLGroup); // <---- ????? + m_pSaslPassEditor->setText(s->saslPass()); + KviTalToolTip::add(m_pSaslPassEditor,__tr2qs_ctx("<center>If you want to enable SASL authentication, insert your password here.</center>","options")); + pSASLLayout->addWidget(m_pSaslPassEditor,2,1); + + pSASLGroup->setEnabled(s->enabledCAP()); + QObject::connect(m_pEnableCAPCheck,SIGNAL(toggled(bool)),pSASLGroup,SLOT(setEnabled(bool))); + + iRow++; - gl->addWidget(m_pUseAutoConnect,7,0,1,2); - KviTalToolTip::add(m_pUseAutoConnect,__tr2qs_ctx("<center>This option will cause KVIrc to connect to the IRC server when it is started.</center>","options")); //server encoding - l = new QLabel(__tr2qs_ctx("Server Encoding:","options"),tab); - gl->addWidget(l,8,0); + l = new QLabel(__tr2qs_ctx("Protocol Encoding:","options"),tab); + gl->addWidget(l,iRow,0); m_pEncodingEditor = new QComboBox(tab); m_pEncodingEditor->setDuplicatesEnabled(false); - gl->addWidget(m_pEncodingEditor,8,1); + gl->addWidget(m_pEncodingEditor,iRow,1); KviTalToolTip::add(m_pEncodingEditor,__tr2qs_ctx("<center>This box allows you to choose the preferred encoding for this server. " \ "This encoding will be used for server specific needs, like referencing nicknames and channel names." \ "If you choose \"Use Network Encoding\" then the encoding will be inherited from the " \ "network that this server belongs to.</center>","options")); + iRow++; + //text encoding l = new QLabel(__tr2qs_ctx("Text Encoding:","options"),tab); - gl->addWidget(l,9,0); + gl->addWidget(l,iRow,0); m_pTextEncodingEditor = new QComboBox(tab); m_pTextEncodingEditor->setDuplicatesEnabled(false); - gl->addWidget(m_pTextEncodingEditor,9,1); - KviTalToolTip::add(m_pEncodingEditor,__tr2qs_ctx("<center>This box allows you to choose the preferred encoding for this server. " \ + gl->addWidget(m_pTextEncodingEditor,iRow,1); + KviTalToolTip::add(m_pTextEncodingEditor,__tr2qs_ctx("<center>This box allows you to choose the preferred encoding for this server. " \ "This encoding will be used as the default for text messages." \ "If you choose \"Use Network Encoding\" then the encoding will be inherited from the " \ "network that this server belongs to.</center>","options")); @@ -711,12 +771,14 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s) m_pEncodingEditor->setCurrentIndex(srvcurrent); m_pTextEncodingEditor->setCurrentIndex(txtcurrent); + iRow++; + l = new QLabel(__tr2qs_ctx("Link filter:","options"),tab); - gl->addWidget(l,10,0); + gl->addWidget(l,iRow,0); m_pLinkFilterEditor = new QComboBox(tab); m_pLinkFilterEditor->setEditable(true); m_pLinkFilterEditor->setDuplicatesEnabled(false); - gl->addWidget(m_pLinkFilterEditor,10,1); + gl->addWidget(m_pLinkFilterEditor,iRow,1); m_pLinkFilterEditor->addItem(""); @@ -747,21 +809,25 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s) 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")); + iRow++; + l = new QLabel(__tr2qs_ctx("Id:","options"),tab); - gl->addWidget(l,11,0); + gl->addWidget(l,iRow,0); m_pIdEditor = new QLineEdit(tab); if(s->id().isEmpty())s->generateUniqueId(); m_pIdEditor->setText(s->id()); - gl->addWidget(m_pIdEditor,11,1); + gl->addWidget(m_pIdEditor,iRow,1); 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 <this_id> 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")); + iRow++; + l = new QLabel(__tr2qs_ctx("Proxy server:","options"),tab); - gl->addWidget(l,12,0); + gl->addWidget(l,iRow,0); m_pProxyEditor = new QComboBox(tab); - gl->addWidget(m_pProxyEditor,12,1); + gl->addWidget(m_pProxyEditor,iRow,1); KviTalToolTip::add(m_pProxyEditor,__tr2qs_ctx("<center>This is the <b>proxy</b> that KVIrc will use to connect to this 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")); @@ -777,30 +843,15 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s) if(m_pProxyEditor->count() > (s->proxy()+2)) m_pProxyEditor->setCurrentIndex(s->proxy()+2); - m_pEnableSASLCheck = new QCheckBox(__tr2qs_ctx("Enable SASL authentication","options"),tab); - gl->addWidget(m_pEnableSASLCheck,13,0,1,2); - KviTalToolTip::add(m_pEnableSASLCheck,__tr2qs_ctx("<center>This check enables the use of the <b>SASL</b> authentication procotol " \ - "If you enable the proper global option in the Connection/SSL tab and fill the Sasl Nickname and Sasl Password fields in this page, the SASL protocol will be used for this server if available.</center>","options")); - m_pEnableSASLCheck->setChecked(s->enabledSASL()); + iRow++; + - l = new QLabel(__tr2qs_ctx("Sasl Nickname:","options"),tab); - gl->addWidget(l,14,0); - m_pSaslNickEditor = new QLineEdit(tab); - m_pSaslNickEditor->setText(s->saslNick()); - KviTalToolTip::add(m_pSaslNickEditor,__tr2qs_ctx("<center>If you want to enable SASL authentication, insert your nickname here.</center>","options")); - gl->addWidget(m_pSaslNickEditor,14,1); - l = new QLabel(__tr2qs_ctx("Sasl Password:","options"),tab); - gl->addWidget(l,15,0); - m_pSaslPassEditor = new KviPasswordLineEdit(tab); - m_pSaslPassEditor->setText(s->saslPass()); - KviTalToolTip::add(m_pSaslPassEditor,__tr2qs_ctx("<center>If you want to enable SASL authentication, insert your password here.</center>","options")); - gl->addWidget(m_pSaslPassEditor,15,1); l = new QLabel("",tab); - gl->addWidget(l,16,0,1,2); + gl->addWidget(l,iRow,0,1,2); - gl->setRowStretch(16,1); + gl->setRowStretch(iRow,1); tw->addTab(tab,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SOCKETWARNING)),__tr2qs_ctx("Connection","options")); |
