2 * SPDX-FileCopyrightText: 2006 Peter Penz (peter.penz@gmx.at) and Patrice Tremblay
4 * SPDX-License-Identifier: GPL-2.0-or-later
6 #ifndef STATUSBARSPACEINFO_H
7 #define STATUSBARSPACEINFO_H
9 #include <KMessageWidget>
23 class SpaceInfoObserver
;
26 * @short Shows the available space for the volume represented
27 * by the given URL as part of the status bar.
29 class StatusBarSpaceInfo
: public QWidget
34 explicit StatusBarSpaceInfo(QWidget
*parent
= nullptr);
35 ~StatusBarSpaceInfo() override
;
38 * Use this to set the widget visibility as it can hide itself
41 void setUrl(const QUrl
&url
);
48 * Requests for @p message with the given @p messageType to be shown to the user in a non-modal way.
50 void showMessage(const QString
&message
, KMessageWidget::MessageType messageType
);
53 * Requests for a progress update to be shown to the user in a non-modal way.
54 * @param currentlyRunningTaskTitle The task that is currently progressing.
55 * @param installationProgressPercent The current percentage of completion.
57 void showInstallationProgress(const QString
¤tlyRunningTaskTitle
, int installationProgressPercent
);
60 void showEvent(QShowEvent
*event
) override
;
61 void hideEvent(QHideEvent
*event
) override
;
62 QSize
minimumSizeHint() const override
;
68 * Asynchronously starts a Filelight installation using DolphinPackageInstaller. @see DolphinPackageInstaller.
69 * Installation success or failure is reported through showMessage(). @see StatusBarSpaceInfo::showMessage().
70 * Installation progress is reported through showInstallationProgress(). @see StatusBarSpaceInfo::showInstallationProgress().
72 void slotInstallFilelightButtonClicked();
74 void slotValuesChanged();
78 * Creates a new QWidgetAction that contains a UI to install Filelight.
79 * m_installFilelightWidgetAction is initialised after calling this method once.
81 void initialiseInstallFilelightWidgetAction();
84 QScopedPointer
<SpaceInfoObserver
> m_observer
;
85 KCapacityBar
*m_capacityBar
;
86 QToolButton
*m_textInfoButton
;
88 /** An action containing a UI to install Filelight. */
89 QWidgetAction
*m_installFilelightWidgetAction
;