* 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 <QLabel>
#include <khbox.h>
-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.
* The statusbar allows to show messages and progress
* information.
*/
-class DolphinStatusBar : public KHBox {
+class DolphinStatusBar : public KHBox
+{
Q_OBJECT
public:
Error
};
- DolphinStatusBar(DolphinView* parent = 0);
+ DolphinStatusBar(QWidget* parent,
+ const KUrl& url);
+
virtual ~DolphinStatusBar();
/**
* is cleared automatically.
*/
void setMessage(const QString& msg, Type type);
-
QString message() const;
+
Type type() const;
/**
* 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
* 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