summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2014-10-23 11:47:22 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2014-10-23 11:47:22 +0900
commit91d8d752c79df1bb4db425affd34116ec1157dd7 (patch)
tree82d64497473f52b82507e8883134db881f24188a
parent250abe522b96533bb9b34eef94282e195f67aa40 (diff)
downloadtdevelop-91d8d752c79df1bb4db425affd34116ec1157dd7.tar.gz
tdevelop-91d8d752c79df1bb4db425affd34116ec1157dd7.zip
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>
-rw-r--r--parts/documentation/docconfiglistview.cpp19
-rw-r--r--parts/documentation/docconfiglistview.h6
-rw-r--r--parts/documentation/docglobalconfigwidget.cpp3
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();
}
}