X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d324e790d62c8a341abd06e845f8fe8d64aa8ef3..7eeb8dba6aeba09aa3dfa7fa5f0b00840d4d8317:/src/dolphinmainwindow.h diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 0b4f90d19..7479c05b1 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -45,10 +45,11 @@ class DolphinSearchOptionsConfigurator; class DolphinSettingsDialog; class DolphinViewContainer; class DolphinRemoteEncoding; -class KNewMenu; +class KNewFileMenu; class KTabBar; class KUrl; class QSplitter; +class KJob; /** * @short Main window for Dolphin. @@ -73,6 +74,19 @@ public: */ DolphinViewContainer* activeViewContainer() const; + /** + * Opens each directory \p in a separate tab. If the "split view" + * option is enabled, 2 directories are collected within one tab. + */ + void openDirectories(const QList& dirs); + + /** + * Opens the directory which contains the files \p files + * and selects all files (implements the --select option + * of Dolphin). + */ + void openFiles(const QList& files); + /** * Returns true, if the main window contains two instances * of a view container. The active view constainer can be @@ -101,7 +115,7 @@ public: * Returns the 'Create New...' sub menu which also can be shared * with other menus (e. g. a context menu). */ - KNewMenu* newMenu() const; + KNewFileMenu* newMenu() const; /** * Returns the 'Show Menubar' action which can be shared with @@ -123,17 +137,12 @@ public slots: int getId() const; /** + * Implementation of the MainWindowAdaptor/QDBusAbstractAdaptor interface. * Inform all affected dolphin components (panels, views) of an URL * change. */ void changeUrl(const KUrl& url); - /** - * Inform all affected dolphin components that a selection change is - * requested. - */ - void changeSelection(const KFileItemList& selection); - /** Stores all settings and quits Dolphin. */ void quit(); @@ -157,6 +166,9 @@ signals: void requestItemInfo(const KFileItem& item); protected: + /** @see QWidget::showEvent() */ + virtual void showEvent(QShowEvent* event); + /** @see QMainWindow::closeEvent() */ virtual void closeEvent(QCloseEvent* event); @@ -367,13 +379,19 @@ private slots: */ void closeTab(int index); - /** * Opens a context menu for the tab with the index \a index * on the position \a pos. */ void openTabContextMenu(int index, const QPoint& pos); + /** + * Is connected to the QTabBar signal tabMoved(int from, int to). + * Reorders the list of tabs after a tab was moved in the tab bar + * and sets m_tabIndex to the new index of the current tab. + */ + void slotTabMoved(int from, int to); + /** * Handles a click on a places item: if the middle mouse button is * clicked, a new tab is opened for \a url, otherwise the current @@ -393,13 +411,6 @@ private slots: */ void searchItems(); - /** - * Is connected to the QTabBar signal tabMoved(int from, int to). - * Reorders the list of tabs after a tab was moved in the tab bar - * and sets m_tabIndex to the new index of the current tab. - */ - void slotTabMoved(int from, int to); - /** * Is connected to the searchbox signal 'requestSearchOptions' and * takes care to show the search options. @@ -412,6 +423,42 @@ private slots: */ void handleUrl(const KUrl& url); + /** + * handleUrl() can trigger a stat job to see if the url can actually + * be listed. + */ + void slotHandleUrlStatFinished(KJob* job); + + /** + * setUrlAsCaption() will trigger a stat job which reports its result in + * this slot. + */ + void slotCaptionStatFinished(KJob* job); + + /** + * Is connected to the KTabBar signal receivedDropEvent. + * Allows dragging and dropping files onto tabs. + */ + void tabDropEvent(int tab, QDropEvent* event); + + /** + * Is invoked when the write state of a folder has been changed and + * enables/disables the "Create New..." menu entry. + */ + void slotWriteStateChanged(bool isFolderWritable); + + /** + * Opens the context menu on the current mouse position. + * @item File item context. If item is null, the context menu + * should be applied to \a url. + * @url URL which contains \a item. + * @customActions Actions that should be added to the context menu, + * if the file item is null. + */ + void openContextMenu(const KFileItem& item, + const KUrl& url, + const QList& customActions); + private: DolphinMainWindow(int id); void init(); @@ -487,7 +534,7 @@ private: virtual void jobError(KIO::Job* job); }; - KNewMenu* m_newMenu; + KNewFileMenu* m_newMenu; KActionMenu* m_recentTabsMenu; KAction* m_showMenuBar; KTabBar* m_tabBar; @@ -512,6 +559,9 @@ private: DolphinViewActionHandler* m_actionHandler; DolphinRemoteEncoding* m_remoteEncoding; QPointer m_settingsDialog; + + KJob* m_captionStatJob; + KJob* m_lastHandleUrlStatJob; }; inline DolphinViewContainer* DolphinMainWindow::activeViewContainer() const @@ -524,7 +574,7 @@ inline bool DolphinMainWindow::isSplit() const return m_viewTab[m_tabIndex].secondaryView != 0; } -inline KNewMenu* DolphinMainWindow::newMenu() const +inline KNewFileMenu* DolphinMainWindow::newMenu() const { return m_newMenu; }