aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/eventeditor
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/eventeditor
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/eventeditor')
-rw-r--r--src/modules/eventeditor/EventEditorWindow.cpp14
-rw-r--r--src/modules/eventeditor/EventEditorWindow.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/eventeditor/EventEditorWindow.cpp b/src/modules/eventeditor/EventEditorWindow.cpp
index 7991f5c80..3ae064075 100644
--- a/src/modules/eventeditor/EventEditorWindow.cpp
+++ b/src/modules/eventeditor/EventEditorWindow.cpp
@@ -40,7 +40,7 @@
#include "KviFileDialog.h"
#include "KviKvsEventManager.h"
#include "KviTalVBox.h"
-#include "KviTalPopupMenu.h"
+#include "QMenu.h"
#include <QMessageBox>
#include <QSplitter>
@@ -155,7 +155,7 @@ void EventEditor::oneTimeSetup()
connect(m_pTreeWidget,SIGNAL(rightButtonPressed(QTreeWidgetItem *,QPoint)),
this,SLOT(itemPressed(QTreeWidgetItem *,QPoint)));
connect(KviKvsEventManager::instance(),SIGNAL(eventHandlerDisabled(const QString &)),this,SLOT(eventHandlerDisabled(const QString &)));
- m_pContextPopup = new KviTalPopupMenu(this);
+ m_pContextPopup = new QMenu(this);
m_pTreeWidget->sortItems(0,Qt::AscendingOrder);
}
void EventEditor::eventHandlerDisabled(const QString &szHandler)
@@ -212,24 +212,24 @@ void EventEditor::itemPressed(QTreeWidgetItem *it,const QPoint &pnt)
{
QString tmp;
if(!(((EventEditorHandlerTreeWidgetItem *)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(addHandlerForCurrentEvent()));
diff --git a/src/modules/eventeditor/EventEditorWindow.h b/src/modules/eventeditor/EventEditorWindow.h
index 88451e4a8..ae51e2cb7 100644
--- a/src/modules/eventeditor/EventEditorWindow.h
+++ b/src/modules/eventeditor/EventEditorWindow.h
@@ -26,7 +26,7 @@
#include "KviWindow.h"
#include "KviCString.h"
-#include "KviTalPopupMenu.h"
+#include "QMenu.h"
#include <QWidget>
#include <QLineEdit>
@@ -90,7 +90,7 @@ public:
KviScriptEditor * m_pEditor;
EventEditorTreeWidget * m_pTreeWidget;
QLineEdit * m_pNameEditor;
- KviTalPopupMenu * m_pContextPopup;
+ QMenu * m_pContextPopup;
EventEditorHandlerTreeWidgetItem * m_pLastEditedItem;
bool m_bOneTimeSetupDone;
public: