┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-03-11 17:51:37 +0000
committerPeter Penz <[email protected]>2007-03-11 17:51:37 +0000
commitf768cbd235c069c506ecc7ad01685ce115d0c1d2 (patch)
treeb044ed7a80eec4c314dac11bc48954df32179c7a /src
parent25349096ae7fe344613d35e5548cac1a91b60fd1 (diff)
disable the 'Additional information' menu for other views then the 'Icons View'
svn path=/trunk/KDE/kdebase/apps/; revision=641532
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp4
-rw-r--r--src/dolphinview.h2
-rw-r--r--src/viewpropertiesdialog.cpp11
3 files changed, 11 insertions, 6 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 508f010ce..d6a326345 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -325,6 +325,10 @@ void DolphinMainWindow::slotAdditionalInfoChanged(KFileItemDelegate::AdditionalI
if (action != 0) {
KToggleAction* toggleAction = static_cast<KToggleAction*>(action);
toggleAction->setChecked(true);
+
+ QActionGroup* group = toggleAction->actionGroup();
+ Q_ASSERT(group != 0);
+ group->setEnabled(m_activeView->mode() == DolphinView::IconsView);
}
}
diff --git a/src/dolphinview.h b/src/dolphinview.h
index 8a7637656..218411208 100644
--- a/src/dolphinview.h
+++ b/src/dolphinview.h
@@ -513,7 +513,7 @@ private:
QString selectionStatusBarText() const;
/**
- * Creates a new view representing the given view mode (DolphinView::viewMode()).
+ * Creates a new view representing the given view mode (DolphinView::mode()).
* The current view will get deleted.
*/
void createView();
diff --git a/src/viewpropertiesdialog.cpp b/src/viewpropertiesdialog.cpp
index 76a45061e..4c87397e8 100644
--- a/src/viewpropertiesdialog.cpp
+++ b/src/viewpropertiesdialog.cpp
@@ -26,8 +26,6 @@
#include "dolphin_generalsettings.h"
#include "viewproperties.h"
-#include <assert.h>
-
#include <kcomponentdata.h>
#include <klocale.h>
#include <kiconloader.h>
@@ -60,7 +58,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
m_applyToSubFolders(0),
m_useAsDefault(0)
{
- assert(dolphinView != 0);
+ Q_ASSERT(dolphinView != 0);
const bool useGlobalViewProps = DolphinSettings::instance().generalSettings()->globalViewProps();
setCaption(i18n("View Properties"));
@@ -111,6 +109,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
m_additionalInfo->addItem(i18n("Date"), KFileItemDelegate::ModificationTime);
const int addInfoIndex = m_additionalInfo->findData(m_viewProps->additionalInfo());
m_additionalInfo->setCurrentIndex(addInfoIndex);
+ m_additionalInfo->setEnabled(m_viewProps->viewMode() == DolphinView::IconsView);
m_showPreview = new QCheckBox(i18n("Show preview"), propsBox);
m_showPreview->setChecked(m_viewProps->showPreview());
@@ -209,9 +208,11 @@ void ViewPropertiesDialog::slotApply()
void ViewPropertiesDialog::slotViewModeChanged(int index)
{
- assert((index >= 0) && (index <= 2));
+ Q_ASSERT((index >= 0) && (index <= 1));
m_viewProps->setViewMode(static_cast<DolphinView::Mode>(index));
m_isDirty = true;
+
+ m_additionalInfo->setEnabled(m_viewProps->viewMode() == DolphinView::IconsView);
}
void ViewPropertiesDialog::slotSortingChanged(int index)
@@ -312,7 +313,7 @@ void ViewPropertiesDialog::applyViewProperties()
// file stored for the global view properties is used as fallback. To update
// this file we temporary turn on the global view properties mode.
GeneralSettings* settings = DolphinSettings::instance().generalSettings();
- assert(!settings->globalViewProps());
+ Q_ASSERT(!settings->globalViewProps());
settings->setGlobalViewProps(true);
ViewProperties defaultProps(m_dolphinView->url());