* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *\r
***************************************************************************/\r
\r
+#include <config-kmetadata.h>\r
#include "dolphinmainwindow.h"\r
\r
#include <assert.h>\r
\r
+#include "bookmarkssidebarpage.h"\r
#include "dolphinapplication.h"\r
#include "dolphinnewmenu.h"\r
#include "dolphinsettings.h"\r
#include "dolphinsettingsdialog.h"\r
#include "dolphinstatusbar.h"\r
-#include "dolphinapplication.h"\r
-#include "urlnavigator.h"\r
-#include "dolphinsettings.h"\r
-#include "bookmarkssidebarpage.h"\r
#include "infosidebarpage.h"\r
-#include "dolphin_generalsettings.h"\r
-#include "viewpropertiesdialog.h"\r
-#include "viewproperties.h"\r
#include "metadataloader.h"\r
#include "mainwindowadaptor.h"\r
+#include "treeviewsidebarpage.h"\r
+#include "urlnavigator.h"\r
+#include "viewpropertiesdialog.h"\r
+#include "viewproperties.h"\r
+\r
+#include "dolphin_generalsettings.h"\r
\r
#include <kaction.h>\r
#include <kactioncollection.h>\r
QString seq = QKeySequence(Qt::ShiftModifier).toString();\r
seq.chop(1); // chop superfluous '+'\r
QAction* moveAction = popup.addAction(KIcon("goto"),\r
- i18n("&Move Here") + "\t" + seq);\r
+ i18n("&Move Here") + '\t' + seq);\r
\r
seq = QKeySequence(Qt::ControlModifier).toString();\r
seq.chop(1);\r
QAction* copyAction = popup.addAction(KIcon("editcopy"),\r
- i18n("&Copy Here") + "\t" + seq);\r
+ i18n("&Copy Here") + '\t' + seq);\r
\r
seq = QKeySequence(Qt::ControlModifier + Qt::ShiftModifier).toString();\r
seq.chop(1);\r
QAction* linkAction = popup.addAction(KIcon("www"),\r
- i18n("&Link Here") + "\t" + seq);\r
+ i18n("&Link Here") + '\t' + seq);\r
\r
popup.addSeparator();\r
popup.addAction(KIcon("stop"), i18n("Cancel"));\r
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
void DolphinMainWindow::slotUrlChanged(const KUrl& url)\r
{\r
updateEditActions();\r
+ updateViewActions();\r
updateGoActions();\r
setCaption(url.fileName());\r
}\r
\r
const bool del = KMessageBox::warningContinueCancel(this,\r
text,\r
- QString::null,\r
+ QString(),\r
KGuiItem(i18n("Delete"), KIcon("editdelete"))\r
) == KMessageBox::Continue;\r
if (del) {\r
\r
setupActions();\r
\r
- const KUrl& homeUrl = root.first().url();\r
+ const KUrl& homeUrl = settings.generalSettings()->homeUrl();\r
setCaption(homeUrl.fileName());\r
ViewProperties props(homeUrl);\r
m_view[PrimaryIdx] = new DolphinView(this,\r
// assure a proper default size if Dolphin runs the first time\r
resize(640, 480);\r
}\r
- \r
+ #ifdef HAVE_KMETADATA\r
if (!DolphinApplication::app()->metadataLoader()->storageUp())\r
activeView()->statusBar()->setMessage(i18n("Failed to contact Nepomuk service, annotation and tagging are disabled."), DolphinStatusBar::Error);\r
+ #endif\r
}\r
\r
void DolphinMainWindow::loadSettings()\r
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
\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
\r
void DolphinMainWindow::setupDockWidgets()\r
{\r
+ // TODO: there's a lot copy/paste code here. Provide a generic approach\r
+ // after the dock concept has been finalized.\r
+\r
+ // setup "Bookmarks"\r
QDockWidget* shortcutsDock = new QDockWidget(i18n("Bookmarks"));\r
shortcutsDock->setObjectName("bookmarksDock");\r
shortcutsDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);\r
\r
addDockWidget(Qt::LeftDockWidgetArea, shortcutsDock);\r
\r
+ // setup "Information"\r
QDockWidget* infoDock = new QDockWidget(i18n("Information"));\r
infoDock->setObjectName("infoDock");\r
infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);\r
actionCollection()->addAction("show_info_panel", infoDock->toggleViewAction());\r
\r
addDockWidget(Qt::RightDockWidgetArea, infoDock);\r
+\r
+ // setup "Tree View"\r
+ QDockWidget* treeViewDock = new QDockWidget(i18n("Folders")); // TODO: naming?\r
+ treeViewDock->setObjectName("treeViewDock");\r
+ treeViewDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);\r
+ treeViewDock->setWidget(new TreeViewSidebarPage(this));\r
+\r
+ treeViewDock->toggleViewAction()->setText(i18n("Show Folders Panel"));\r
+ actionCollection()->addAction("show_folders_panel", treeViewDock->toggleViewAction());\r
+\r
+ addDockWidget(Qt::LeftDockWidgetArea, treeViewDock);\r
+\r
+ const bool firstRun = DolphinSettings::instance().generalSettings()->firstRun();\r
+ if (firstRun) {\r
+ infoDock->hide();\r
+ treeViewDock->hide();\r
+ }\r
}\r
\r
void DolphinMainWindow::updateHistory()\r
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
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