mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-15 18:01:11 +00:00
disable the 'Additional information' menu for other views then the 'Icons View'
svn path=/trunk/KDE/kdebase/apps/; revision=641532
This commit is contained in:
parent
25349096ae
commit
f768cbd235
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue