From cdc40d4398510878e5ff5926be3f87e6ac5108c9 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 28 Jan 2008 11:33:49 +0000 Subject: Centralize three more actions so that they are available in DolphinPart: 'Show preview' 'Show hidden files' 'Categorized sorting' Found a way of sharing the actions with even less code duplication, discussed it with Peter, but this will be for after 4.0.1 svn path=/branches/KDE/4.0/kdebase/apps/; revision=767566 --- src/dolphinview.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/dolphinview.cpp') diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 4aeabb265..530508fb7 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -1344,6 +1344,29 @@ KAction* DolphinView::createSortDescendingAction(KActionCollection* collection) return sortDescending; } +KAction* DolphinView::createShowPreviewAction(KActionCollection* collection) +{ + KToggleAction* showPreview = collection->add("show_preview"); + showPreview->setText(i18nc("@action:intoolbar", "Preview")); + showPreview->setIcon(KIcon("view-preview")); + return showPreview; +} + +KAction* DolphinView::createShowInGroupsAction(KActionCollection* collection) +{ + KToggleAction* showInGroups = collection->add("show_in_groups"); + showInGroups->setText(i18nc("@action:inmenu View", "Show in Groups")); + return showInGroups; +} + +KAction* DolphinView::createShowHiddenFilesAction(KActionCollection* collection) +{ + KToggleAction* showHiddenFiles = collection->add("show_hidden_files"); + showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files")); + showHiddenFiles->setShortcut(Qt::ALT | Qt::Key_Period); + return showHiddenFiles; +} + QActionGroup* DolphinView::createAdditionalInformationActionGroup(KActionCollection* collection) { QActionGroup* showInformationGroup = new QActionGroup(collection); -- cgit v1.3