From f31a541925033c2ef5e27b85c099d47791b50121 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Wed, 29 Nov 2006 00:02:19 +0000 Subject: Make it (almost) possible to have more than one Dolphin KMainWindow Create a DolphinApplication, holding DolphinMainWindows and update the code to use the DolphinView to get the MainWindow, or get a ptr to the MainWindow directly. Or if all windows are effected go through the DolphinApplication to update every mainwindow. The UndowManager and ProgressIndicator have a rather strange relationship and will need some more attention but as UndoManager will be killed anyway I have skipped this. More cleanup, debugging and thinking is needed. svn path=/trunk/playground/utils/dolphin/; revision=608945 --- src/dolphinview.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/dolphinview.h') diff --git a/src/dolphinview.h b/src/dolphinview.h index 5c7fb5c2c..69b0022d8 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -46,7 +46,7 @@ class Q3IconViewItem; class Q3ListViewItem; class Q3VBoxLayout; //class KFileView; -class Dolphin; +class DolphinMainWindow; class DolphinDirLister; class DolphinStatusBar; class DolphinIconsView; @@ -115,7 +115,8 @@ public: MaxSortEnum = SortByDate }; - DolphinView(QWidget* parent, + DolphinView(DolphinMainWindow* mainwindow, + QWidget *parent, const KUrl& url, Mode mode = IconsView, bool showHiddenFiles = false); @@ -326,6 +327,12 @@ public: */ bool isFilterBarVisible(); + /** + * Return the DolphinMainWindow this View belongs to. It is guranteed + * that we have one. + */ + DolphinMainWindow* mainWindow() const ; + public slots: void reload(); void slotUrlListDropped(QDropEvent* event, @@ -337,6 +344,11 @@ public slots: */ void slotShowFilterBar(bool show); + /** + * Declare this View as the activeview of the mainWindow() + */ + void declareViewActive(); + signals: /** Is emitted if Url of the view has been changed to \a url. */ void signalUrlChanged(const KUrl& url); @@ -367,8 +379,8 @@ signals: /** * Is emitted whenever the selection has been changed. The current selection can - * be retrieved by Dolphin::mainWin().activeView()->selectedItems() or by - * Dolphin::mainWin().activeView()->selectedUrls(). + * be retrieved by mainWindow()->activeView()->selectedItems() or by + * mainWindow()->activeView()->selectedUrls(). */ void signalSelectionChanged(); @@ -381,6 +393,7 @@ protected: /** @see QWidget::mouseReleaseEvent */ virtual void mouseReleaseEvent(QMouseEvent* event); + private slots: void slotUrlChanged(const KUrl& kurl); void triggerIconsViewItem(Q3IconViewItem *item); @@ -440,6 +453,7 @@ private: */ void applyModeToView(); + DolphinMainWindow *m_mainWindow; bool m_refreshing; bool m_showProgress; Mode m_mode; -- cgit v1.3.1