┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-10-06 18:15:53 +0000
committerPeter Penz <[email protected]>2008-10-06 18:15:53 +0000
commitd89548a828dd7d2e08acd85c329ccc2adf67bced (patch)
treee37db5f0c26cbb3bc1694beb2ff99536a53ca792 /src
parent92500f9125b4bedcd80ff4baa36c62c51f26ca70 (diff)
allow to configure whether the zoom slider and/or the space information should be shown in the statusbar
svn path=/trunk/KDE/kdebase/apps/; revision=868596
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp4
-rw-r--r--src/dolphinstatusbar.cpp7
-rw-r--r--src/dolphinstatusbar.h5
-rw-r--r--src/dolphinviewcontainer.cpp6
-rw-r--r--src/dolphinviewcontainer.h5
-rw-r--r--src/generalsettingspage.cpp18
-rw-r--r--src/generalsettingspage.h4
-rw-r--r--src/statusbarspaceinfo.cpp1
8 files changed, 47 insertions, 3 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 48f085e33..f3b9d6228 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -182,9 +182,9 @@ void DolphinMainWindow::refreshViews()
// the secondary view
DolphinViewContainer* activeViewContainer = m_activeViewContainer;
- m_viewTab[m_tabIndex].primaryView->view()->refresh();
+ m_viewTab[m_tabIndex].primaryView->refresh();
if (m_viewTab[m_tabIndex].secondaryView != 0) {
- m_viewTab[m_tabIndex].secondaryView->view()->refresh();
+ m_viewTab[m_tabIndex].secondaryView->refresh();
}
setActiveViewContainer(activeViewContainer);
diff --git a/src/dolphinstatusbar.cpp b/src/dolphinstatusbar.cpp
index eabbc77b1..cddb09fd2 100644
--- a/src/dolphinstatusbar.cpp
+++ b/src/dolphinstatusbar.cpp
@@ -90,7 +90,6 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent, DolphinView* view) :
setExtensionsVisible(true);
}
-
DolphinStatusBar::~DolphinStatusBar()
{
}
@@ -172,6 +171,12 @@ const QString& DolphinStatusBar::defaultText() const
return m_messageLabel->defaultText();
}
+void DolphinStatusBar::refresh()
+{
+ setExtensionsVisible(true);
+ assureVisibleText();
+}
+
void DolphinStatusBar::resizeEvent(QResizeEvent* event)
{
QWidget::resizeEvent(event);
diff --git a/src/dolphinstatusbar.h b/src/dolphinstatusbar.h
index 3cee1ed53..e64312b48 100644
--- a/src/dolphinstatusbar.h
+++ b/src/dolphinstatusbar.h
@@ -115,6 +115,11 @@ public:
*/
void setDefaultText(const QString& text);
const QString& defaultText() const;
+
+ /**
+ * Refreshes the status bar to get synchronized with the (updated) Dolphin settings.
+ */
+ void refresh();
protected:
/** @see QWidget::resizeEvent() */
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index 342aa08c7..99ff253c2 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -197,6 +197,12 @@ bool DolphinViewContainer::isActive() const
return m_view->isActive();
}
+void DolphinViewContainer::refresh()
+{
+ m_view->refresh();
+ m_statusBar->refresh();
+}
+
bool DolphinViewContainer::isFilterBarVisible() const
{
return m_filterBar->isVisible();
diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h
index f3ac48471..4938835d8 100644
--- a/src/dolphinviewcontainer.h
+++ b/src/dolphinviewcontainer.h
@@ -104,6 +104,11 @@ public:
const DolphinView* view() const;
DolphinView* view();
+
+ /**
+ * Refreshes the view container to get synchronized with the (updated) Dolphin settings.
+ */
+ void refresh();
/** Returns true, if the filter bar is visible. */
bool isFilterBarVisible() const;
diff --git a/src/generalsettingspage.cpp b/src/generalsettingspage.cpp
index 5dc66cbdc..70fe72855 100644
--- a/src/generalsettingspage.cpp
+++ b/src/generalsettingspage.cpp
@@ -39,6 +39,8 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
m_confirmDelete(0),
m_showDeleteCommand(0),
m_showCopyMoveMenu(0),
+ m_showZoomSlider(0),
+ m_showSpaceInfo(0),
m_browseThroughArchives(0),
m_renameInline(0)
{
@@ -75,6 +77,18 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
QVBoxLayout* contextMenuBoxLayout = new QVBoxLayout(contextMenuBox);
contextMenuBoxLayout->addWidget(m_showDeleteCommand);
contextMenuBoxLayout->addWidget(m_showCopyMoveMenu);
+
+ QGroupBox* statusBarBox = new QGroupBox(i18nc("@title:group", "Status Bar"), vBox);
+
+ m_showZoomSlider = new QCheckBox(i18nc("@option:check", "Show zoom slider"), statusBarBox);
+ connect(m_showZoomSlider, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+
+ m_showSpaceInfo = new QCheckBox(i18nc("@option:check", "Show space information"), statusBarBox);
+ connect(m_showSpaceInfo, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
+
+ QVBoxLayout* statusBarBoxLayout = new QVBoxLayout(statusBarBox);
+ statusBarBoxLayout->addWidget(m_showZoomSlider);
+ statusBarBoxLayout->addWidget(m_showSpaceInfo);
m_browseThroughArchives = new QCheckBox(i18nc("@option:check", "Browse through archives"), vBox);
connect(m_browseThroughArchives, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
@@ -112,6 +126,8 @@ void GeneralSettingsPage::applySettings()
configGroup.sync();
settings->setShowCopyMoveMenu(m_showCopyMoveMenu->isChecked());
+ settings->setShowZoomSlider(m_showZoomSlider->isChecked());
+ settings->setShowSpaceInfo(m_showSpaceInfo->isChecked());
settings->setBrowseThroughArchives(m_browseThroughArchives->isChecked());
settings->setRenameInline(m_renameInline->isChecked());
}
@@ -139,6 +155,8 @@ void GeneralSettingsPage::loadSettings()
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
m_showCopyMoveMenu->setChecked(settings->showCopyMoveMenu());
+ m_showZoomSlider->setChecked(settings->showZoomSlider());
+ m_showSpaceInfo->setChecked(settings->showSpaceInfo());
m_browseThroughArchives->setChecked(settings->browseThroughArchives());
m_renameInline->setChecked(settings->renameInline());
}
diff --git a/src/generalsettingspage.h b/src/generalsettingspage.h
index 55528bc56..da49326c5 100644
--- a/src/generalsettingspage.h
+++ b/src/generalsettingspage.h
@@ -52,6 +52,10 @@ private:
QCheckBox* m_showDeleteCommand;
QCheckBox* m_showCopyMoveMenu;
+
+ QCheckBox* m_showZoomSlider;
+ QCheckBox* m_showSpaceInfo;
+
QCheckBox* m_browseThroughArchives;
QCheckBox* m_renameInline;
};
diff --git a/src/statusbarspaceinfo.cpp b/src/statusbarspaceinfo.cpp
index ba37a82a5..adcd23d75 100644
--- a/src/statusbarspaceinfo.cpp
+++ b/src/statusbarspaceinfo.cpp
@@ -56,6 +56,7 @@ void StatusBarSpaceInfo::showEvent(QShowEvent* event)
{
KCapacityBar::showEvent(event);
if (!event->spontaneous()) {
+ refresh();
m_timer->start(10000);
}
}