summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-16 10:17:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-16 14:44:04 +0100
commit932441bfc7953198dd8db4cf929857f63e05c207 (patch)
treed70dab0baee64a8e4db806858958d42f65336419 /dbaccess
parentde51b1aa540ce1e3532e4a8d3650c82f8d600d17 (diff)
show context menu on right click in treeview
Change-Id: I2a124d63309130b0488e30169aa54ffbc736999f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110983 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/inc/TableWindowListBox.hxx1
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowListBox.cxx9
2 files changed, 10 insertions, 0 deletions
diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx
index d41cdbc3e285..0d3890cf26c7 100644
--- a/dbaccess/source/ui/inc/TableWindowListBox.hxx
+++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx
@@ -55,6 +55,7 @@ namespace dbaui
std::unique_ptr<TableWindowListBoxHelper> m_xDragDropTargetHelper;
DECL_LINK( OnDoubleClick, weld::TreeView&, bool );
+ DECL_LINK(CommandHdl, const CommandEvent&, bool);
DECL_LINK( DropHdl, void*, void );
DECL_LINK( LookForUiHdl, void*, void );
DECL_LINK( DragBeginHdl, bool&, bool );
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index a289f185683f..a1a8a17c4735 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -50,6 +50,7 @@ OTableWindowListBox::OTableWindowListBox(OTableWindow* pParent)
{
m_xTreeView->connect_row_activated(LINK(this, OTableWindowListBox, OnDoubleClick));
m_xTreeView->connect_visible_range_changed(LINK(this, OTableWindowListBox, ScrollHdl));
+ m_xTreeView->connect_popup_menu(LINK(this, OTableWindowListBox, CommandHdl));
m_xHelper.set(new OJoinExchObj);
rtl::Reference<TransferDataContainer> xHelper(m_xHelper);
@@ -57,6 +58,14 @@ OTableWindowListBox::OTableWindowListBox(OTableWindow* pParent)
m_xTreeView->connect_drag_begin(LINK(this, OTableWindowListBox, DragBeginHdl));
}
+IMPL_LINK(OTableWindowListBox, CommandHdl, const CommandEvent&, rCEvt, bool)
+{
+ if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
+ return false;
+ m_pTabWin->Command(rCEvt);
+ return true;
+}
+
void OTableWindowListBox::dragFinished()
{
// first show the error msg when existing