X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/be9746e87bb6a42e641dbf36c528a60fb564420a..ba6c853219c78e4e2a491d416b94e4e4c1aef591:/src/dolphincontextmenu.cpp diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index ce14c37ef..f60d59298 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -64,7 +64,8 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent, } DolphinContextMenu::~DolphinContextMenu() -{} +{ +} void DolphinContextMenu::open() { @@ -111,9 +112,9 @@ void DolphinContextMenu::openTrashContextMenu() if (popup->exec(QCursor::pos()) == emptyTrashAction) { const QString text(i18n("Do you really want to empty the Trash? All items will get deleted.")); const bool del = KMessageBox::warningContinueCancel(m_mainWindow, - text, - QString(), - KGuiItem(i18n("Empty Trash"), KIcon("user-trash")) + text, + QString(), + KGuiItem(i18n("Empty Trash"), KIcon("user-trash")) ) == KMessageBox::Continue; if (del) { KonqOperations::emptyTrash(m_mainWindow); @@ -180,7 +181,7 @@ void DolphinContextMenu::openItemContextMenu() const KUrl selectedUrl(m_fileInfo->url()); if (selectedUrl.isValid()) { DolphinSettings::instance().placesModel()->addPlace(selectedUrl.fileName(), - selectedUrl); + selectedUrl); } } else if (serviceActions.contains(activatedAction)) { // one of the 'Actions' items has been selected @@ -234,6 +235,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 +248,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(); @@ -361,7 +370,7 @@ QList DolphinContextMenu::insertOpenWithItems(KMenu* popup, } QList DolphinContextMenu::insertActionItems(KMenu* popup, - QVector& actionsVector) + QVector& actionsVector) { // Parts of the following code have been taken // from the class KonqOperations located in