From b2891fe17c395b885b4fac8634fa8cca1a45fbb6 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 26 Feb 2012 14:57:49 +0000 Subject: 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 --- src/modules/raweditor/RawEditorWindow.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/modules/raweditor/RawEditorWindow.cpp') diff --git a/src/modules/raweditor/RawEditorWindow.cpp b/src/modules/raweditor/RawEditorWindow.cpp index 6d3d67386..71755bfdf 100644 --- a/src/modules/raweditor/RawEditorWindow.cpp +++ b/src/modules/raweditor/RawEditorWindow.cpp @@ -40,7 +40,7 @@ #include "KviKvsEventManager.h" #include "KviKvsEventHandler.h" #include "KviTalVBox.h" -#include "KviTalPopupMenu.h" +#include "QMenu.h" #include #include @@ -91,7 +91,7 @@ RawEditorWidget::RawEditorWidget(QWidget * par) m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); // m_pTreeWidget->setShowSortIndicator(true); m_pTreeWidget->setRootIsDecorated(true); - m_pContextPopup = new KviTalPopupMenu(this); + m_pContextPopup = new QMenu(this); m_pTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); @@ -151,32 +151,32 @@ void RawEditorWidget::customContextMenuRequested(const QPoint &pos) if(it->parent()) { if(!(((RawHandlerTreeWidgetItem *)it)->m_bEnabled)) - m_pContextPopup->insertItem( + m_pContextPopup->addAction( *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), __tr2qs_ctx("&Enable Handler","editor"),this,SLOT(toggleCurrentHandlerEnabled())); else - m_pContextPopup->insertItem( + m_pContextPopup->addAction( *(g_pIconManager->getSmallIcon(KviIconManager::HandlerDisabled)), __tr2qs_ctx("&Disable Handler","editor"),this,SLOT(toggleCurrentHandlerEnabled())); - m_pContextPopup->insertItem( + m_pContextPopup->addAction( *(g_pIconManager->getSmallIcon(KviIconManager::Quit)), __tr2qs_ctx("Re&move Handler","editor"), this,SLOT(removeCurrentHandler())); - m_pContextPopup->insertItem( + m_pContextPopup->addAction( *(g_pIconManager->getSmallIcon(KviIconManager::Folder)), __tr2qs_ctx("&Export Handler To...","editor"), this,SLOT(exportCurrentHandler())); } else { - m_pContextPopup->insertItem( + m_pContextPopup->addAction( *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), __tr2qs_ctx("&New Handler","editor"), this,SLOT(addHandlerForCurrentRaw())); } } - m_pContextPopup->insertSeparator(); - m_pContextPopup->insertItem( + m_pContextPopup->addSeparator(); + m_pContextPopup->addAction( *(g_pIconManager->getSmallIcon(KviIconManager::RawEvent)), __tr2qs_ctx("&Add Raw Event...","editor"), this,SLOT(addRaw())); -- cgit v1.3.1-10-gc9f91