X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/9c8e7f4e43d23c6d014ca4ffe2083ad8cc737753..78cb4cae3d97ee1fc843b0500872cf2dbde8f723:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 2585a7b82..491411cb2 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -250,6 +250,13 @@ void DolphinMainWindow::slotViewModeChanged() updateViewActions(); } +void DolphinMainWindow::slotShowPreviewChanged() +{ + // It is not enough to update the 'Show Preview' action, also + // the 'Zoom In' and 'Zoom Out' actions must be adapted. + updateViewActions(); +} + void DolphinMainWindow::slotShowHiddenFilesChanged() { KToggleAction* showHiddenFilesAction = @@ -322,6 +329,7 @@ void DolphinMainWindow::slotHistoryChanged() void DolphinMainWindow::slotUrlChanged(const KUrl& url) { updateEditActions(); + updateViewActions(); updateGoActions(); setCaption(url.fileName()); } @@ -994,10 +1002,11 @@ void DolphinMainWindow::setupActions() connect(menu, SIGNAL(aboutToShow()), this, SLOT(updateNewMenu())); - QAction* action = actionCollection()->addAction("new_window"); - action->setIcon(KIcon("window_new")); - action->setText(i18n("New &Window")); - connect(action, SIGNAL(triggered()), this, SLOT(openNewMainWindow())); + QAction* newWindow = actionCollection()->addAction("new_window"); + newWindow->setIcon(KIcon("window_new")); + newWindow->setText(i18n("New &Window")); + newWindow->setShortcut(Qt::CTRL | Qt::Key_N); + connect(newWindow, SIGNAL(triggered()), this, SLOT(openNewMainWindow())); QAction* rename = actionCollection()->addAction("rename"); rename->setText(i18n("Rename")); @@ -1012,7 +1021,7 @@ void DolphinMainWindow::setupActions() QAction* deleteAction = actionCollection()->addAction("delete"); deleteAction->setText(i18n("Delete")); - deleteAction->setShortcut(Qt::ALT | Qt::Key_Delete); + deleteAction->setShortcut(Qt::SHIFT | Qt::Key_Delete); deleteAction->setIcon(KIcon("editdelete")); connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteItems())); @@ -1289,6 +1298,10 @@ void DolphinMainWindow::updateViewActions() static_cast(actionCollection()->action("show_filter_bar")); showFilterBarAction->setChecked(m_activeView->isFilterBarVisible()); + KToggleAction* showPreviewAction = + static_cast(actionCollection()->action("show_preview")); + showPreviewAction->setChecked(m_activeView->showPreview()); + KToggleAction* showHiddenFilesAction = static_cast(actionCollection()->action("show_hidden_files")); showHiddenFilesAction->setChecked(m_activeView->showHiddenFiles()); @@ -1336,6 +1349,8 @@ void DolphinMainWindow::connectViewSignals(int viewIndex) DolphinView* view = m_view[viewIndex]; connect(view, SIGNAL(modeChanged()), this, SLOT(slotViewModeChanged())); + connect(view, SIGNAL(showPreviewChanged()), + this, SLOT(slotShowPreviewChanged())); connect(view, SIGNAL(showHiddenFilesChanged()), this, SLOT(slotShowHiddenFilesChanged())); connect(view, SIGNAL(sortingChanged(DolphinView::Sorting)),