summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2015-01-26 08:26:44 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2015-01-26 08:26:44 +0900
commit11f19f36b664e8755ff06f70ca12554e7a66acf6 (patch)
treebaca5a2cfd22ea465de6daf6251ab0ded61fc175
parentfa18be205188cadee927d2c115856c5ab8e8896f (diff)
downloadtdewebdev-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>
-rw-r--r--tdefilereplace/tdefilereplaceview.cpp44
-rw-r--r--tdefilereplace/tdefilereplaceview.h5
2 files changed, 36 insertions, 13 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()
diff --git a/tdefilereplace/tdefilereplaceview.h b/tdefilereplace/tdefilereplaceview.h
index b542563e..6081347a 100644
--- a/tdefilereplace/tdefilereplaceview.h
+++ b/tdefilereplace/tdefilereplaceview.h
@@ -2,7 +2,7 @@
tdefilereplaceview.h - description
-------------------
begin : sam oct 16 15:28:00 CEST 1999
- copyright : (C) 1999 by François Dupoux <dupoux@dupoux.com>
+ copyright : (C) 1999 by Fran�ois Dupoux <dupoux@dupoux.com>
(C) 2004 Emiliano Gulmini <emi_barbarossa@yahoo.it>
***************************************************************************/
@@ -76,7 +76,8 @@ class TDEFileReplaceView : public TDEFileReplaceViewWdg
//void emitSearchingOnlyMode(bool b) { emit searchingOnlyMode(b); }
public slots:
- void slotMouseButtonClicked (int button, TQListViewItem *lvi, const TQPoint &pos);
+ void slotResultMouseButtonClicked(int button, TQListViewItem *lvi, const TQPoint &pos);
+ void slotResultReturnPressed(TQListViewItem *lvi);
void slotResultProperties();
void slotResultOpen();
void slotResultOpenWith();