+ updateHistory();
+ updateEditActions();
+ updateViewActions();
+ updateGoActions();
+
+ const KUrl url = m_activeViewContainer->url();
+ setUrlAsCaption(url);
+ if (m_viewTab.count() > 1) {
+ m_tabBar->setTabText(m_tabIndex, tabName(url));
+ m_tabBar->setTabIcon(m_tabIndex, KIcon(KMimeType::iconNameForUrl(url)));
+ }
+
+ emit urlChanged(url);
+}
+
+DolphinViewContainer* DolphinMainWindow::createViewContainer(const KUrl& url, QWidget* parent)
+{
+ DolphinViewContainer* container = new DolphinViewContainer(url, parent);
+
+ // The places-selector from the URL navigator should only be shown
+ // if the places dock is invisible
+ QDockWidget* placesDock = findChild<QDockWidget*>("placesDock");
+ container->urlNavigator()->setPlacesSelectorVisible(!placesDock || !placesDock->isVisible());
+
+ return container;
+}
+
+void DolphinMainWindow::setupActions()
+{
+ // setup 'File' menu
+ m_newFileMenu = new DolphinNewFileMenu(this);
+ KMenu* menu = m_newFileMenu->menu();
+ menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
+ menu->setIcon(KIcon("document-new"));
+ m_newFileMenu->setDelayed(false);
+ connect(menu, SIGNAL(aboutToShow()),
+ this, SLOT(updateNewMenu()));
+
+ KAction* newWindow = actionCollection()->addAction("new_window");
+ newWindow->setIcon(KIcon("window-new"));
+ newWindow->setText(i18nc("@action:inmenu File", "New &Window"));
+ newWindow->setShortcut(Qt::CTRL | Qt::Key_N);
+ connect(newWindow, SIGNAL(triggered()), this, SLOT(openNewMainWindow()));
+
+ KAction* newTab = actionCollection()->addAction("new_tab");
+ newTab->setIcon(KIcon("tab-new"));
+ newTab->setText(i18nc("@action:inmenu File", "New Tab"));
+ newTab->setShortcut(KShortcut(Qt::CTRL | Qt::Key_T, Qt::CTRL | Qt::SHIFT | Qt::Key_N));
+ connect(newTab, SIGNAL(triggered()), this, SLOT(openNewTab()));
+
+ KAction* closeTab = actionCollection()->addAction("close_tab");
+ closeTab->setIcon(KIcon("tab-close"));
+ closeTab->setText(i18nc("@action:inmenu File", "Close Tab"));
+ closeTab->setShortcut(Qt::CTRL | Qt::Key_W);
+ closeTab->setEnabled(false);
+ connect(closeTab, SIGNAL(triggered()), this, SLOT(closeTab()));
+
+ KStandardAction::quit(this, SLOT(quit()), actionCollection());
+
+ // setup 'Edit' menu
+ KStandardAction::undo(this,
+ SLOT(undo()),
+ actionCollection());
+
+ // need to remove shift+del from cut action, else the shortcut for deletejob
+ // doesn't work
+ KAction* cut = KStandardAction::cut(this, SLOT(cut()), actionCollection());
+ KShortcut cutShortcut = cut->shortcut();
+ cutShortcut.remove(Qt::SHIFT | Qt::Key_Delete, KShortcut::KeepEmpty);
+ cut->setShortcut(cutShortcut);
+ KStandardAction::copy(this, SLOT(copy()), actionCollection());
+ KAction* paste = KStandardAction::paste(this, SLOT(paste()), actionCollection());
+ // The text of the paste-action is modified dynamically by Dolphin
+ // (e. g. to "Paste One Folder"). To prevent that the size of the toolbar changes
+ // due to the long text, the text "Paste" is used:
+ paste->setIconText(i18nc("@action:inmenu Edit", "Paste"));
+
+ KStandardAction::find(this, SLOT(find()), actionCollection());
+
+ KAction* selectAll = actionCollection()->addAction("select_all");
+ selectAll->setText(i18nc("@action:inmenu Edit", "Select All"));
+ selectAll->setShortcut(Qt::CTRL | Qt::Key_A);
+ connect(selectAll, SIGNAL(triggered()), this, SLOT(selectAll()));
+
+ KAction* invertSelection = actionCollection()->addAction("invert_selection");
+ invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
+ invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A);
+ connect(invertSelection, SIGNAL(triggered()), this, SLOT(invertSelection()));
+
+ // setup 'View' menu
+ // (note that most of it is set up in DolphinViewActionHandler)
+
+ KAction* split = actionCollection()->addAction("split_view");
+ split->setShortcut(Qt::Key_F3);
+ updateSplitAction();