Open searched results with mouse or keyboard in TDEFileReplace. This resolves bug 2322.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/1/head
Michele Calgaro 10 years ago
parent fa18be2051
commit 11f19f36b6

@ -50,15 +50,27 @@ TDEFileReplaceView::TDEFileReplaceView(RCOptions* info, TQWidget *parent,const c
initGUI(); initGUI();
// connect events // result listview: connect events
connect(m_lvResults, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(slotMouseButtonClicked(int, TQListViewItem *, const TQPoint &))); connect(m_lvResults, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)),
connect(m_lvResults_2, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(slotMouseButtonClicked(int, TQListViewItem *, const TQPoint &))); this, TQT_SLOT(slotResultMouseButtonClicked(int, TQListViewItem *, const TQPoint &)));
connect(m_lvStrings, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); connect(m_lvResults, TQT_SIGNAL(returnPressed(TQListViewItem *)),
connect(m_lvStrings_2, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); 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 header events
connect(m_lvResults->header(), TQT_SIGNAL(clicked(int)), this,TQT_SLOT(slotResultHeaderClicked(int))); 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))); 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(); whatsThis();
} }
@ -173,19 +185,29 @@ TDEListView* TDEFileReplaceView::getStringsView()
} }
//PUBLIC SLOTS //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 if (lvi == 0) // No item selected
return; return;
// RIGHT BUTTON
if (button == Qt::RightButton) if (button == Qt::RightButton)
{ {
// Right mouse button: open popup menub
m_lviCurrent = static_cast<TDEListViewItem*>(lvi); m_lviCurrent = static_cast<TDEListViewItem*>(lvi);
m_menuResult->popup(pos); 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() void TDEFileReplaceView::slotResultProperties()
{ {
TQString currItem = currentPath(); TQString currItem = currentPath();

@ -2,7 +2,7 @@
tdefilereplaceview.h - description tdefilereplaceview.h - description
------------------- -------------------
begin : sam oct 16 15:28:00 CEST 1999 begin : sam oct 16 15:28:00 CEST 1999
copyright : (C) 1999 by François Dupoux <dupoux@dupoux.com> copyright : (C) 1999 by Fran<EFBFBD>ois Dupoux <dupoux@dupoux.com>
(C) 2004 Emiliano Gulmini <emi_barbarossa@yahoo.it> (C) 2004 Emiliano Gulmini <emi_barbarossa@yahoo.it>
***************************************************************************/ ***************************************************************************/
@ -76,7 +76,8 @@ class TDEFileReplaceView : public TDEFileReplaceViewWdg
//void emitSearchingOnlyMode(bool b) { emit searchingOnlyMode(b); } //void emitSearchingOnlyMode(bool b) { emit searchingOnlyMode(b); }
public slots: 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 slotResultProperties();
void slotResultOpen(); void slotResultOpen();
void slotResultOpenWith(); void slotResultOpenWith();

Loading…
Cancel
Save