]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.h
Apply 1 suggestion(s) to 1 file(s)
[dolphin.git] / src / dolphinviewcontainer.h
index 55d00a3b80f49cc995d4719d592c4b46e6843ccf..a509bab3d91a514517205ed2c24a1865621505a7 100644 (file)
@@ -21,6 +21,8 @@
 #include <QPushButton>
 #include <QWidget>
 
+#include <initializer_list>
+
 namespace Admin
 {
 class Bar;
@@ -31,6 +33,7 @@ class QGridLayout;
 class QUrl;
 class DolphinSearchBox;
 class DolphinStatusBar;
+class KFileItemList;
 namespace SelectionMode
 {
 class TopBar;
@@ -150,8 +153,9 @@ public:
 
     /**
      * Shows the message \message with the given type \messageType non-modal above the view-content.
+     * \buttonActions defines actions which the user can trigger as a response to this message. They are presented as buttons below the \message.
      */
-    void showMessage(const QString &message, KMessageWidget::MessageType messageType);
+    void showMessage(const QString &message, KMessageWidget::MessageType messageType, std::initializer_list<QAction *> buttonActions = {});
 
     /**
      * Refreshes the view container to get synchronized with the (updated) Dolphin settings.
@@ -328,11 +332,6 @@ private Q_SLOTS:
      */
     void showItemInfo(const KFileItem &item);
 
-    /**
-     * Sets the Admin::Bar visible or invisible based on whether \a url is an admin url.
-     */
-    void updateAdminBarVisibility(const QUrl &url);
-
     void closeFilterBar();
 
     /**
@@ -389,6 +388,11 @@ private Q_SLOTS:
 
     void slotStatusBarZoomLevelChanged(int zoomLevel);
 
+    /**
+     * Creates and shows an error message based on \p message and \p kioErrorCode.
+     */
+    void slotErrorMessageFromView(const QString &message, const int kioErrorCode);
+
     /**
      * Slot that calls showMessage(message, KMessageWidget::Error).
      */
@@ -429,6 +433,19 @@ private:
      */
     QString getNearestExistingAncestorOfPath(const QString &path) const;
 
+    /**
+     * Update the geometry of statusbar depending on what mode it is using.
+     */
+    void updateStatusBarGeometry();
+
+    /**
+     * @return Preferred geometry of the small statusbar.
+     */
+    QRect preferredSmallStatusBarGeometry();
+
+protected:
+    bool eventFilter(QObject *object, QEvent *event) override;
+
 private:
     QGridLayout *m_topLayout;
 
@@ -451,6 +468,8 @@ private:
 
     /// A bar shown at the top of the view to signify that the view is currently viewed and acted on with elevated privileges.
     Admin::Bar *m_adminBar;
+    /// An action to switch to the admin protocol. This variable will always be nullptr unless kio-admin was installed. @see Admin::WorkerIntegration.
+    QAction *m_authorizeToEnterFolderAction;
 
     KMessageWidget *m_messageWidget;