svn path=/trunk/KDE/kdebase/apps/; revision=
1205329
{
if (newUrl != m_urlNavigator->locationUrl()) {
m_urlNavigator->setLocationUrl(newUrl);
{
if (newUrl != m_urlNavigator->locationUrl()) {
m_urlNavigator->setLocationUrl(newUrl);
// Temporary disable the 'File'->'Create New...' menu until
// the write permissions can be checked in a fast way at
// DolphinViewContainer::slotDirListerCompleted().
// Temporary disable the 'File'->'Create New...' menu until
// the write permissions can be checked in a fast way at
// DolphinViewContainer::slotDirListerCompleted().
if (isActive()) {
emit writeStateChanged(false);
}
if (isActive()) {
emit writeStateChanged(false);
}
+
+ // Trigger an undetermined progress indication. The progress
+ // information in percent will be triggered by the percent() signal
+ // of the directory lister later.
+ updateProgress(-1);
#include <QLabel>
#include <QProgressBar>
#include <QToolButton>
#include <QLabel>
#include <QProgressBar>
#include <QToolButton>
#include <QTimer>
#include <views/dolphinview.h>
#include <QTimer>
#include <views/dolphinview.h>
m_progressBar(0),
m_stopButton(0),
m_progress(100),
m_progressBar(0),
m_stopButton(0),
m_progress(100),
+ m_showProgressBarTimer(0),
m_messageTimeStamp()
{
connect(m_view, SIGNAL(urlChanged(const KUrl&)),
m_messageTimeStamp()
{
connect(m_view, SIGNAL(urlChanged(const KUrl&)),
m_progressBar = new QProgressBar(this);
m_progressBar->hide();
m_progressBar = new QProgressBar(this);
m_progressBar->hide();
+ m_showProgressBarTimer = new QTimer(this);
+ m_showProgressBarTimer->setInterval(1000);
+ m_showProgressBarTimer->setSingleShot(true);
+ connect(m_showProgressBarTimer, SIGNAL(timeout()), this, SLOT(updateProgressInfo()));
+
// Initialize top layout and size policies
const int fontHeight = QFontMetrics(m_messageLabel->font()).height();
const int zoomWidgetHeight = m_zoomWidget->minimumSizeHint().height();
// Initialize top layout and size policies
const int fontHeight = QFontMetrics(m_messageLabel->font()).height();
const int zoomWidgetHeight = m_zoomWidget->minimumSizeHint().height();
+ const bool progressRestarted = (percent < 100) && (percent < m_progress);
m_progress = percent;
if (m_messageLabel->type() == KonqStatusBarMessageLabel::Error) {
// Don't update any widget or status bar text if an
m_progress = percent;
if (m_messageLabel->type() == KonqStatusBarMessageLabel::Error) {
// Don't update any widget or status bar text if an
+ if (progressRestarted && !m_progressBar->isVisible()) {
+ // Show the progress bar delayed: In the case if 100 % are reached within
+ // a short time, no progress bar will be shown at all.
+ m_showProgressBarTimer->start();
+ }
+
m_progressBar->setValue(m_progress);
m_progressBar->setValue(m_progress);
- if (!m_progressBar->isVisible() || (percent == 100)) {
+ if (percent == 100) {
+ // The end of the progress has been reached. Assure that the progress bar
+ // gets hidden and the extensions widgets get visible again.
+ m_showProgressBarTimer->stop();
class QProgressBar;
class QToolButton;
class QSlider;
class QProgressBar;
class QToolButton;
class QSlider;
/**
* @brief Represents the statusbar of a Dolphin view.
/**
* @brief Represents the statusbar of a Dolphin view.
/**
* Sets the progress in percent (0 - 100). The
/**
* Sets the progress in percent (0 - 100). The
- * progress is shown with a delay of 300 milliseconds:
- * if the progress does reach 100 % within 300 milliseconds,
- * the progress is not shown at all. This assures that
- * no flickering occurs for showing a progress of fast
- * operations.
+ * progress is shown delayed by 1 second:
+ * If the progress does reach 100 % within 1 second,
+ * the progress is not shown at all.
*/
void setProgress(int percent);
int progress() const;
*/
void setProgress(int percent);
int progress() const;
void zoomIn();
void showZoomSliderToolTip(int zoomLevel);
void zoomIn();
void showZoomSliderToolTip(int zoomLevel);
void updateProgressInfo();
void updateProgressInfo();
/**
* Makes the space information widget and zoom slider widget
* visible, if \a visible is true and the settings allow to show
/**
* Makes the space information widget and zoom slider widget
* visible, if \a visible is true and the settings allow to show
QProgressBar* m_progressBar;
QToolButton* m_stopButton;
int m_progress;
QProgressBar* m_progressBar;
QToolButton* m_stopButton;
int m_progress;
+ QTimer* m_showProgressBarTimer;
// Timestamp when the last message has been set that has not the type
// 'Default'. The timestamp is used to prevent that default messages
// Timestamp when the last message has been set that has not the type
// 'Default'. The timestamp is used to prevent that default messages
* The width of the visualRect of an item is usually replaced by the width of the file name.
* However, if the file name is wider then the view's name column, this leads to problems with
* keyboard navigation if files with very long names are present in the current folder, see
* The width of the visualRect of an item is usually replaced by the width of the file name.
* However, if the file name is wider then the view's name column, this leads to problems with
* keyboard navigation if files with very long names are present in the current folder, see
* https://bugs.kde.org/show_bug.cgi?id=257401
*
* This test checks that the visualRect of an item is never wider than the "Name" column.
* https://bugs.kde.org/show_bug.cgi?id=257401
*
* This test checks that the visualRect of an item is never wider than the "Name" column.