┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-04-10 11:22:56 +0000
committerPeter Penz <[email protected]>2007-04-10 11:22:56 +0000
commit6422ae393ed378f8dcde0bf35e1f8d67a5df2295 (patch)
tree8ebf2bfde66c50244ba86734cead36d4bb7250b5 /src/dolphinmainwindow.cpp
parent5b5a7b8da8cb3ee6bbb9f7450c87fca5de41dc05 (diff)
allow to enable the categorization feature for sorting
svn path=/trunk/KDE/kdebase/apps/; revision=652200
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 3a375ebb9..eed6da4ea 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -275,6 +275,14 @@ void DolphinMainWindow::slotShowHiddenFilesChanged()
showHiddenFilesAction->setChecked(m_activeView->showHiddenFiles());
}
+void DolphinMainWindow::slotCategorizedSortingChanged()
+{
+ KToggleAction* categorizedSortingAction =
+ static_cast<KToggleAction*>(actionCollection()->action("categorized"));
+ categorizedSortingAction->setChecked(m_activeView->categorizedSorting());
+ categorizedSortingAction->setEnabled(m_activeView->supportsCategorizedSorting());
+}
+
void DolphinMainWindow::slotSortingChanged(DolphinView::Sorting sorting)
{
QAction* action = 0;
@@ -714,6 +722,12 @@ void DolphinMainWindow::toggleSortOrder()
m_activeView->setSortOrder(order);
}
+void DolphinMainWindow::toggleSortCategorization()
+{
+ const bool categorizedSorting = m_activeView->categorizedSorting();
+ m_activeView->setCategorizedSorting(!categorizedSorting);
+}
+
void DolphinMainWindow::clearInfo()
{
m_activeView->setAdditionalInfo(KFileItemDelegate::NoInformation);
@@ -1157,6 +1171,10 @@ void DolphinMainWindow::setupActions()
sortDescending->setText(i18n("Descending"));
connect(sortDescending, SIGNAL(triggered()), this, SLOT(toggleSortOrder()));
+ KToggleAction* sortCategorized = actionCollection()->add<KToggleAction>("categorized");
+ sortCategorized->setText(i18n("Categorized"));
+ connect(sortCategorized, SIGNAL(triggered()), this, SLOT(toggleSortCategorization()));
+
KToggleAction* clearInfo = actionCollection()->add<KToggleAction>("clear_info");
clearInfo->setText(i18n("No Information"));
connect(clearInfo, SIGNAL(triggered()), this, SLOT(clearInfo()));
@@ -1391,6 +1409,7 @@ void DolphinMainWindow::updateViewActions()
slotSortingChanged(m_activeView->sorting());
slotSortOrderChanged(m_activeView->sortOrder());
+ slotCategorizedSortingChanged();
slotAdditionalInfoChanged(m_activeView->additionalInfo());
KToggleAction* showFilterBarAction =
@@ -1452,6 +1471,8 @@ void DolphinMainWindow::connectViewSignals(int viewIndex)
this, SLOT(slotShowPreviewChanged()));
connect(view, SIGNAL(showHiddenFilesChanged()),
this, SLOT(slotShowHiddenFilesChanged()));
+ connect(view, SIGNAL(categorizedSortingChanged()),
+ this, SLOT(slotCategorizedSortingChanged()));
connect(view, SIGNAL(sortingChanged(DolphinView::Sorting)),
this, SLOT(slotSortingChanged(DolphinView::Sorting)));
connect(view, SIGNAL(sortOrderChanged(Qt::SortOrder)),