-}
-
-void DolphinMainWindow::setupCreateNewMenuActions()
-{
- // Parts of the following code have been taken
- // from the class KNewMenu located in
- // libqonq/knewmenu.h of Konqueror.
- // Copyright (C) 1998, 1999 David Faure <faure@kde.org>
- // 2003 Sven Leiber <s.leiber@web.de>
-
- QStringList files = actionCollection()->instance()->dirs()->findAllResources("templates");
- for (QStringList::Iterator it = files.begin() ; it != files.end(); ++it) {
- if ((*it)[0] != '.' ) {
- KSimpleConfig config(*it, true);
- config.setDesktopGroup();
-
- // tricky solution to ensure that TextFile is at the beginning
- // because this filetype is the most used (according kde-core discussion)
- const QString name(config.readEntry("Name"));
- QString key(name);
-
- const QString path(config.readPathEntry("Url"));
- if (!path.endsWith("emptydir")) {
- if (path.endsWith("TextFile.txt")) {
- key = "1" + key;
- }
- else if (!KDesktopFile::isDesktopFile(path)) {
- key = "2" + key;
- }
- else if (path.endsWith("Url.desktop")){
- key = "3" + key;
- }
- else if (path.endsWith("Program.desktop")){
- key = "4" + key;
- }
- else {
- key = "5";
- }
-
- const QString icon(config.readEntry("Icon"));
- const QString comment(config.readEntry("Comment"));
- const QString type(config.readEntry("Type"));
-
- const QString filePath(*it);
-
-
- if (type == "Link") {
- CreateFileEntry entry;
- entry.name = name;
- entry.icon = icon;
- entry.comment = comment;
- entry.templatePath = filePath;
- m_createFileTemplates.insert(key, entry);
- }
- }
- }
+ 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(folderActivated(KUrl)),
+ this, SLOT(changeUrl(KUrl)));
+ connect(foldersPanel, SIGNAL(folderMiddleClicked(KUrl)),
+ this, SLOT(openNewTab(KUrl)));
+ connect(foldersPanel, SIGNAL(errorMessage(QString)),
+ this, SLOT(slotPanelErrorMessage(QString)));
+
+ // 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(terminalPanel, SIGNAL(changeUrl(KUrl)), this, SLOT(slotTerminalDirectoryChanged(KUrl)));
+ 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
+
+ if (GeneralSettings::version() < 200) {
+ infoDock->hide();
+ foldersDock->hide();
+#ifndef Q_OS_WIN
+ terminalDock->hide();
+#endif