aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/links/LinksWindow.cpp
diff options
context:
space:
mode:
authorGravatar Fabio Bas2012-02-26 14:57:49 +0000
committerGravatar Fabio Bas2012-02-26 14:57:49 +0000
commitb2891fe17c395b885b4fac8634fa8cca1a45fbb6 (patch)
treee9fcfdebc14137188b3cf02376fe90145d52943d /src/modules/links/LinksWindow.cpp
parentSome mixed changes, mostly related to osx development: (diff)
downloadKVIrc-b2891fe17c395b885b4fac8634fa8cca1a45fbb6.tar.gz
KVIrc-b2891fe17c395b885b4fac8634fa8cca1a45fbb6.tar.bz2
KVIrc-b2891fe17c395b885b4fac8634fa8cca1a45fbb6.zip
Dropped the KviTalPopupMenu layer, ported the involved code to QAction.
This fixes most of the random crashes on osx, and is the base for a next change in the menubar. Addiotional fix: "disconnect" menu entry was broken since the 3.x era git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@6072 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/links/LinksWindow.cpp')
-rw-r--r--src/modules/links/LinksWindow.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/modules/links/LinksWindow.cpp b/src/modules/links/LinksWindow.cpp
index 9e0573401..21ccf2f5b 100644
--- a/src/modules/links/LinksWindow.cpp
+++ b/src/modules/links/LinksWindow.cpp
@@ -88,8 +88,8 @@ LinksWindow::LinksWindow(KviConsoleWindow * lpConsole)
m_pLinkList = new KviPointerList<KviLink>;
m_pLinkList->setAutoDelete(true);
- m_pHostPopup = new KviTalPopupMenu();
- connect(m_pHostPopup,SIGNAL(activated(int)),this,SLOT(hostPopupClicked(int)));
+ m_pHostPopup = new QMenu();
+ connect(m_pHostPopup,SIGNAL(triggered(QAction*)),this,SLOT(hostPopupClicked(QAction *)));
connectionStateChange();
@@ -360,53 +360,53 @@ void LinksWindow::showHostPopup(QTreeWidgetItem *i,const QPoint &p)
if(host.isEmpty())return;
m_pHostPopup->clear();
KviCString tmp(KviCString::Format,"LINKS %s *",host.ptr());
- m_pHostPopup->insertItem(*(g_pIconManager->getSmallIcon(KviIconManager::Links)),tmp.ptr());
- m_pHostPopup->insertSeparator();
+ m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Links)),tmp.ptr());
+ m_pHostPopup->addSeparator();
tmp.sprintf("TIME %s",host.ptr());
- m_pHostPopup->insertItem(*(g_pIconManager->getSmallIcon(KviIconManager::Time)),tmp.ptr());
+ m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)),tmp.ptr());
tmp.sprintf("ADMIN %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("INFO %s",host.ptr());
- m_pHostPopup->insertItem(*(g_pIconManager->getSmallIcon(KviIconManager::ServerInfo)),tmp.ptr());
+ m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::ServerInfo)),tmp.ptr());
tmp.sprintf("MOTD %s",host.ptr());
- m_pHostPopup->insertItem(*(g_pIconManager->getSmallIcon(KviIconManager::Motd)),tmp.ptr());
+ m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Motd)),tmp.ptr());
tmp.sprintf("VERSION %s",host.ptr());
- m_pHostPopup->insertItem(*(g_pIconManager->getSmallIcon(KviIconManager::KVIrc)),tmp.ptr());
+ m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::KVIrc)),tmp.ptr());
tmp.sprintf("TRACE %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("USERS %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
- m_pHostPopup->insertSeparator();
+ m_pHostPopup->addAction(tmp.ptr());
+ m_pHostPopup->addSeparator();
tmp.sprintf("STATS c %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS d %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS h %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS i %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS k %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS l %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS m %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS o %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS t %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS u %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS y %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
tmp.sprintf("STATS z %s",host.ptr());
- m_pHostPopup->insertItem(tmp.ptr());
+ m_pHostPopup->addAction(tmp.ptr());
m_pHostPopup->popup(p);
}
-void LinksWindow::hostPopupClicked(int id)
+void LinksWindow::hostPopupClicked(QAction *pAction)
{
- KviCString tmp = m_pHostPopup->text(id);
+ KviCString tmp = pAction->text();
if(tmp.hasData())
{
if(!connection())output(KVI_OUT_SYSTEMERROR,__tr2qs("You're not connected to a server"));