From fe8b349bcee6426ddc6f33bc221dfc8973b07e33 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 2 Mar 2007 18:59:09 +0000 Subject: It seems some people cannot live without a tree view ;-) So Dolphin will provide a dock which contains the directory hierarchy, which will be synchronized with the active view. It does not clutter the UI (the dock can be turned off), but makes happy a lot of users -> kind of win-win-situation. This commit provides only a rough initial version, which shows the current URL as tree. I'll work on the interaction during the next week(s)... svn path=/trunk/KDE/kdebase/apps/; revision=638628 --- src/dolphinmainwindow.cpp | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 72b6703d8..f7b7246b4 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -24,21 +24,21 @@ #include +#include "bookmarkssidebarpage.h" #include "dolphinapplication.h" #include "dolphinnewmenu.h" #include "dolphinsettings.h" #include "dolphinsettingsdialog.h" #include "dolphinstatusbar.h" -#include "dolphinapplication.h" -#include "urlnavigator.h" -#include "dolphinsettings.h" -#include "bookmarkssidebarpage.h" #include "infosidebarpage.h" -#include "dolphin_generalsettings.h" -#include "viewpropertiesdialog.h" -#include "viewproperties.h" #include "metadataloader.h" #include "mainwindowadaptor.h" +#include "treeviewsidebarpage.h" +#include "urlnavigator.h" +#include "viewpropertiesdialog.h" +#include "viewproperties.h" + +#include "dolphin_generalsettings.h" #include #include @@ -1191,6 +1191,10 @@ void DolphinMainWindow::setupActions() void DolphinMainWindow::setupDockWidgets() { + // TODO: there's a lot copy/paste code here. Provide a generic approach + // after the dock concept has been finalized. + + // setup "Bookmarks" QDockWidget* shortcutsDock = new QDockWidget(i18n("Bookmarks")); shortcutsDock->setObjectName("bookmarksDock"); shortcutsDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); @@ -1201,6 +1205,7 @@ void DolphinMainWindow::setupDockWidgets() addDockWidget(Qt::LeftDockWidgetArea, shortcutsDock); + // setup "Information" QDockWidget* infoDock = new QDockWidget(i18n("Information")); infoDock->setObjectName("infoDock"); infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); @@ -1210,6 +1215,17 @@ void DolphinMainWindow::setupDockWidgets() actionCollection()->addAction("show_info_panel", infoDock->toggleViewAction()); addDockWidget(Qt::RightDockWidgetArea, infoDock); + + // setup "Tree View" + QDockWidget* treeViewDock = new QDockWidget(i18n("Folders")); // TODO: naming? + treeViewDock->setObjectName("treeViewDock"); + treeViewDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + treeViewDock->setWidget(new TreeViewSidebarPage(this)); + + treeViewDock->toggleViewAction()->setText(i18n("Show Folders Panel")); + actionCollection()->addAction("show_folders_panel", treeViewDock->toggleViewAction()); + + addDockWidget(Qt::LeftDockWidgetArea, treeViewDock); } void DolphinMainWindow::updateHistory() -- cgit v1.3