+ connect(this, SIGNAL(urlChanged(KUrl)),
+ infoPanel, SLOT(setUrl(KUrl)));
+ connect(this, SIGNAL(selectionChanged(KFileItemList)),
+ infoPanel, SLOT(setSelection(KFileItemList)));
+ connect(this, SIGNAL(requestItemInfo(KFileItem)),
+ infoPanel, SLOT(requestDelayedItemInfo(KFileItem)));
+
+ // Setup "Folders"
+ DolphinDockWidget* foldersDock = new DolphinDockWidget(i18nc("@title:window", "Folders"));
+ foldersDock->setLocked(lock);
+ foldersDock->setObjectName("foldersDock");
+ foldersDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+ FoldersPanel* foldersPanel = new FoldersPanel(foldersDock);
+ foldersPanel->setCustomContextMenuActions(QList<QAction*>() << lockLayoutAction);
+ foldersDock->setWidget(foldersPanel);
+
+ QAction* foldersAction = foldersDock->toggleViewAction();
+ createPanelAction(KIcon("folder"), Qt::Key_F7, foldersAction, "show_folders_panel");
+
+ addDockWidget(Qt::LeftDockWidgetArea, foldersDock);
+ connect(this, SIGNAL(urlChanged(KUrl)),
+ foldersPanel, SLOT(setUrl(KUrl)));
+ connect(foldersPanel, SIGNAL(changeUrl(KUrl,Qt::MouseButtons)),
+ this, SLOT(handlePlacesClick(KUrl,Qt::MouseButtons)));
+
+ // Setup "Terminal"
+#ifndef Q_OS_WIN
+ DolphinDockWidget* terminalDock = new DolphinDockWidget(i18nc("@title:window Shell terminal", "Terminal"));
+ terminalDock->setLocked(lock);
+ terminalDock->setObjectName("terminalDock");
+ terminalDock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
+ Panel* terminalPanel = new TerminalPanel(terminalDock);
+ terminalPanel->setCustomContextMenuActions(QList<QAction*>() << lockLayoutAction);
+ terminalDock->setWidget(terminalPanel);
+
+ connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide()));
+ connect(terminalDock, SIGNAL(visibilityChanged(bool)),
+ terminalPanel, SLOT(dockVisibilityChanged()));
+
+ QAction* terminalAction = terminalDock->toggleViewAction();
+ createPanelAction(KIcon("utilities-terminal"), Qt::Key_F4, terminalAction, "show_terminal_panel");
+
+ addDockWidget(Qt::BottomDockWidgetArea, terminalDock);
+ connect(this, SIGNAL(urlChanged(KUrl)),
+ terminalPanel, SLOT(setUrl(KUrl)));
+#endif
+
+ // Setup "Search"
+#ifdef HAVE_NEPOMUK
+ DolphinDockWidget* searchDock = new DolphinDockWidget(i18nc("@title:window", "Search"));
+ searchDock->setLocked(lock);
+ searchDock->setObjectName("searchDock");
+ searchDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+ Panel* searchPanel = new SearchPanel(searchDock);
+ searchPanel->setCustomContextMenuActions(QList<QAction*>() << lockLayoutAction);
+ connect(searchPanel, SIGNAL(urlActivated(KUrl)), this, SLOT(handleUrl(KUrl)));
+ searchDock->setWidget(searchPanel);
+
+ QAction* searchAction = searchDock->toggleViewAction();
+ createPanelAction(KIcon("system-search"), Qt::Key_F12, searchAction, "show_search_panel");
+ addDockWidget(Qt::RightDockWidgetArea, searchDock);
+ connect(this, SIGNAL(urlChanged(KUrl)),
+ searchPanel, SLOT(setUrl(KUrl)));
+#endif
+
+ if (GeneralSettings::version() < 200) {
+ infoDock->hide();
+ foldersDock->hide();
+#ifndef Q_OS_WIN
+ terminalDock->hide();
+#endif
+#ifdef HAVE_NEPOMUK
+ searchDock->hide();
+#endif
+ }
+
+ // Setup "Places"
+ DolphinDockWidget* placesDock = new DolphinDockWidget(i18nc("@title:window", "Places"));
+ placesDock->setLocked(lock);
+ placesDock->setObjectName("placesDock");
+ placesDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+
+ PlacesPanel* placesPanel = new PlacesPanel(placesDock);
+ QAction* separator = new QAction(placesPanel);
+ separator->setSeparator(true);
+ QList<QAction*> placesActions;
+ placesActions.append(separator);
+ placesActions.append(lockLayoutAction);
+ placesPanel->addActions(placesActions);
+ placesPanel->setModel(DolphinPlacesModel::instance());
+ placesPanel->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ placesDock->setWidget(placesPanel);
+
+ QAction* placesAction = placesDock->toggleViewAction();
+ createPanelAction(KIcon("bookmarks"), Qt::Key_F9, placesAction, "show_places_panel");
+
+ addDockWidget(Qt::LeftDockWidgetArea, placesDock);
+ connect(placesPanel, SIGNAL(urlChanged(KUrl,Qt::MouseButtons)),
+ this, SLOT(handlePlacesClick(KUrl,Qt::MouseButtons)));
+ connect(this, SIGNAL(urlChanged(KUrl)),
+ placesPanel, SLOT(setUrl(KUrl)));
+ connect(placesDock, SIGNAL(visibilityChanged(bool)),
+ this, SLOT(slotPlacesPanelVisibilityChanged(bool)));
+
+ // Add actions into the "Panels" menu
+ KActionMenu* panelsMenu = new KActionMenu(i18nc("@action:inmenu View", "Panels"), this);
+ actionCollection()->addAction("panels", panelsMenu);
+ panelsMenu->setDelayed(false);
+ const KActionCollection* ac = actionCollection();
+ panelsMenu->addAction(ac->action("show_places_panel"));
+ panelsMenu->addAction(ac->action("show_information_panel"));
+ panelsMenu->addAction(ac->action("show_folders_panel"));
+#ifndef Q_OS_WIN
+ panelsMenu->addAction(ac->action("show_terminal_panel"));
+#endif
+#ifdef HAVE_NEPOMUK
+ panelsMenu->addAction(ac->action("show_search_panel"));
+#endif
+ panelsMenu->addSeparator();
+ panelsMenu->addAction(lockLayoutAction);