From 6f5f07d391043175d955d62bd09c77af14164faf Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 12 Jun 2007 21:45:22 +0000 Subject: * allow to toggle the content of split views by the context menu * minor cleanups in DolphinMainWindow svn path=/trunk/KDE/kdebase/apps/; revision=674713 --- src/dolphincontextmenu.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/dolphincontextmenu.cpp') diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index ce14c37ef..038902e6b 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -234,6 +234,12 @@ void DolphinContextMenu::openViewportContextMenu() viewModeMenu->addAction(previewsMode); popup->addMenu(viewModeMenu); + + QAction* toggleViewsAction = 0; + if (m_mainWindow->isSplit()) { + toggleViewsAction = popup->addAction(i18n("Toggle Views")); + } + popup->addSeparator(); QAction* bookmarkAction = popup->addAction(KIcon("bookmark-folder"), i18n("Bookmark This Folder...")); @@ -241,16 +247,18 @@ void DolphinContextMenu::openViewportContextMenu() QAction* propertiesAction = popup->addAction(i18n("Properties")); - QAction* activatedAction = popup->exec(QCursor::pos()); - if (activatedAction == propertiesAction) { + QAction* action = popup->exec(QCursor::pos()); + if (action == propertiesAction) { const KUrl& url = m_mainWindow->activeViewContainer()->url(); KPropertiesDialog dialog(url); dialog.exec(); - } else if (activatedAction == bookmarkAction) { + } else if (action == bookmarkAction) { const KUrl& url = m_mainWindow->activeViewContainer()->url(); if (url.isValid()) { DolphinSettings::instance().placesModel()->addPlace(url.fileName(), url); } + } else if ((toggleViewsAction != 0) && (action == toggleViewsAction)) { + m_mainWindow->toggleViews(); } popup->deleteLater(); -- cgit v1.3