-}
-
-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);
- }
- }
- }
- }
- m_createFileTemplates.sort();
-
- unplugActionList("create_actions");
- KSortableList<CreateFileEntry, QString>::ConstIterator it = m_createFileTemplates.begin();
- KSortableList<CreateFileEntry, QString>::ConstIterator end = m_createFileTemplates.end();
- /* KDE4-TODO: don't port this code; use KNewMenu instead
- while (it != end) {
- CreateFileEntry entry = (*it).value();
- KAction* action = new KAction(entry.name);
- action->setIcon(entry.icon);
- action->setName((*it).index());
- connect(action, SIGNAL(activated()),
- this, SLOT(createFile()));
-
- const QChar section = ((*it).index()[0]);
- switch (section) {
- case '1':
- case '2': {
- m_fileGroupActions.append(action);
- break;
- }
-
- case '3':
- case '4': {
- // TODO: not used yet. See documentation of DolphinMainWindow::linkGroupActions()
- // and DolphinMainWindow::linkToDeviceActions() in the header file for details.
- //m_linkGroupActions.append(action);
- break;
- }
-
- case '5': {
- // TODO: not used yet. See documentation of DolphinMainWindow::linkGroupActions()
- // and DolphinMainWindow::linkToDeviceActions() in the header file for details.
- //m_linkToDeviceActions.append(action);
- break;
- }
- default:
- break;
- }
- ++it;
- }
-
- plugActionList("create_file_group", m_fileGroupActions);
- //plugActionList("create_link_group", m_linkGroupActions);
- //plugActionList("link_to_device", m_linkToDeviceActions);*/
-}
-
-void DolphinMainWindow::updateHistory()
-{
- int index = 0;
- const Q3ValueList<UrlNavigator::HistoryElem> list = m_activeView->urlHistory(index);
-
- QAction* backAction = actionCollection()->action("go_back");
- if (backAction != 0) {
- backAction->setEnabled(index < static_cast<int>(list.count()) - 1);
+ 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