Move "Adjust view properties" to dolphinviewactionhandler so that it's available in dolphinpart (konqueror) too.

Bug reported by kde-bug-hunter "lemma".

svn path=/trunk/KDE/kdebase/apps/; revision=804037
This commit is contained in:
David Faure 2008-05-04 21:16:30 +00:00
parent 5ad129ac78
commit fd98230020
6 changed files with 26 additions and 24 deletions

View file

@ -35,6 +35,10 @@ set(dolphinprivate_LIB_SRCS
selectionmanager.cpp
tooltipmanager.cpp
viewproperties.cpp
viewpropertiesdialog.cpp
viewpropsprogressinfo.cpp
additionalinfodialog.cpp
applyviewpropsjob.cpp
)
kde4_add_kcfg_files(dolphinprivate_LIB_SRCS
@ -84,8 +88,6 @@ install(FILES dolphinpart.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
##########################################
set(dolphin_SRCS
additionalinfodialog.cpp
applyviewpropsjob.cpp
columnviewsettingspage.cpp
commentwidget.cpp
commenteditwidget.cpp
@ -121,10 +123,9 @@ set(dolphin_SRCS
treeviewcontextmenu.cpp
treeviewsidebarpage.cpp
sidebartreeview.cpp
viewpropertiesdialog.cpp
viewsettingspage.cpp
viewsettingspagebase.cpp
viewpropsprogressinfo.cpp)
)
kde4_add_kcfg_files(dolphin_SRCS
dolphin_folderspanelsettings.kcfgc)

View file

@ -37,7 +37,6 @@
#include "metadatawidget.h"
#include "mainwindowadaptor.h"
#include "treeviewsidebarpage.h"
#include "viewpropertiesdialog.h"
#include "viewproperties.h"
#ifndef Q_OS_WIN
@ -562,13 +561,6 @@ void DolphinMainWindow::editLocation()
lineEdit->setSelection(0, text.length());
}
void DolphinMainWindow::adjustViewProperties()
{
clearStatusBar();
ViewPropertiesDialog dlg(m_activeViewContainer->view());
dlg.exec();
}
void DolphinMainWindow::goBack()
{
clearStatusBar();
@ -976,10 +968,6 @@ void DolphinMainWindow::setupActions()
editLocation->setShortcut(Qt::Key_F6);
connect(editLocation, SIGNAL(triggered()), this, SLOT(editLocation()));
KAction* adjustViewProps = actionCollection()->addAction("view_properties");
adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Properties..."));
connect(adjustViewProps, SIGNAL(triggered()), this, SLOT(adjustViewProperties()));
// setup 'Go' menu
KAction* backAction = KStandardAction::back(this, SLOT(goBack()), actionCollection());
KShortcut backShortcut = backAction->shortcut();

View file

@ -254,12 +254,6 @@ private slots:
*/
void editLocation();
/**
* Opens the view properties dialog, which allows to modify the properties
* of the currently active view.
*/
void adjustViewProperties();
/** Goes back on step of the URL history. */
void goBack();

View file

@ -18,14 +18,15 @@
***************************************************************************/
#include "dolphinviewactionhandler.h"
#include <kdebug.h>
#include "viewpropertiesdialog.h"
#include "dolphinview.h"
#include <konq_operations.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <kdebug.h>
#include <klocale.h>
#include <ktoggleaction.h>
@ -132,6 +133,9 @@ void DolphinViewActionHandler::createActions()
showHiddenFiles->setShortcut(Qt::ALT | Qt::Key_Period);
connect(showHiddenFiles, SIGNAL(triggered(bool)), this, SLOT(toggleShowHiddenFiles(bool)));
KAction* adjustViewProps = m_actionCollection->addAction("view_properties");
adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Properties..."));
connect(adjustViewProps, SIGNAL(triggered()), this, SLOT(slotAdjustViewProperties()));
}
QActionGroup* DolphinViewActionHandler::createAdditionalInformationActionGroup()
@ -471,3 +475,10 @@ void DolphinViewActionHandler::slotSortTriggered(QAction* action)
const DolphinView::Sorting sorting = action->data().value<DolphinView::Sorting>();
m_currentView->setSorting(sorting);
}
void DolphinViewActionHandler::slotAdjustViewProperties()
{
emit actionBeingHandled();
ViewPropertiesDialog dlg(m_currentView);
dlg.exec();
}

View file

@ -167,6 +167,12 @@ private Q_SLOTS:
*/
void slotShowHiddenFilesChanged();
/**
* Opens the view properties dialog, which allows to modify the properties
* of the currently active view.
*/
void slotAdjustViewProperties();
private:
/**
* Create all the actions.

View file

@ -21,6 +21,8 @@
#ifndef VIEWPROPERTIESDIALOG_H
#define VIEWPROPERTIESDIALOG_H
#include "libdolphin_export.h"
#include <kdialog.h>
class QCheckBox;
@ -37,7 +39,7 @@ class DolphinView;
* and previews should be shown. The properties can be assigned to the current folder,
* or recursively to all sub folders.
*/
class ViewPropertiesDialog : public KDialog
class LIBDOLPHINPRIVATE_EXPORT ViewPropertiesDialog : public KDialog
{
Q_OBJECT