m_updateToolBarTimer(0),
m_lastHandleUrlStatJob(0)
{
- // Workaround for a X11-issue in combination with KModifierInfo
- // (see DolphinContextMenu::initializeModifierKeyInfo() for
- // more information):
- DolphinContextMenu::initializeModifierKeyInfo();
-
setObjectName("Dolphin#");
m_viewTab.append(ViewTab());
void DolphinMainWindow::openInNewTab()
{
- const KFileItemList list = m_activeViewContainer->view()->selectedItems();
+ const KFileItemList& list = m_activeViewContainer->view()->selectedItems();
if (list.isEmpty()) {
openNewTab(m_activeViewContainer->url());
- } else if ((list.count() == 1) && list[0].isDir()) {
- openNewTab(list[0].url());
+ } else {
+ foreach (const KFileItem& item, list) {
+ const KUrl& url = DolphinView::openItemAsFolderUrl(item);
+ if (!url.isEmpty()) {
+ openNewTab(url);
+ }
+ }
}
}
const KFileItemList list = m_activeViewContainer->view()->selectedItems();
if (list.isEmpty()) {
newWindowUrl = m_activeViewContainer->url();
- } else if ((list.count() == 1) && list[0].isDir()) {
- newWindowUrl = list[0].url();
+ } else if (list.count() == 1) {
+ const KFileItem& item = list.first();
+ newWindowUrl = DolphinView::openItemAsFolderUrl(item);
}
if (!newWindowUrl.isEmpty()) {
break;
case KDialog::No:
// Close only the current tab
- closeTab();
+ closeTab();
default:
event->ignore();
return;
// openNewTab() needs to be called only tabCount - 1 times
if (i != tabCount - 1) {
- openNewTab();
+ openNewTab();
}
}
const ViewTab& viewTab = m_viewTab[tab];
const DolphinView* view = viewTab.isPrimaryViewActive ? viewTab.primaryView->view()
: viewTab.secondaryView->view();
- const QString error = DragAndDropHelper::dropUrls(view->rootItem(), view->url(), event);
+ QString error;
+ DragAndDropHelper::dropUrls(view->rootItem(), view->url(), event, error);
if (!error.isEmpty()) {
activeViewContainer()->showMessage(error, DolphinViewContainer::Error);
}
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()));
KToggleAction* editableLocation = actionCollection()->add<KToggleAction>("editable_location");
editableLocation->setText(i18nc("@action:inmenu Navigation Bar", "Editable Location"));
- editableLocation->setShortcut(Qt::CTRL | Qt::Key_L);
+ editableLocation->setShortcut(Qt::Key_F6);
connect(editableLocation, SIGNAL(triggered()), this, SLOT(toggleEditLocation()));
KAction* replaceLocation = actionCollection()->addAction("replace_location");
replaceLocation->setText(i18nc("@action:inmenu Navigation Bar", "Replace Location"));
- replaceLocation->setShortcut(Qt::Key_F6);
+ replaceLocation->setShortcut(Qt::CTRL | Qt::Key_L);
connect(replaceLocation, SIGNAL(triggered()), this, SLOT(replaceLocation()));
// setup 'Go' menu
m_recentTabsMenu = new KActionMenu(i18n("Recently Closed Tabs"), this);
m_recentTabsMenu->setIcon(KIcon("edit-undo"));
+ m_recentTabsMenu->setDelayed(false);
actionCollection()->addAction("closed_tabs", m_recentTabsMenu);
connect(m_recentTabsMenu->menu(), SIGNAL(triggered(QAction*)),
this, SLOT(restoreClosedTab(QAction*)));
openInNewTab->setIcon(KIcon("tab-new"));
connect(openInNewTab, SIGNAL(triggered()), this, SLOT(openInNewTab()));
+ KAction* openInNewTabs = actionCollection()->addAction("open_in_new_tabs");
+ openInNewTabs->setText(i18nc("@action:inmenu", "Open in New Tabs"));
+ openInNewTabs->setIcon(KIcon("tab-new"));
+ connect(openInNewTabs, SIGNAL(triggered()), this, SLOT(openInNewTab()));
+
KAction* openInNewWindow = actionCollection()->addAction("open_in_new_window");
openInNewWindow->setText(i18nc("@action:inmenu", "Open in New Window"));
openInNewWindow->setIcon(KIcon("window-new"));
connect(foldersPanel, SIGNAL(folderActivated(KUrl)),
this, SLOT(changeUrl(KUrl)));
connect(foldersPanel, SIGNAL(folderMiddleClicked(KUrl)),
- this, SLOT(openNewActivatedTab(KUrl)));
+ this, SLOT(openNewTab(KUrl)));
connect(foldersPanel, SIGNAL(errorMessage(QString)),
this, SLOT(slotPanelErrorMessage(QString)));
connect(placesPanel, SIGNAL(placeActivated(KUrl)),
this, SLOT(changeUrl(KUrl)));
connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)),
- this, SLOT(openNewActivatedTab(KUrl)));
+ this, SLOT(openNewTab(KUrl)));
connect(placesPanel, SIGNAL(errorMessage(QString)),
this, SLOT(slotPanelErrorMessage(QString)));
connect(this, SIGNAL(urlChanged(KUrl)),
placesPanel, SLOT(setUrl(KUrl)));
connect(placesDock, SIGNAL(visibilityChanged(bool)),
this, SLOT(slotPlacesPanelVisibilityChanged(bool)));
+ connect(this, SIGNAL(settingsChanged()),
+ placesPanel, SLOT(readSettings()));
// Add actions into the "Panels" menu
KActionMenu* panelsMenu = new KActionMenu(i18nc("@action:inmenu View", "Panels"), this);
toggleSplitView();
}
}
+
+ emit settingsChanged();
}
void DolphinMainWindow::clearStatusBar()