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 <michele.calgaro@yahoo.it>
pull/1/head
Michele Calgaro 10 years ago
parent 250abe522b
commit 91d8d752c7

@ -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"

@ -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

@ -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();
}
}

Loading…
Cancel
Save