┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinpart.h
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2008-02-13 18:45:20 +0000
committerDavid Faure <[email protected]>2008-02-13 18:45:20 +0000
commit804a1967002b8d0714a865296fa2360c957284e6 (patch)
treeedb5ca8ae6f3657c1b518ac142339fad8b9c5165 /src/dolphinpart.h
parent9a8f75e93cbddca787cbfea8d27ed60009a44512 (diff)
Provide the dolphinpart view modes (Icons, Details, Columns) in konqueror's View Modes menu.
(this is done using a Q_PROPERTY in the dolphin part and a signal; the available view modes for creating the menu in the first place are listed in dolphinpart.desktop) Konqueror: cleaned up the old (complex) handling of view modes as N toolbar buttons from M services grouped by library (240 lines less!). Dolphin: moved view mode handling to DolphinViewActionHandler, removes duplication between part and mainwindow. svn path=/trunk/KDE/kdebase/apps/; revision=774646
Diffstat (limited to 'src/dolphinpart.h')
-rw-r--r--src/dolphinpart.h36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/dolphinpart.h b/src/dolphinpart.h
index 795a7b194..75d7ee951 100644
--- a/src/dolphinpart.h
+++ b/src/dolphinpart.h
@@ -43,17 +43,38 @@ class DolphinPart : public KParts::ReadOnlyPart
// Even though it's konqueror doing the undo...
Q_PROPERTY( bool supportsUndo READ supportsUndo )
+ Q_PROPERTY( QString currentViewMode READ currentViewMode WRITE setCurrentViewMode )
+
public:
explicit DolphinPart(QWidget* parentWidget, QObject* parent, const QStringList& args);
~DolphinPart();
static KAboutData* createAboutData();
+ /**
+ * Standard KParts::ReadOnlyPart openUrl method.
+ * Called by Konqueror to view a directory in DolphinPart.
+ */
virtual bool openUrl(const KUrl& url);
/// see the supportsUndo property
bool supportsUndo() const { return true; }
+ /**
+ * Used by konqueror for setting the view mode
+ * @param viewModeName internal name for the view mode, like "icons"
+ * Those names come from the Actions line in dolphinpart.desktop,
+ * and have to match the name of the KActions.
+ */
+ void setCurrentViewMode(const QString& viewModeName);
+
+ /**
+ * Used by konqueror for displaying the current view mode.
+ * @see setCurrentViewMode
+ */
+ QString currentViewMode() const;
+
+ /// Returns the view owned by this part; used by DolphinPartBrowserExtension
DolphinView* view() { return m_view; }
protected:
@@ -62,6 +83,12 @@ protected:
*/
virtual bool openFile() { return true; }
+Q_SIGNALS:
+ /**
+ * Emitted when the view mode changes. Used by konqueror.
+ */
+ void viewModeChanged();
+
private Q_SLOTS:
void slotCompleted(const KUrl& url);
void slotCanceled(const KUrl& url);
@@ -83,10 +110,6 @@ private Q_SLOTS:
* @url URL which contains \a item.
*/
void slotOpenContextMenu(const KFileItem& item, const KUrl& url);
- /**
- * Emitted when the user requested a change of view mode
- */
- void slotViewModeActionTriggered(QAction*);
/**
* Asks the host to open the URL \a url if the current view has
@@ -101,11 +124,6 @@ private Q_SLOTS:
void slotSelectionChanged(const KFileItemList& selection);
/**
- * Same as in DolphinMainWindow: updates the view menu actions
- */
- void updateViewActions();
-
- /**
* Updates the text of the paste action dependent from
* the number of items which are in the clipboard.
*/