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

View file

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

View file

@ -254,12 +254,6 @@ private slots:
*/ */
void editLocation(); 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. */ /** Goes back on step of the URL history. */
void goBack(); void goBack();

View file

@ -18,14 +18,15 @@
***************************************************************************/ ***************************************************************************/
#include "dolphinviewactionhandler.h" #include "dolphinviewactionhandler.h"
#include <kdebug.h>
#include "viewpropertiesdialog.h"
#include "dolphinview.h" #include "dolphinview.h"
#include <konq_operations.h> #include <konq_operations.h>
#include <kaction.h> #include <kaction.h>
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kdebug.h>
#include <klocale.h> #include <klocale.h>
#include <ktoggleaction.h> #include <ktoggleaction.h>
@ -132,6 +133,9 @@ void DolphinViewActionHandler::createActions()
showHiddenFiles->setShortcut(Qt::ALT | Qt::Key_Period); showHiddenFiles->setShortcut(Qt::ALT | Qt::Key_Period);
connect(showHiddenFiles, SIGNAL(triggered(bool)), this, SLOT(toggleShowHiddenFiles(bool))); 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() QActionGroup* DolphinViewActionHandler::createAdditionalInformationActionGroup()
@ -471,3 +475,10 @@ void DolphinViewActionHandler::slotSortTriggered(QAction* action)
const DolphinView::Sorting sorting = action->data().value<DolphinView::Sorting>(); const DolphinView::Sorting sorting = action->data().value<DolphinView::Sorting>();
m_currentView->setSorting(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(); void slotShowHiddenFilesChanged();
/**
* Opens the view properties dialog, which allows to modify the properties
* of the currently active view.
*/
void slotAdjustViewProperties();
private: private:
/** /**
* Create all the actions. * Create all the actions.

View file

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