┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-06-12 21:45:22 +0000
committerPeter Penz <[email protected]>2007-06-12 21:45:22 +0000
commit6f5f07d391043175d955d62bd09c77af14164faf (patch)
tree0bb9d0872652f2d3ff5fe92f9e320b017c3f6fd7 /src/dolphincontextmenu.cpp
parent329aa0c5f7327f71f4727ab9c42d3e8d2005b4aa (diff)
* allow to toggle the content of split views by the context menu
* minor cleanups in DolphinMainWindow svn path=/trunk/KDE/kdebase/apps/; revision=674713
Diffstat (limited to 'src/dolphincontextmenu.cpp')
-rw-r--r--src/dolphincontextmenu.cpp14
1 files changed, 11 insertions, 3 deletions
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();