X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/904168ad2a0e2baff0570658c8f9a9c3feba4554..846b21edf57e7aeb83e84ee68e9f61c5981fbacd:/src/dolphinstatusbar.h diff --git a/src/dolphinstatusbar.h b/src/dolphinstatusbar.h index e7a29e954..1a9aaa4c1 100644 --- a/src/dolphinstatusbar.h +++ b/src/dolphinstatusbar.h @@ -15,23 +15,20 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ #ifndef DOLPHINSTATUSBAR_H #define DOLPHINSTATUSBAR_H - -//Added by qt3to4: -#include #include -class QProgressBar; -class QLabel; -class QTimer; -class StatusBarMessageLabel; -class StatusBarSpaceInfo; + class DolphinView; class KUrl; +class StatusBarMessageLabel; +class StatusBarSpaceInfo; +class QProgressBar; +class QLabel; /** * @brief Represents the statusbar of a Dolphin view. @@ -39,7 +36,8 @@ class KUrl; * The statusbar allows to show messages and progress * information. */ -class DolphinStatusBar : public KHBox { +class DolphinStatusBar : public KHBox +{ Q_OBJECT public: @@ -55,7 +53,9 @@ public: Error }; - DolphinStatusBar(DolphinView* parent = 0); + DolphinStatusBar(QWidget* parent, + const KUrl& url); + virtual ~DolphinStatusBar(); /** @@ -70,8 +70,8 @@ public: * is cleared automatically. */ void setMessage(const QString& msg, Type type); - QString message() const; + Type type() const; /** @@ -95,7 +95,10 @@ public: * operations. */ void setProgress(int percent); - int progress() const { return m_progress; } + int progress() const + { + return m_progress; + } /** * Clears the message text of the status bar by replacing @@ -110,25 +113,36 @@ public: * is cleared by DolphinStatusBar::clear(). */ void setDefaultText(const QString& text); - const QString& defaultText() const { return m_defaultText; } + const QString& defaultText() const; + +protected: + /** @see QWidget::resizeEvent() */ + virtual void resizeEvent(QResizeEvent* event); private slots: - void slotProgressTimer(); + void updateProgressInfo(); /** - * Is invoked, when the Url of the DolphinView, where the - * statusbar belongs too, has been changed. + * Is invoked, when the URL of the DolphinView, where the + * statusbar belongs too, has been changed. The space information + * content is updated. */ - void slotUrlChanged(const KUrl& url); + void updateSpaceInfoContent(const KUrl& url); + + /** + * Shows the space information if there is enough room to show it + * without the need to clip the status bar text. If the progress + * bar is shown, the space information won't be shown. + */ + void showSpaceInfo(); private: StatusBarMessageLabel* m_messageLabel; StatusBarSpaceInfo* m_spaceInfo; + QLabel* m_progressText; QProgressBar* m_progressBar; - QTimer* m_progressTimer; int m_progress; - QString m_defaultText; }; #endif