From 91d8d752c79df1bb4db425affd34116ec1157dd7 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 23 Oct 2014 11:47:22 +0900 Subject: Fixed up documentation config list sort order. Added mouse shortcut for edit items in the list. This relates to bug 1859. Signed-off-by: Michele Calgaro --- parts/documentation/docconfiglistview.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'parts/documentation/docconfiglistview.cpp') diff --git a/parts/documentation/docconfiglistview.cpp b/parts/documentation/docconfiglistview.cpp index d2753653..55b108ec 100644 --- a/parts/documentation/docconfiglistview.cpp +++ b/parts/documentation/docconfiglistview.cpp @@ -26,7 +26,6 @@ DocConfigListView::DocConfigListView(TQWidget *parent, const char *name) :TDEListView(parent, name) { -// setSorting(-1); addColumn(i18n("TOC")); addColumn(i18n("Index")); addColumn(i18n("Search")); @@ -39,17 +38,19 @@ DocConfigListView::DocConfigListView(TQWidget *parent, const char *name) // setColumnWidthMode(4, TQListView::Maximum); setAllColumnsShowFocus(true); setResizeMode( TQListView::LastColumn ); + setSorting(3); connect(this, TQT_SIGNAL(clicked(TQListViewItem*, const TQPoint&, int)), - this, TQT_SLOT(clickedItem(TQListViewItem*, const TQPoint&, int ))); + this, TQT_SLOT(itemClicked(TQListViewItem*, const TQPoint&, int ))); + connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), + this, TQT_SLOT(itemDoubleClicked(TQListViewItem*, const TQPoint&, int ))); } DocConfigListView::~DocConfigListView() { } -void DocConfigListView::clickedItem(TQListViewItem *item, const TQPoint &// pnt - , int c) +void DocConfigListView::itemClicked(TQListViewItem *item, const TQPoint &/*pnt*/, int c) { if (!item) return; @@ -69,4 +70,14 @@ void DocConfigListView::clickedItem(TQListViewItem *item, const TQPoint &// pnt repaintItem(item); } +void DocConfigListView::itemDoubleClicked(TQListViewItem *item, const TQPoint &/*pnt*/, int c) +{ + if (!item) + return; + ConfigurationItem *cfg = dynamic_cast(item); + if (!cfg) + return; + emit itemActivated(); +} + #include "docconfiglistview.moc" -- cgit v1.2.1