mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Allow turning off the feature that additional information might be shown in the icons view. Per default the setting is still on, but for people who prefer browsing with the details view and only temporary switch to the icons view (e. g. for having a larger preview), this feature gets a showstopper (discussed with Eike Hein).
Got the OK from the translator team for adding the new string. CCMAIL: hein@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=744901
This commit is contained in:
parent
7cdaa3f5bf
commit
5690330220
7 changed files with 64 additions and 21 deletions
|
@ -26,6 +26,10 @@
|
|||
<label context="@label">Bold</label>
|
||||
<default>false</default>
|
||||
</entry>
|
||||
<entry name="ShowAdditionalInfo" type="Bool">
|
||||
<label context="@label">Allow showing of additional information</label>
|
||||
<default>true</default>
|
||||
</entry>
|
||||
<entry name="ItemHeight" type="Int">
|
||||
<label context="@label">Item height</label>
|
||||
<!--
|
||||
|
|
|
@ -282,12 +282,16 @@ void DolphinIconsView::slotEntered(const QModelIndex& index)
|
|||
void DolphinIconsView::slotShowPreviewChanged()
|
||||
{
|
||||
const DolphinView* view = m_controller->dolphinView();
|
||||
const int infoCount = view->additionalInfo().count();
|
||||
updateGridSize(view->showPreview(), infoCount);
|
||||
updateGridSize(view->showPreview(), additionalInfoCount());
|
||||
}
|
||||
|
||||
void DolphinIconsView::slotAdditionalInfoChanged(const KFileItemDelegate::InformationList& info)
|
||||
{
|
||||
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
|
||||
if (!settings->showAdditionalInfo()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const bool showPreview = m_controller->dolphinView()->showPreview();
|
||||
updateGridSize(showPreview, info.count());
|
||||
}
|
||||
|
@ -318,8 +322,7 @@ void DolphinIconsView::zoomIn()
|
|||
settings->setItemWidth(settings->itemWidth() + diff);
|
||||
settings->setItemHeight(settings->itemHeight() + diff);
|
||||
|
||||
const int infoCount = m_controller->dolphinView()->additionalInfo().count();
|
||||
updateGridSize(showPreview, infoCount);
|
||||
updateGridSize(showPreview, additionalInfoCount());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -350,8 +353,7 @@ void DolphinIconsView::zoomOut()
|
|||
settings->setItemWidth(settings->itemWidth() - diff);
|
||||
settings->setItemHeight(settings->itemHeight() - diff);
|
||||
|
||||
const int infoCount = m_controller->dolphinView()->additionalInfo().count();
|
||||
updateGridSize(showPreview, infoCount);
|
||||
updateGridSize(showPreview, additionalInfoCount());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -447,4 +449,11 @@ KFileItem DolphinIconsView::itemForIndex(const QModelIndex& index) const
|
|||
return dirModel->itemForIndex(dirIndex);
|
||||
}
|
||||
|
||||
int DolphinIconsView::additionalInfoCount() const
|
||||
{
|
||||
const DolphinView* view = m_controller->dolphinView();
|
||||
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
|
||||
return settings->showAdditionalInfo() ? view->additionalInfo().count() : 0;
|
||||
}
|
||||
|
||||
#include "dolphiniconsview.moc"
|
||||
|
|
|
@ -88,6 +88,12 @@ private:
|
|||
|
||||
KFileItem itemForIndex(const QModelIndex& index) const;
|
||||
|
||||
/**
|
||||
* Returns the number of additional information lines that should
|
||||
* be shown below the item name.
|
||||
*/
|
||||
int additionalInfoCount() const;
|
||||
|
||||
private:
|
||||
DolphinController* m_controller;
|
||||
DolphinCategoryDrawer* m_categoryDrawer;
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "kfileplacesview.h"
|
||||
|
||||
#include "dolphin_generalsettings.h"
|
||||
#include "dolphin_iconsmodesettings.h"
|
||||
|
||||
#include <kaction.h>
|
||||
#include <kactioncollection.h>
|
||||
|
@ -344,8 +345,10 @@ void DolphinMainWindow::slotAdditionalInfoChanged(KFileItemDelegate::Information
|
|||
|
||||
const DolphinView* view = m_activeViewContainer->view();
|
||||
|
||||
// currently the column view does not support additional information
|
||||
const bool enable = (view->mode() != DolphinView::ColumnView);
|
||||
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
|
||||
const bool enable = (view->mode() == DolphinView::DetailsView) ||
|
||||
((view->mode() == DolphinView::IconsView) && settings->showAdditionalInfo());
|
||||
|
||||
showSizeInfo->setEnabled(enable);
|
||||
showDateInfo->setEnabled(enable);
|
||||
showPermissionsInfo->setEnabled(enable);
|
||||
|
|
|
@ -30,14 +30,15 @@
|
|||
#include <kglobalsettings.h>
|
||||
#include <klocale.h>
|
||||
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QGroupBox>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QListView>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QSpinBox>
|
||||
#include <QtGui/QGridLayout>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
#include <QListView>
|
||||
#include <QPushButton>
|
||||
#include <QSpinBox>
|
||||
#include <QGridLayout>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
|
||||
QWidget* parent) :
|
||||
|
@ -49,6 +50,7 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
m_textWidthBox(0),
|
||||
m_fontRequester(0),
|
||||
m_textlinesCountBox(0),
|
||||
m_showAdditionalInfo(0),
|
||||
m_arrangementBox(0),
|
||||
m_gridSpacingBox(0)
|
||||
{
|
||||
|
@ -82,7 +84,12 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Medium"));
|
||||
m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Large"));
|
||||
|
||||
QGridLayout* textGroupLayout = new QGridLayout(textGroup);
|
||||
m_showAdditionalInfo = new QCheckBox(i18nc("@option:check",
|
||||
"Allow showing of additional information"), textGroup);
|
||||
|
||||
QVBoxLayout* textVBoxLayout = new QVBoxLayout(textGroup);
|
||||
|
||||
QGridLayout* textGroupLayout = new QGridLayout();
|
||||
textGroupLayout->addWidget(fontLabel, 0, 0);
|
||||
textGroupLayout->addWidget(m_fontRequester, 0, 1);
|
||||
textGroupLayout->addWidget(textlinesCountLabel, 1, 0);
|
||||
|
@ -90,6 +97,9 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
textGroupLayout->addWidget(textWidthLabel, 2, 0);
|
||||
textGroupLayout->addWidget(m_textWidthBox, 2, 1);
|
||||
|
||||
textVBoxLayout->addLayout(textGroupLayout);
|
||||
textVBoxLayout->addWidget(m_showAdditionalInfo);
|
||||
|
||||
// create the 'Grid' group for selecting the arrangement and the grid spacing
|
||||
QGroupBox* gridGroup = new QGroupBox(i18nc("@title:group", "Grid"), this);
|
||||
gridGroup->setSizePolicy(sizePolicy);
|
||||
|
@ -120,7 +130,8 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
}
|
||||
|
||||
IconsViewSettingsPage::~IconsViewSettingsPage()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
void IconsViewSettingsPage::applySettings()
|
||||
{
|
||||
|
@ -160,6 +171,8 @@ void IconsViewSettingsPage::applySettings()
|
|||
|
||||
settings->setNumberOfTextlines(numberOfTextlines);
|
||||
|
||||
settings->setShowAdditionalInfo(m_showAdditionalInfo->isChecked());
|
||||
|
||||
settings->setGridSpacing(GridSpacingBase +
|
||||
m_gridSpacingBox->currentIndex() * GridSpacingInc);
|
||||
}
|
||||
|
@ -195,6 +208,8 @@ void IconsViewSettingsPage::loadSettings()
|
|||
|
||||
m_textlinesCountBox->setValue(settings->numberOfTextlines());
|
||||
|
||||
m_showAdditionalInfo->setChecked(settings->showAdditionalInfo());
|
||||
|
||||
const bool leftToRightArrangement = (settings->arrangement() == QListView::LeftToRight);
|
||||
int textWidthIndex = 0;
|
||||
const int remainingWidth = settings->itemWidth() - settings->iconSize();
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
class DolphinMainWindow;
|
||||
class KFontRequester;
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
class QPushButton;
|
||||
class QSpinBox;
|
||||
|
@ -87,6 +88,7 @@ private:
|
|||
QComboBox* m_textWidthBox;
|
||||
KFontRequester* m_fontRequester;
|
||||
QSpinBox* m_textlinesCountBox;
|
||||
QCheckBox* m_showAdditionalInfo;
|
||||
|
||||
QComboBox* m_arrangementBox;
|
||||
QComboBox* m_gridSpacingBox;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "dolphinsettings.h"
|
||||
#include "dolphinsortfilterproxymodel.h"
|
||||
#include "dolphin_generalsettings.h"
|
||||
#include "dolphin_iconsmodesettings.h"
|
||||
#include "viewproperties.h"
|
||||
#include "viewpropsprogressinfo.h"
|
||||
|
||||
|
@ -380,7 +381,10 @@ void ViewPropertiesDialog::loadSettings()
|
|||
m_sortOrder->setCurrentIndex(sortOrderIndex);
|
||||
m_sorting->setCurrentIndex(m_viewProps->sorting());
|
||||
|
||||
m_additionalInfo->setEnabled(index != DolphinView::ColumnView);
|
||||
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
|
||||
const bool enabled = (index == DolphinView::DetailsView) ||
|
||||
((index == DolphinView::IconsView) && settings->showAdditionalInfo());
|
||||
m_additionalInfo->setEnabled(enabled);
|
||||
|
||||
// load show preview, show in groups and show hidden files settings
|
||||
m_showPreview->setChecked(m_viewProps->showPreview());
|
||||
|
|
Loading…
Reference in a new issue