mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 09:50:12 +00:00
Allow to set the 'AdditionalInformation' property from KFileItemDelegate for each folder. Use case:
- Icons view for images: set 'Size' as additional property - Icons view for media: show 'MIME type' as additional property - Default Icons view: don't show any addtional property for a clean layout. TODO: KFileItemDelagate::AdditionalInformation intersects with KDirModel::Columns when used in combination with the details view. Assure that the user does not get confronted with such implementation details in the user interface. svn path=/trunk/KDE/kdebase/apps/; revision=641525
This commit is contained in:
parent
66efe4d706
commit
25349096ae
|
@ -3,6 +3,7 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
|
||||
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
|
||||
<include>kfileitemdelegate.h</include>
|
||||
|
||||
<kcfgfile arg="true" />
|
||||
<group name="Settings">
|
||||
|
@ -43,6 +44,11 @@
|
|||
<max code="true">Qt::Descending</max>
|
||||
</entry>
|
||||
|
||||
<entry name="AdditionalInfo" type="Int">
|
||||
<label>Additional information</label>
|
||||
<default code="true">KFileItemDelegate::NoInformation</default>
|
||||
</entry>
|
||||
|
||||
<entry name="Timestamp" type="DateTime" >
|
||||
<label>Properties last changed</label>
|
||||
<whatsthis>The last time these properties were changed by the user.</whatsthis>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
|
||||
<kcfg>
|
||||
<kcfgfile name="dolphinrc"/>
|
||||
<include>kfileitemdelegate.h</include>
|
||||
<include>kglobalsettings.h</include>
|
||||
<include>kiconloader.h</include>
|
||||
<include>QListView</include>
|
||||
|
@ -46,9 +45,5 @@
|
|||
<label>Preview size</label>
|
||||
<default code="true">K3Icon::SizeLarge</default>
|
||||
</entry>
|
||||
<entry name="AdditionalInfo" type="Int">
|
||||
<label>Additional information</label>
|
||||
<default code="true">KFileItemDelegate::FriendlyMimeType</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
|
@ -77,9 +77,6 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
|
|||
m_viewOptions = QTreeView::viewOptions();
|
||||
m_viewOptions.font = QFont(settings->fontFamily(), settings->fontSize());
|
||||
updateDecorationSize();
|
||||
|
||||
KFileItemDelegate* delegate = new KFileItemDelegate(parent);
|
||||
setItemDelegate(delegate);
|
||||
}
|
||||
|
||||
DolphinDetailsView::~DolphinDetailsView()
|
||||
|
|
|
@ -69,12 +69,6 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
|
|||
setFlow(QListView::TopToBottom);
|
||||
m_viewOptions.decorationPosition = QStyleOptionViewItem::Left;
|
||||
}
|
||||
|
||||
KFileItemDelegate* delegate = new KFileItemDelegate(parent);
|
||||
const KFileItemDelegate::AdditionalInformation info =
|
||||
static_cast<KFileItemDelegate::AdditionalInformation>(settings->additionalInfo());
|
||||
delegate->setAdditionalInformation(info);
|
||||
setItemDelegate(delegate);
|
||||
}
|
||||
|
||||
DolphinIconsView::~DolphinIconsView()
|
||||
|
|
|
@ -303,6 +303,31 @@ void DolphinMainWindow::slotSortOrderChanged(Qt::SortOrder order)
|
|||
descending->setChecked(sortDescending);
|
||||
}
|
||||
|
||||
void DolphinMainWindow::slotAdditionalInfoChanged(KFileItemDelegate::AdditionalInformation info)
|
||||
{
|
||||
QAction* action = 0;
|
||||
switch (info) {
|
||||
case KFileItemDelegate::FriendlyMimeType:
|
||||
action = actionCollection()->action("show_mime_info");
|
||||
break;
|
||||
case KFileItemDelegate::Size:
|
||||
action = actionCollection()->action("show_size_info");
|
||||
break;
|
||||
case KFileItemDelegate::ModificationTime:
|
||||
action = actionCollection()->action("show_date_info");
|
||||
break;
|
||||
case KFileItemDelegate::NoInformation:
|
||||
default:
|
||||
action = actionCollection()->action("clear_info");
|
||||
break;
|
||||
}
|
||||
|
||||
if (action != 0) {
|
||||
KToggleAction* toggleAction = static_cast<KToggleAction*>(action);
|
||||
toggleAction->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
void DolphinMainWindow::slotSelectionChanged()
|
||||
{
|
||||
updateEditActions();
|
||||
|
@ -704,6 +729,29 @@ void DolphinMainWindow::toggleSortOrder()
|
|||
m_activeView->setSortOrder(order);
|
||||
}
|
||||
|
||||
void DolphinMainWindow::clearInfo()
|
||||
{
|
||||
m_activeView->setAdditionalInfo(KFileItemDelegate::NoInformation);
|
||||
}
|
||||
|
||||
void DolphinMainWindow::showMimeInfo()
|
||||
{
|
||||
clearStatusBar();
|
||||
m_activeView->setAdditionalInfo(KFileItemDelegate::FriendlyMimeType);
|
||||
}
|
||||
|
||||
void DolphinMainWindow::showSizeInfo()
|
||||
{
|
||||
clearStatusBar();
|
||||
m_activeView->setAdditionalInfo(KFileItemDelegate::Size);
|
||||
}
|
||||
|
||||
void DolphinMainWindow::showDateInfo()
|
||||
{
|
||||
clearStatusBar();
|
||||
m_activeView->setAdditionalInfo(KFileItemDelegate::ModificationTime);
|
||||
}
|
||||
|
||||
void DolphinMainWindow::toggleSplitView()
|
||||
{
|
||||
if (m_view[SecondaryIdx] == 0) {
|
||||
|
@ -1127,6 +1175,28 @@ void DolphinMainWindow::setupActions()
|
|||
sortDescending->setText(i18n("Descending"));
|
||||
connect(sortDescending, SIGNAL(triggered()), this, SLOT(toggleSortOrder()));
|
||||
|
||||
KToggleAction* clearInfo = actionCollection()->add<KToggleAction>("clear_info");
|
||||
clearInfo->setText(i18n("No Information"));
|
||||
connect(clearInfo, SIGNAL(triggered()), this, SLOT(clearInfo()));
|
||||
|
||||
KToggleAction* showMimeInfo = actionCollection()->add<KToggleAction>("show_mime_info");
|
||||
showMimeInfo->setText(i18n("MIME Type"));
|
||||
connect(showMimeInfo, SIGNAL(triggered()), this, SLOT(showMimeInfo()));
|
||||
|
||||
KToggleAction* showSizeInfo = actionCollection()->add<KToggleAction>("show_size_info");
|
||||
showSizeInfo->setText(i18n("Size"));
|
||||
connect(showSizeInfo, SIGNAL(triggered()), this, SLOT(showSizeInfo()));
|
||||
|
||||
KToggleAction* showDateInfo = actionCollection()->add<KToggleAction>("show_date_info");
|
||||
showDateInfo->setText(i18n("Date"));
|
||||
connect(showDateInfo, SIGNAL(triggered()), this, SLOT(showDateInfo()));
|
||||
|
||||
QActionGroup* infoGroup = new QActionGroup(this);
|
||||
infoGroup->addAction(clearInfo);
|
||||
infoGroup->addAction(showMimeInfo);
|
||||
infoGroup->addAction(showSizeInfo);
|
||||
infoGroup->addAction(showDateInfo);
|
||||
|
||||
KToggleAction* showPreview = actionCollection()->add<KToggleAction>("show_preview");
|
||||
showPreview->setText(i18n("Preview"));
|
||||
showPreview->setIcon(KIcon("thumbnail-show"));
|
||||
|
@ -1331,6 +1401,7 @@ void DolphinMainWindow::updateViewActions()
|
|||
|
||||
slotSortingChanged(m_activeView->sorting());
|
||||
slotSortOrderChanged(m_activeView->sortOrder());
|
||||
slotAdditionalInfoChanged(m_activeView->additionalInfo());
|
||||
|
||||
KToggleAction* showFilterBarAction =
|
||||
static_cast<KToggleAction*>(actionCollection()->action("show_filter_bar"));
|
||||
|
@ -1395,6 +1466,8 @@ void DolphinMainWindow::connectViewSignals(int viewIndex)
|
|||
this, SLOT(slotSortingChanged(DolphinView::Sorting)));
|
||||
connect(view, SIGNAL(sortOrderChanged(Qt::SortOrder)),
|
||||
this, SLOT(slotSortOrderChanged(Qt::SortOrder)));
|
||||
connect(view, SIGNAL(additionalInfoChanged(KFileItemDelegate::AdditionalInformation)),
|
||||
this, SLOT(slotAdditionalInfoChanged(KFileItemDelegate::AdditionalInformation)));
|
||||
connect(view, SIGNAL(selectionChanged()),
|
||||
this, SLOT(slotSelectionChanged()));
|
||||
connect(view, SIGNAL(showFilterBarChanged(bool)),
|
||||
|
|
|
@ -241,6 +241,21 @@ private slots:
|
|||
/** Switches between an ascending and descending sorting order. */
|
||||
void toggleSortOrder();
|
||||
|
||||
/**
|
||||
* Clears any additional information for an item except for the
|
||||
* name and the icon.
|
||||
*/
|
||||
void clearInfo();
|
||||
|
||||
/** Shows the MIME type as additional information for the item. */
|
||||
void showMimeInfo();
|
||||
|
||||
/** Shows the size as additional information for the item. */
|
||||
void showSizeInfo();
|
||||
|
||||
/** Shows the date as additional information for the item. */
|
||||
void showDateInfo();
|
||||
|
||||
/**
|
||||
* Switches between one and two views:
|
||||
* If one view is visible, it will get split into two views.
|
||||
|
@ -331,6 +346,9 @@ private slots:
|
|||
/** Updates the state of the 'Sort Ascending/Descending' action. */
|
||||
void slotSortOrderChanged(Qt::SortOrder order);
|
||||
|
||||
/** Updates the state of the 'Additional Information' actions. */
|
||||
void slotAdditionalInfoChanged(KFileItemDelegate::AdditionalInformation info);
|
||||
|
||||
/** Updates the state of the 'Edit' menu actions. */
|
||||
void slotSelectionChanged();
|
||||
|
||||
|
|
|
@ -32,6 +32,13 @@
|
|||
<Separator/>
|
||||
<Action name="descending" />
|
||||
</Menu>
|
||||
<Menu name="additional_info">
|
||||
<text>Additional Information</text>
|
||||
<Action name="clear_info" />
|
||||
<Action name="show_mime_info" />
|
||||
<Action name="show_size_info" />
|
||||
<Action name="show_date_info" />
|
||||
</Menu>
|
||||
<Action name="show_preview" />
|
||||
<Action name="show_hidden_files" />
|
||||
<Separator/>
|
||||
|
|
|
@ -71,6 +71,7 @@ DolphinView::DolphinView(DolphinMainWindow* mainWindow,
|
|||
m_controller(0),
|
||||
m_iconsView(0),
|
||||
m_detailsView(0),
|
||||
m_fileItemDelegate(0),
|
||||
m_filterBar(0),
|
||||
m_statusBar(0),
|
||||
m_dirModel(0),
|
||||
|
@ -425,6 +426,22 @@ Qt::SortOrder DolphinView::sortOrder() const
|
|||
return m_proxyModel->sortOrder();
|
||||
}
|
||||
|
||||
void DolphinView::setAdditionalInfo(KFileItemDelegate::AdditionalInformation info)
|
||||
{
|
||||
ViewProperties props(m_urlNavigator->url());
|
||||
props.setAdditionalInfo(info);
|
||||
|
||||
m_fileItemDelegate->setAdditionalInformation(info);
|
||||
|
||||
emit additionalInfoChanged(info);
|
||||
reload();
|
||||
}
|
||||
|
||||
KFileItemDelegate::AdditionalInformation DolphinView::additionalInfo() const
|
||||
{
|
||||
return m_fileItemDelegate->additionalInformation();
|
||||
}
|
||||
|
||||
void DolphinView::goBack()
|
||||
{
|
||||
m_urlNavigator->goBack();
|
||||
|
@ -613,6 +630,13 @@ void DolphinView::loadDirectory(const KUrl& url)
|
|||
emit sortOrderChanged(sortOrder);
|
||||
}
|
||||
|
||||
KFileItemDelegate::AdditionalInformation info = props.additionalInfo();
|
||||
if (info != m_fileItemDelegate->additionalInformation()) {
|
||||
m_fileItemDelegate->setAdditionalInformation(info);
|
||||
|
||||
emit additionalInfoChanged(info);
|
||||
}
|
||||
|
||||
const bool showPreview = props.showPreview();
|
||||
if (showPreview != m_controller->showPreview()) {
|
||||
m_controller->setShowPreview(showPreview);
|
||||
|
@ -1045,6 +1069,7 @@ void DolphinView::createView()
|
|||
view->deleteLater();
|
||||
m_iconsView = 0;
|
||||
m_detailsView = 0;
|
||||
m_fileItemDelegate = 0;
|
||||
}
|
||||
|
||||
assert(m_iconsView == 0);
|
||||
|
@ -1063,6 +1088,10 @@ void DolphinView::createView()
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
m_fileItemDelegate = new KFileItemDelegate(view);
|
||||
view->setItemDelegate(m_fileItemDelegate);
|
||||
|
||||
view->setModel(m_proxyModel);
|
||||
view->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <kparts/part.h>
|
||||
#include <kfileitem.h>
|
||||
#include <kfileitemdelegate.h>
|
||||
#include <kfileiconview.h>
|
||||
#include <kio/job.h>
|
||||
|
||||
|
@ -38,6 +39,7 @@
|
|||
|
||||
class DolphinController;
|
||||
class FilterBar;
|
||||
class KFileItemDelegate;
|
||||
class KUrl;
|
||||
class KDirModel;
|
||||
class UrlNavigator;
|
||||
|
@ -301,6 +303,12 @@ public:
|
|||
/** Returns the current used sort order (Qt::Ascending or Qt::Descending). */
|
||||
Qt::SortOrder sortOrder() const;
|
||||
|
||||
/** Sets the additional information which should be shown for the items. */
|
||||
void setAdditionalInfo(KFileItemDelegate::AdditionalInformation info);
|
||||
|
||||
/** Returns the additional information which should be shown for the items. */
|
||||
KFileItemDelegate::AdditionalInformation additionalInfo() const;
|
||||
|
||||
/** Refreshs the view settings by reading out the stored settings. */
|
||||
void refreshSettings();
|
||||
|
||||
|
@ -371,6 +379,9 @@ signals:
|
|||
/** Is emitted if the sort order (ascending or descending) has been changed. */
|
||||
void sortOrderChanged(Qt::SortOrder order);
|
||||
|
||||
/** Is emitted if the addtional information for an item has been changed. */
|
||||
void additionalInfoChanged(KFileItemDelegate::AdditionalInformation info);
|
||||
|
||||
/**
|
||||
* Is emitted if information of an item is requested to be shown e. g. in the sidebar.
|
||||
* It the URL is empty, no item information request is pending.
|
||||
|
@ -546,6 +557,7 @@ private:
|
|||
DolphinController* m_controller;
|
||||
DolphinIconsView* m_iconsView;
|
||||
DolphinDetailsView* m_detailsView;
|
||||
KFileItemDelegate* m_fileItemDelegate;
|
||||
|
||||
FilterBar* m_filterBar;
|
||||
DolphinStatusBar* m_statusBar;
|
||||
|
|
|
@ -55,7 +55,6 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
m_fontFamilyBox(0),
|
||||
m_fontSizeBox(0),
|
||||
m_textlinesCountBox(0),
|
||||
m_additionalInfo(0),
|
||||
m_arrangementBox(0),
|
||||
m_gridSpacingBox(0)
|
||||
{
|
||||
|
@ -101,15 +100,6 @@ IconsViewSettingsPage::IconsViewSettingsPage(DolphinMainWindow* mainWindow,
|
|||
m_textWidthBox->addItem(i18n("Medium"));
|
||||
m_textWidthBox->addItem(i18n("Large"));
|
||||
|
||||
new QLabel(i18n("Additional information:"), textGroup);
|
||||
m_additionalInfo = new QComboBox(textGroup);
|
||||
m_additionalInfo->addItem(i18n("No Information"), KFileItemDelegate::NoInformation);
|
||||
m_additionalInfo->addItem(i18n("MIME Type"), KFileItemDelegate::FriendlyMimeType);
|
||||
m_additionalInfo->addItem(i18n("Size"), KFileItemDelegate::Size);
|
||||
m_additionalInfo->addItem(i18n("Date"), KFileItemDelegate::ModificationTime);
|
||||
const int index = m_additionalInfo->findData(settings->additionalInfo());
|
||||
m_additionalInfo->setCurrentIndex(index);
|
||||
|
||||
Q3GroupBox* gridGroup = new Q3GroupBox(2, Qt::Horizontal, i18n("Grid"), this);
|
||||
gridGroup->setSizePolicy(sizePolicy);
|
||||
gridGroup->setMargin(margin);
|
||||
|
@ -176,8 +166,6 @@ void IconsViewSettingsPage::applySettings()
|
|||
settings->setFontFamily(m_fontFamilyBox->currentFont().family());
|
||||
settings->setFontSize(fontSize);
|
||||
settings->setNumberOfTextlines(m_textlinesCountBox->value());
|
||||
const int index = m_additionalInfo->currentIndex();
|
||||
settings->setAdditionalInfo(m_additionalInfo->itemData(index).toInt());
|
||||
|
||||
settings->setGridSpacing(GRID_SPACING_BASE +
|
||||
m_gridSpacingBox->currentIndex() * GRID_SPACING_INC);
|
||||
|
|
|
@ -82,7 +82,6 @@ private:
|
|||
QFontComboBox* m_fontFamilyBox;
|
||||
QSpinBox* m_fontSizeBox;
|
||||
QSpinBox* m_textlinesCountBox;
|
||||
QComboBox* m_additionalInfo;
|
||||
|
||||
QComboBox* m_arrangementBox;
|
||||
QComboBox* m_gridSpacingBox;
|
||||
|
|
|
@ -163,6 +163,20 @@ Qt::SortOrder ViewProperties::sortOrder() const
|
|||
return static_cast<Qt::SortOrder>(m_node->sortOrder());
|
||||
}
|
||||
|
||||
void ViewProperties::setAdditionalInfo(KFileItemDelegate::AdditionalInformation info)
|
||||
{
|
||||
if (m_node->additionalInfo() != info) {
|
||||
m_node->setAdditionalInfo(info);
|
||||
updateTimeStamp();
|
||||
}
|
||||
}
|
||||
|
||||
KFileItemDelegate::AdditionalInformation ViewProperties::additionalInfo() const
|
||||
{
|
||||
return static_cast<KFileItemDelegate::AdditionalInformation>(m_node->additionalInfo());
|
||||
}
|
||||
|
||||
|
||||
void ViewProperties::setDirProperties(const ViewProperties& props)
|
||||
{
|
||||
setViewMode(props.viewMode());
|
||||
|
@ -170,6 +184,7 @@ void ViewProperties::setDirProperties(const ViewProperties& props)
|
|||
setShowHiddenFiles(props.showHiddenFiles());
|
||||
setSorting(props.sorting());
|
||||
setSortOrder(props.sortOrder());
|
||||
setAdditionalInfo(props.additionalInfo());
|
||||
}
|
||||
|
||||
void ViewProperties::setAutoSaveEnabled(bool autoSave)
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define VIEWPROPERTIES_H
|
||||
|
||||
#include <dolphinview.h>
|
||||
#include <kfileitemdelegate.h>
|
||||
#include <kurl.h>
|
||||
#include <qdatetime.h>
|
||||
|
||||
|
@ -71,6 +72,9 @@ public:
|
|||
void setSortOrder(Qt::SortOrder sortOrder);
|
||||
Qt::SortOrder sortOrder() const;
|
||||
|
||||
void setAdditionalInfo(KFileItemDelegate::AdditionalInformation info);
|
||||
KFileItemDelegate::AdditionalInformation additionalInfo() const;
|
||||
|
||||
/**
|
||||
* Sets the directory properties view mode, show preview,
|
||||
* show hidden files, sorting and sort order like
|
||||
|
|
|
@ -53,6 +53,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
|
|||
m_viewMode(0),
|
||||
m_sorting(0),
|
||||
m_sortOrder(0),
|
||||
m_additionalInfo(0),
|
||||
m_showPreview(0),
|
||||
m_showHiddenFiles(0),
|
||||
m_applyToCurrentFolder(0),
|
||||
|
@ -102,6 +103,15 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
|
|||
const int sortOrderIdx = (m_viewProps->sortOrder() == Qt::Ascending) ? 0 : 1;
|
||||
m_sortOrder->setCurrentIndex(sortOrderIdx);
|
||||
|
||||
QLabel* additionalInfoLabel = new QLabel(i18n("Additional information:"), propsBox);
|
||||
m_additionalInfo = new QComboBox(propsBox);
|
||||
m_additionalInfo->addItem(i18n("No Information"), KFileItemDelegate::NoInformation);
|
||||
m_additionalInfo->addItem(i18n("MIME Type"), KFileItemDelegate::FriendlyMimeType);
|
||||
m_additionalInfo->addItem(i18n("Size"), KFileItemDelegate::Size);
|
||||
m_additionalInfo->addItem(i18n("Date"), KFileItemDelegate::ModificationTime);
|
||||
const int addInfoIndex = m_additionalInfo->findData(m_viewProps->additionalInfo());
|
||||
m_additionalInfo->setCurrentIndex(addInfoIndex);
|
||||
|
||||
m_showPreview = new QCheckBox(i18n("Show preview"), propsBox);
|
||||
m_showPreview->setChecked(m_viewProps->showPreview());
|
||||
|
||||
|
@ -116,8 +126,10 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
|
|||
propsBoxLayout->addWidget(m_sorting, 1, 1);
|
||||
propsBoxLayout->addWidget(sortOrderLabel, 2, 0);
|
||||
propsBoxLayout->addWidget(m_sortOrder, 2, 1);
|
||||
propsBoxLayout->addWidget(m_showPreview, 3, 0);
|
||||
propsBoxLayout->addWidget(m_showHiddenFiles, 4, 0);
|
||||
propsBoxLayout->addWidget(additionalInfoLabel, 3, 0);
|
||||
propsBoxLayout->addWidget(m_additionalInfo, 3, 1);
|
||||
propsBoxLayout->addWidget(m_showPreview, 4, 0);
|
||||
propsBoxLayout->addWidget(m_showHiddenFiles, 5, 0);
|
||||
|
||||
topLayout->addWidget(propsBox);
|
||||
|
||||
|
@ -127,6 +139,8 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
|
|||
this, SLOT(slotSortingChanged(int)));
|
||||
connect(m_sortOrder, SIGNAL(activated(int)),
|
||||
this, SLOT(slotSortOrderChanged(int)));
|
||||
connect(m_additionalInfo, SIGNAL(activated(int)),
|
||||
this, SLOT(slotAdditionalInfoChanged(int)));
|
||||
connect(m_showPreview, SIGNAL(clicked()),
|
||||
this, SLOT(slotShowPreviewChanged()));
|
||||
connect(m_showHiddenFiles, SIGNAL(clicked()),
|
||||
|
@ -214,6 +228,19 @@ void ViewPropertiesDialog::slotSortOrderChanged(int index)
|
|||
m_isDirty = true;
|
||||
}
|
||||
|
||||
void ViewPropertiesDialog::slotAdditionalInfoChanged(int index)
|
||||
{
|
||||
KFileItemDelegate::AdditionalInformation info = KFileItemDelegate::NoInformation;
|
||||
switch (index) {
|
||||
case 1: info = KFileItemDelegate::FriendlyMimeType; break;
|
||||
case 2: info = KFileItemDelegate::Size; break;
|
||||
case 3: info = KFileItemDelegate::ModificationTime; break;
|
||||
default: break;
|
||||
}
|
||||
m_viewProps->setAdditionalInfo(info);
|
||||
m_isDirty = true;
|
||||
}
|
||||
|
||||
void ViewPropertiesDialog::slotShowPreviewChanged()
|
||||
{
|
||||
const bool show = m_showPreview->isChecked();
|
||||
|
|
|
@ -50,6 +50,7 @@ private slots:
|
|||
void slotViewModeChanged(int index);
|
||||
void slotSortingChanged(int index);
|
||||
void slotSortOrderChanged(int index);
|
||||
void slotAdditionalInfoChanged(int index);
|
||||
void slotShowPreviewChanged();
|
||||
void slotShowHiddenFilesChanged();
|
||||
void markAsDirty();
|
||||
|
@ -62,6 +63,7 @@ private:
|
|||
QComboBox* m_viewMode;
|
||||
QComboBox* m_sorting;
|
||||
QComboBox* m_sortOrder;
|
||||
QComboBox* m_additionalInfo;
|
||||
QCheckBox* m_showPreview;
|
||||
QCheckBox* m_showHiddenFiles;
|
||||
QRadioButton* m_applyToCurrentFolder;
|
||||
|
|
Loading…
Reference in a new issue