diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2015-01-26 08:26:44 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2015-01-26 08:26:44 +0900 |
commit | 11f19f36b664e8755ff06f70ca12554e7a66acf6 (patch) | |
tree | baca5a2cfd22ea465de6daf6251ab0ded61fc175 /tdefilereplace/tdefilereplaceview.cpp | |
parent | fa18be205188cadee927d2c115856c5ab8e8896f (diff) | |
download | tdewebdev-11f19f36b664e8755ff06f70ca12554e7a66acf6.tar.gz tdewebdev-11f19f36b664e8755ff06f70ca12554e7a66acf6.zip |
Open searched results with mouse or keyboard in TDEFileReplace. This resolves bug 2322.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdefilereplace/tdefilereplaceview.cpp')
-rw-r--r-- | tdefilereplace/tdefilereplaceview.cpp | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/tdefilereplace/tdefilereplaceview.cpp b/tdefilereplace/tdefilereplaceview.cpp index c4d6c1bc..48a8343b 100644 --- a/tdefilereplace/tdefilereplaceview.cpp +++ b/tdefilereplace/tdefilereplaceview.cpp @@ -50,14 +50,26 @@ TDEFileReplaceView::TDEFileReplaceView(RCOptions* info, TQWidget *parent,const c initGUI(); - // connect events - connect(m_lvResults, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(slotMouseButtonClicked(int, TQListViewItem *, const TQPoint &))); - connect(m_lvResults_2, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(slotMouseButtonClicked(int, TQListViewItem *, const TQPoint &))); - connect(m_lvStrings, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); - connect(m_lvStrings_2, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); + // result listview: connect events + connect(m_lvResults, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), + this, TQT_SLOT(slotResultMouseButtonClicked(int, TQListViewItem *, const TQPoint &))); + connect(m_lvResults, TQT_SIGNAL(returnPressed(TQListViewItem *)), + this, TQT_SLOT(slotResultReturnPressed(TQListViewItem *))); + connect(m_lvResults, TQT_SIGNAL(executed(TQListViewItem *)), + this, TQT_SLOT(executed(TQListViewItem *))); + connect(m_lvResults_2, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), + this, TQT_SLOT(slotResultMouseButtonClicked(int, TQListViewItem *, const TQPoint &))); + connect(m_lvResults_2, TQT_SIGNAL(returnPressed(TQListViewItem *)), + this, TQT_SLOT(slotResultReturnPressed(TQListViewItem *))); + connect(m_lvResults_2, TQT_SIGNAL(executed(TQListViewItem *)), + this, TQT_SLOT(slotResultReturnPressed(TQListViewItem *))); // connect header events connect(m_lvResults->header(), TQT_SIGNAL(clicked(int)), this,TQT_SLOT(slotResultHeaderClicked(int))); connect(m_lvResults_2->header(), TQT_SIGNAL(clicked(int)), this,TQT_SLOT(slotResultHeaderClicked(int))); + + // string listview: connect events + connect(m_lvStrings, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); + connect(m_lvStrings_2, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); whatsThis(); } @@ -173,17 +185,27 @@ TDEListView* TDEFileReplaceView::getStringsView() } //PUBLIC SLOTS -void TDEFileReplaceView::slotMouseButtonClicked (int button, TQListViewItem *lvi, const TQPoint &pos) +void TDEFileReplaceView::slotResultMouseButtonClicked(int button, TQListViewItem *lvi, const TQPoint &pos) { if (lvi == 0) // No item selected return; - // RIGHT BUTTON if (button == Qt::RightButton) - { - m_lviCurrent = static_cast<TDEListViewItem*>(lvi); - m_menuResult->popup(pos); - } + { + // Right mouse button: open popup menub + m_lviCurrent = static_cast<TDEListViewItem*>(lvi); + m_menuResult->popup(pos); + } +} + +void TDEFileReplaceView::slotResultReturnPressed (TQListViewItem *lvi) +{ + if (lvi == 0) // No item selected + return; + + // Left mouse button: open item in default view + m_lviCurrent = static_cast<TDEListViewItem*>(lvi); + slotResultOpen(); } void TDEFileReplaceView::slotResultProperties() |