diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-05-31 23:40:00 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-05-31 23:42:12 +0900 |
commit | ba298e24470b8f2d154b657cd23bb7721af5a0b6 (patch) | |
tree | 83db96daea024355e98428ae14afa9260891a158 /kdcop | |
parent | 44acbc390a727aee18d8ec506b672dcdff8b4ab6 (diff) | |
download | tdebase-ba298e24470b8f2d154b657cd23bb7721af5a0b6.tar.gz tdebase-ba298e24470b8f2d154b657cd23bb7721af5a0b6.zip |
kdcop: added popup menu to result list to conveniently copy the selected
item (functionality was already available from Edit menu but not so user
friendly).
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 7ea414a2abd06da7d22dc90d1ed8d3fe79ddca68)
Diffstat (limited to 'kdcop')
-rw-r--r-- | kdcop/kdcopwindow.cpp | 32 | ||||
-rw-r--r-- | kdcop/kdcopwindow.h | 3 |
2 files changed, 19 insertions, 16 deletions
diff --git a/kdcop/kdcopwindow.cpp b/kdcop/kdcopwindow.cpp index 92e226852..d1bbe4883 100644 --- a/kdcop/kdcopwindow.cpp +++ b/kdcop/kdcopwindow.cpp @@ -46,6 +46,7 @@ #include <tqvbox.h> #include <tqimage.h> #include <tqheader.h> +#include <tqpopupmenu.h> #include <kdebug.h> #include <kkeydialog.h> @@ -296,20 +297,10 @@ KDCOPWindow::KDCOPWindow(TQWidget *parent, const char * name) // mainView->lv->addColumn(i18n("Function")); mainView->lv->setDragAutoScroll( FALSE ); mainView->lv->setRootIsDecorated( TRUE ); - connect - ( - mainView->lv, - TQT_SIGNAL(doubleClicked(TQListViewItem *)), - TQT_SLOT(slotCallFunction(TQListViewItem *)) - ); - - connect - ( - mainView->lv, - TQT_SIGNAL(currentChanged(TQListViewItem *)), - TQT_SLOT(slotCurrentChanged(TQListViewItem *)) - ); - + connect(mainView->lv, TQT_SIGNAL(doubleClicked(TQListViewItem *)), TQT_SLOT(slotCallFunction(TQListViewItem *))); + connect(mainView->lv, TQT_SIGNAL(currentChanged(TQListViewItem *)), TQT_SLOT(slotCurrentChanged(TQListViewItem *))); + connect(mainView->lb_replyData, TQT_SIGNAL(contextMenuRequested(TQListBoxItem*, const TQPoint&)), + TQT_SLOT(slotResultListContextMenu(TQListBoxItem*, const TQPoint&))); // set up the actions KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection() ); @@ -1102,8 +1093,10 @@ bool KDCOPWindow::demarshal isValid = false; } - if (!ret.isEmpty()) - theList->insertStringList(ret); + if (!ret.isEmpty()) + { + theList->insertStringList(ret); + } return isValid; } @@ -1235,4 +1228,11 @@ void KDCOPWindow::slotMode() mainView->lv->setMode(langmode->currentText()); } +void KDCOPWindow::slotResultListContextMenu(TQListBoxItem *item, const TQPoint &point) +{ + TQPopupMenu* contextMenu = new TQPopupMenu(this); + contextMenu->insertItem(i18n("&Copy"), this, TQT_SLOT(slotCopy())); + contextMenu->exec(point); +} + #include "kdcopwindow.moc" diff --git a/kdcop/kdcopwindow.h b/kdcop/kdcopwindow.h index bf0fe532e..77a87184c 100644 --- a/kdcop/kdcopwindow.h +++ b/kdcop/kdcopwindow.h @@ -8,6 +8,7 @@ #define __KDCOPWINDOW_H__ class DCOPClient; +class TQListBoxItem; class TQListViewItem; class TDEAction; class TDESelectAction; @@ -38,6 +39,8 @@ class KDCOPWindow : public TDEMainWindow void slotCopy(); void slotMode(); void slotReload(); + void slotResultListContextMenu(TQListBoxItem *item, const TQPoint &point); + private: void fillObjects( DCOPBrowserItem*, const char* app ); void fillFunctions( DCOPBrowserItem*, const char* app, const char* obj ); |