diff options
| author | 2012-02-26 14:57:49 +0000 | |
|---|---|---|
| committer | 2012-02-26 14:57:49 +0000 | |
| commit | b2891fe17c395b885b4fac8634fa8cca1a45fbb6 (patch) | |
| tree | e9fcfdebc14137188b3cf02376fe90145d52943d /src/modules/url | |
| parent | Some mixed changes, mostly related to osx development: (diff) | |
| download | KVIrc-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/url')
| -rw-r--r-- | src/modules/url/libkviurl.cpp | 36 | ||||
| -rw-r--r-- | src/modules/url/libkviurl.h | 2 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/modules/url/libkviurl.cpp b/src/modules/url/libkviurl.cpp index ae914f879..7778e4d72 100644 --- a/src/modules/url/libkviurl.cpp +++ b/src/modules/url/libkviurl.cpp @@ -36,7 +36,7 @@ #include "KviWindowListBase.h" #include "KviPointerList.h" #include "KviKvsEventManager.h" -#include "KviTalPopupMenu.h" +#include "QMenu.h" #include "KviWindow.h" #include "KviOptions.h" #include "KviQString.h" @@ -170,19 +170,19 @@ UrlDialog::UrlDialog(KviPointerList<KviUrl> *) //m_pUrlList = new KviListView(this,"list"); KviConfigurationFile cfg(szConfigPath,KviConfigurationFile::Read); /* - KviTalPopupMenu *pop; + QMenu *pop; - pop = new KviTalPopupMenu(this); - pop->insertItem(__tr2qs("&Configure"),this,SLOT(config())); -// pop->insertItem(__tr2qs("&Help"),this,SLOT(help())); - pop->insertItem(__tr2qs("Clo&se"),this,SLOT(close_slot())); + pop = new QMenu(this); + pop->addAction(__tr2qs("&Configure"),this,SLOT(config())); +// pop->addAction(__tr2qs("&Help"),this,SLOT(help())); + pop->addAction(__tr2qs("Clo&se"),this,SLOT(close_slot())); pop->setTitle(__tr2qs("&Module")); m_pMenuBar->addMenu(pop); - pop = new KviTalPopupMenu(this); - pop->insertItem(__tr2qs("&Load"),this,SLOT(loadList())); - pop->insertItem(__tr2qs("&Save"),this,SLOT(saveList())); - pop->insertItem(__tr2qs("&Clear"),this,SLOT(clear())); + pop = new QMenu(this); + pop->addAction(__tr2qs("&Load"),this,SLOT(loadList())); + pop->addAction(__tr2qs("&Save"),this,SLOT(saveList())); + pop->addAction(__tr2qs("&Clear"),this,SLOT(clear())); pop->setTitle(__tr2qs("&List")); m_pMenuBar->addMenu(pop); */ @@ -317,11 +317,11 @@ void UrlDialog::dblclk_url(QTreeWidgetItem *item, int) void UrlDialog::popup(QTreeWidgetItem *item, const QPoint &point) { m_szUrl = item->text(0); - KviTalPopupMenu p(0,"menu"); - p.insertItem(__tr2qs("&Remove"),this,SLOT(remove())); -// p.insertItem(__tr2qs("&Find Text"),this,SLOT(findtext())); - p.insertSeparator(); - m_pListPopup = new KviTalPopupMenu(0,"list"); + QMenu p("menu", 0); + p.addAction(__tr2qs("&Remove"),this,SLOT(remove())); +// p.addAction(__tr2qs("&Find Text"),this,SLOT(findtext())); + p.addSeparator(); + m_pListPopup = new QMenu("list", 0); for(KviWindow *w=g_pMainWindow->windowList()->first();w;w=g_pMainWindow->windowList()->next()) { @@ -332,15 +332,15 @@ void UrlDialog::popup(QTreeWidgetItem *item, const QPoint &point) m_pListPopup->addAction(w->plainTextCaption()); } } - p.insertItem(__tr2qs("&Say to Window"),m_pListPopup); + p.addAction(__tr2qs("&Say to Window"))->setMenu(m_pListPopup); connect(m_pListPopup,SIGNAL(triggered(QAction *)), this, SLOT(sayToWin(QAction *))); p.exec(point); } void UrlDialog::contextMenu(const QPoint &point) { - KviTalPopupMenu p(0,"contextmenu"); - p.insertItem(__tr2qs("Configure"),this,SLOT(config())); + QMenu p("contextmenu", 0); + p.addAction(__tr2qs("Configure"),this,SLOT(config())); p.exec(point); } diff --git a/src/modules/url/libkviurl.h b/src/modules/url/libkviurl.h index 90622ab4e..812473da3 100644 --- a/src/modules/url/libkviurl.h +++ b/src/modules/url/libkviurl.h @@ -75,7 +75,7 @@ public: ~UrlDialog(); private: KviTalMenuBar *m_pMenuBar; - KviTalPopupMenu *m_pListPopup; // dynamic popup menu + QMenu *m_pListPopup; // dynamic popup menu QString m_szUrl; // used to pass urls to sayToWin slot protected: QPixmap *myIconPtr(); |
