#include <kparts/part.h>
#include <kparts/browserextension.h>
+class DolphinViewActionHandler;
class QActionGroup;
class KAction;
class KFileItemList;
// 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);
+ explicit DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& 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:
*/
virtual bool openFile() { return true; }
+Q_SIGNALS:
+ /**
+ * Emitted when the view mode changes. Used by konqueror.
+ */
+ void viewModeChanged();
+
+
+ /**
+ * Emitted whenever the current URL is about to be changed.
+ */
+ void aboutToOpenURL();
+
private Q_SLOTS:
void slotCompleted(const KUrl& url);
void slotCanceled(const KUrl& url);
* @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
*/
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.
*/
void updatePasteAction();
- /**
- * Connected to the "move_to_trash" action; adds "shift means del" handling.
- */
- void slotTrashActivated(Qt::MouseButtons, Qt::KeyboardModifiers);
-
/**
* Connected to all "Go" menu actions provided by DolphinPart
*/
*/
void slotProperties();
- /**
- * Opens the dialog for creating a directory. Is connected
- * with the key shortcut for "new directory" (F10).
- */
- void createDir();
-
- /** Updates the state of the 'Show preview' menu action. */
- void slotShowPreviewChanged();
-
- /** Updates the state of the 'Show hidden files' menu action. */
- void slotShowHiddenFilesChanged();
-
- /** Updates the state of the 'Categorized sorting' menu action. */
- void slotCategorizedSortingChanged();
-
- /** Updates the state of the 'Sort Ascending/Descending' action. */
- void slotSortOrderChanged(Qt::SortOrder);
-
- /** Updates the state of the 'Additional Information' actions. */
- void slotAdditionalInfoChanged();
-
private:
void createActions();
void createGoAction(const char* name, const char* iconName,
private:
DolphinView* m_view;
+ DolphinViewActionHandler* m_actionHandler;
KDirLister* m_dirLister;
DolphinModel* m_dolphinModel;
DolphinSortFilterProxyModel* m_proxyModel;
void cut();
void copy();
void paste();
+ void reparseConfiguration();
private:
DolphinPart* m_part;