aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Fabio Bas2010-06-04 17:19:44 +0000
committerGravatar Fabio Bas2010-06-04 17:19:44 +0000
commit0e636b8821b96709115ba85ed3f2b37a4f2a60e1 (patch)
tree3ef0832447b1ee28421de0168ded5a473106b3dc /src
parentmdi child: cache geometry to avoid a problem where a mdi subwindow that never... (diff)
downloadKVIrc-0e636b8821b96709115ba85ed3f2b37a4f2a60e1.tar.gz
KVIrc-0e636b8821b96709115ba85ed3f2b37a4f2a60e1.tar.bz2
KVIrc-0e636b8821b96709115ba85ed3f2b37a4f2a60e1.zip
server handling: avoid to pick up the first available server from the first available network: open up the server list instead;
other small fixes git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4421 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
-rw-r--r--src/kvilib/irc/kvi_ircserverdb.cpp14
-rw-r--r--src/kvilib/irc/kvi_ircserverdb.h8
-rw-r--r--src/kvirc/kernel/kvi_irccontext.cpp5
-rw-r--r--src/modules/mircimport/libkvimircimport.cpp2
-rw-r--r--src/modules/options/optw_servers.cpp5
5 files changed, 25 insertions, 9 deletions
diff --git a/src/kvilib/irc/kvi_ircserverdb.cpp b/src/kvilib/irc/kvi_ircserverdb.cpp
index 8819fe854..4dcf2785a 100644
--- a/src/kvilib/irc/kvi_ircserverdb.cpp
+++ b/src/kvilib/irc/kvi_ircserverdb.cpp
@@ -86,6 +86,12 @@ KviNetwork * KviServerDataBase::findNetwork(const QString & szName)
return r;
}
+unsigned int KviServerDataBase::networkCount() const
+{
+ return m_pRecords->count();
+}
+
+
KviNetwork * KviServerDataBase::currentNetwork()
{
KviNetwork * r = 0;
@@ -94,13 +100,7 @@ KviNetwork * KviServerDataBase::currentNetwork()
if(r)
return r;
- KviPointerHashTableIterator<QString,KviNetwork> it(*m_pRecords);
- r = it.current();
- if(!r)
- return 0;
-
- m_szCurrentNetwork = r->name();
- return r;
+ return 0;
}
bool KviServerDataBase::makeCurrentBestServerInNetwork(const QString & szNetName, KviNetwork * r, QString & szError)
diff --git a/src/kvilib/irc/kvi_ircserverdb.h b/src/kvilib/irc/kvi_ircserverdb.h
index 1822b86bc..9a4ca2ffe 100644
--- a/src/kvilib/irc/kvi_ircserverdb.h
+++ b/src/kvilib/irc/kvi_ircserverdb.h
@@ -154,13 +154,19 @@ public:
void addNetwork(KviNetwork * n);
/**
- * \brief Searches fot a network
+ * \brief Searches for a network
* \param name The name of the network to find
* \return KviNetwork
*/
KviNetwork * findNetwork(const QString & name);
/**
+ * \brief Returns the number of networks
+ * \return unsigned integer
+ */
+ unsigned int networkCount() const;
+
+ /**
* \brief Loads the database data
* \param filename The filename of the database data to load
* \return void
diff --git a/src/kvirc/kernel/kvi_irccontext.cpp b/src/kvirc/kernel/kvi_irccontext.cpp
index 28e0e74c8..e8a80d374 100644
--- a/src/kvirc/kernel/kvi_irccontext.cpp
+++ b/src/kvirc/kernel/kvi_irccontext.cpp
@@ -484,7 +484,10 @@ void KviIrcContext::connectToCurrentServer()
if(!srv)
{
- m_pConsole->outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("No servers available. Check the options dialog or use the /SERVER command"));
+ if(g_pServerDataBase->networkCount())
+ KviKvsScript::run("options.edit KviServerOptionsWidget",m_pConsole);
+ else
+ m_pConsole->outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("No servers available. Check the options dialog or use the /SERVER command"));
destroyAsynchronousConnectionData();
return;
}
diff --git a/src/modules/mircimport/libkvimircimport.cpp b/src/modules/mircimport/libkvimircimport.cpp
index 484947500..5fda94784 100644
--- a/src/modules/mircimport/libkvimircimport.cpp
+++ b/src/modules/mircimport/libkvimircimport.cpp
@@ -148,6 +148,7 @@ KviRemoteMircServerImportWizard::KviRemoteMircServerImportWizard(KviRemoteMircSe
m_pFilter = f;
QLabel * l = new QLabel(this);
+ l->setWordWrap(true);
l->setText(__tr2qs("<center><b>Welcome!</b><br><br>This wizard will guide you in the process of " \
"downloading a list of IRC servers. Please click \"<b>Next</b>\" to begin the operation.</center>"));
addPage(l,capt);
@@ -155,6 +156,7 @@ KviRemoteMircServerImportWizard::KviRemoteMircServerImportWizard(KviRemoteMircSe
KviTalVBox * vb = new KviTalVBox(this);
l = new QLabel(vb);
+ l->setWordWrap(true);
l->setText(__tr2qs("<center>Here you can modify the URL that the list will be downloaded from. In most cases the default URL is acceptable.</center>"));
vb->setStretchFactor(l,1);
diff --git a/src/modules/options/optw_servers.cpp b/src/modules/options/optw_servers.cpp
index 4e8359469..6cdf12408 100644
--- a/src/modules/options/optw_servers.cpp
+++ b/src/modules/options/optw_servers.cpp
@@ -1531,6 +1531,9 @@ void KviServerOptionsWidget::fillServerList()
KviPointerHashTableIterator<QString,KviNetwork> it(*(g_pServerDataBase->recordDict()));
+ if(m_pConnectCurrent)
+ m_pConnectCurrent->setEnabled(false);
+
while(KviNetwork * r = it.current())
{
net = new KviServerOptionsTreeWidgetItem(m_pTreeWidget,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_WORLD)),r);
@@ -1554,6 +1557,8 @@ void KviServerOptionsWidget::fillServerList()
cur->setSelected(true);
m_pTreeWidget->setCurrentItem(cur);
m_pTreeWidget->scrollToItem(cur);
+ if(m_pConnectCurrent)
+ m_pConnectCurrent->setEnabled(false);
}
}