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