diff options
Diffstat (limited to 'parts')
-rw-r--r-- | parts/documentation/docconfiglistview.cpp | 19 | ||||
-rw-r--r-- | parts/documentation/docconfiglistview.h | 6 | ||||
-rw-r--r-- | parts/documentation/docglobalconfigwidget.cpp | 3 |
3 files changed, 23 insertions, 5 deletions
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<ConfigurationItem*>(item); + if (!cfg) + return; + emit itemActivated(); +} + #include "docconfiglistview.moc" diff --git a/parts/documentation/docconfiglistview.h b/parts/documentation/docconfiglistview.h index 561c326d..811c49b1 100644 --- a/parts/documentation/docconfiglistview.h +++ b/parts/documentation/docconfiglistview.h @@ -30,8 +30,12 @@ public: DocConfigListView(TQWidget *parent = 0, const char *name = 0); ~DocConfigListView(); +signals: + void itemActivated(); + protected slots: - void clickedItem(TQListViewItem *item, const TQPoint &pnt, int c); + void itemClicked(TQListViewItem *item, const TQPoint &pnt, int c); + void itemDoubleClicked(TQListViewItem *item, const TQPoint &pnt, int c); }; #endif diff --git a/parts/documentation/docglobalconfigwidget.cpp b/parts/documentation/docglobalconfigwidget.cpp index cb6c3776..b27cb5f9 100644 --- a/parts/documentation/docglobalconfigwidget.cpp +++ b/parts/documentation/docglobalconfigwidget.cpp @@ -62,7 +62,9 @@ DocGlobalConfigWidget::DocGlobalConfigWidget(DocumentationPart *part, { (*it)->loadCatalogConfiguration( m_View ); } + connect( m_View, TQT_SIGNAL(itemActivated()), this, TQT_SLOT(editCollectionButtonClicked()) ); + TDEConfig *config = m_part->config(); //read full text search settings config->setGroup("htdig"); @@ -145,6 +147,7 @@ void DocGlobalConfigWidget::editCollectionButtonClicked() { item->docPlugin()->deleteCatalogConfiguration(item); // this removes the old entry by name item->docPlugin()->editCatalogConfiguration(item, dlg.title(), dlg.url()); + activeView()->sort(); } } |