#ifndef DOLPHINSTATUSBAR_H
#define DOLPHINSTATUSBAR_H
+#include <QTime>
#include <QWidget>
-class KUrl;
+class QUrl;
class StatusBarSpaceInfo;
class QLabel;
class QProgressBar;
class QToolButton;
class QSlider;
class QTimer;
+class KSqueezedTextLabel;
/**
* @brief Represents the statusbar of a Dolphin view.
Q_OBJECT
public:
- DolphinStatusBar(QWidget* parent);
- virtual ~DolphinStatusBar();
+ explicit DolphinStatusBar(QWidget* parent);
+ ~DolphinStatusBar() override;
QString text() const;
/**
* Sets the progress in percent (0 - 100). The
- * progress is shown delayed by 1 second:
- * If the progress does reach 100 % within 1 second,
+ * progress is shown delayed by 500 milliseconds:
+ * If the progress does reach 100 % within 500 milliseconds,
* the progress is not shown at all.
*/
void setProgress(int percent);
/**
* Replaces the text set by setText() by the text that
* has been set by setDefaultText(). DolphinStatusBar::text()
- * will return an empty string afterwards.
+ * will return an empty string after the reset has been done.
*/
void resetToDefaultText();
void setDefaultText(const QString& text);
QString defaultText() const;
- KUrl url() const;
+ QUrl url() const;
int zoomLevel() const;
/**
*/
void readSettings();
+ /**
+ * Refreshes the disk space information.
+ */
+ void updateSpaceInfo();
+
public slots:
void setText(const QString& text);
- void setUrl(const KUrl& url);
+ void setUrl(const QUrl& url);
void setZoomLevel(int zoomLevel);
signals:
void zoomLevelChanged(int zoomLevel);
protected:
- virtual void contextMenuEvent(QContextMenuEvent* event);
- virtual bool eventFilter(QObject* obj, QEvent* event);
+ void contextMenuEvent(QContextMenuEvent* event) override;
private slots:
void showZoomSliderToolTip(int zoomLevel);
*/
void updateLabelText();
+ /**
+ * Updates the text of the zoom slider tooltip to show
+ * the currently used size.
+ */
+ void updateZoomSliderToolTip(int zoomLevel);
+
private:
/**
* Makes the space information widget and zoom slider widget
*/
void setExtensionsVisible(bool visible);
- /**
- * Updates the text of the zoom slider tooltip to show
- * the currently used size.
- */
- void updateZoomSliderToolTip(int zoomLevel);
-
- void applyFixedWidgetSize(QWidget* widget, const QSize& size);
-
private:
QString m_text;
QString m_defaultText;
- QLabel* m_label;
+ KSqueezedTextLabel* m_label;
StatusBarSpaceInfo* m_spaceInfo;
QSlider* m_zoomSlider;
QToolButton* m_stopButton;
int m_progress;
QTimer* m_showProgressBarTimer;
+
+ QTimer* m_delayUpdateTimer;
+ QTime m_textTimestamp;
};
#endif