aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/options/optw_servers.cpp
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2010-12-25 03:14:10 +0000
committerGravatar Szymon Tomasz Stefanek2010-12-25 03:14:10 +0000
commitfc30c3ea279b53b2c0e2a3b71f9811ff1033076c (patch)
tree8da709e2160e50abd2e4b355f3b795fdbbd5aa56 /src/modules/options/optw_servers.cpp
parentUpdate str.grep short doc: avoid mentioning GNU regexp as we don't emulate it (diff)
downloadKVIrc-fc30c3ea279b53b2c0e2a3b71f9811ff1033076c.tar.gz
KVIrc-fc30c3ea279b53b2c0e2a3b71f9811ff1033076c.tar.bz2
KVIrc-fc30c3ea279b53b2c0e2a3b71f9811ff1033076c.zip
Added the very first shy 'auto-join this channel' feature to the window popup. .serverJoinChannels and .networkJoinChannels now return arrays. Reworked a bit the 'network name' mess in the IrcConnection... possibly needs more reorganizing. Some small tweaks in the server dialog.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5226 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/options/optw_servers.cpp')
-rw-r--r--src/modules/options/optw_servers.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/modules/options/optw_servers.cpp b/src/modules/options/optw_servers.cpp
index cda2e9545..67156b5bc 100644
--- a/src/modules/options/optw_servers.cpp
+++ b/src/modules/options/optw_servers.cpp
@@ -1321,6 +1321,7 @@ KviServerOptionsWidget::KviServerOptionsWidget(QWidget * parent)
m_pSrvNetLabel = new QLabel(__tr2qs_ctx("Server:","options"),gbox);
m_pSrvNetEdit = new QLineEdit(gbox);
+ connect(m_pSrvNetEdit,SIGNAL(textEdited(const QString &)),this,SLOT(serverNetworkEditTextEdited(const QString &)));
KviTalToolTip::add(m_pSrvNetEdit,__tr2qs_ctx("<center>This is the name of the currently selected server or network</center>","options"));
m_pDetailsButton = new QPushButton(__tr2qs_ctx("Advanced...","options"),gbox);
@@ -1513,7 +1514,6 @@ void KviServerOptionsWidget::selectBestServerByUrl(const QString &szUrl)
}
-
void KviServerOptionsWidget::connectCurrentClicked()
{
saveLastItem();
@@ -1604,19 +1604,36 @@ void KviServerOptionsWidget::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetI
}
}
+void KviServerOptionsWidget::serverNetworkEditTextEdited(const QString &)
+{
+ if(!m_pLastEditedItem)
+ return;
+
+ saveLastItem();
+
+ // make sure the current item is currently visible (if it still exists)
+ if(m_pLastEditedItem)
+ m_pTreeWidget->scrollToItem(m_pLastEditedItem,QTreeWidget::EnsureVisible);
+}
+
+
void KviServerOptionsWidget::saveLastItem()
{
- if(!m_pLastEditedItem)return;
+ if(!m_pLastEditedItem)
+ return;
+
if(m_pLastEditedItem->m_pServerData)
{
KviStr tmp = m_pSrvNetEdit->text();
- if(tmp.isEmpty())tmp = "irc.unknown.net";
+ if(tmp.isEmpty())
+ tmp = "irc.unknown.net";
m_pLastEditedItem->m_pServerData->m_szHostname = tmp;
m_pLastEditedItem->updateVisibleStrings();
} else if(m_pLastEditedItem->m_pNetworkData)
{
QString tmp = m_pSrvNetEdit->text();
- if(tmp.isEmpty())tmp = __tr2qs_ctx("UnknownNet","options");
+ if(tmp.isEmpty())
+ tmp = __tr2qs_ctx("UnknownNet","options");
m_pLastEditedItem->m_pNetworkData->setName(tmp);
m_pLastEditedItem->updateVisibleStrings();
}