From 7e2883afcfd61ca95601005a1bca81641e3b112e Mon Sep 17 00:00:00 2001 From: Ignat Semenov Date: Tue, 26 Mar 2013 14:12:50 +0400 Subject: [PATCH] add a "Sort order" combo to the Display config page Allow the user to change sorting order using the Settings dialog. --- plasma/applets/folderview/folderview.cpp | 7 + .../folderview/folderviewDisplayConfig.ui | 659 ++++++++++-------- 2 files changed, 360 insertions(+), 306 deletions(-) diff --git a/plasma/applets/folderview/folderview.cpp b/plasma/applets/folderview/folderview.cpp index d2f528bc81..55c374262b 100644 --- a/plasma/applets/folderview/folderview.cpp +++ b/plasma/applets/folderview/folderview.cpp @@ -737,6 +737,9 @@ void FolderView::createConfigurationInterface(KConfigDialog *parent) uiDisplay.sortCombo->addItem(KGlobal::locale()->removeAcceleratorMarker(m_actionCollection.action("sort_type")->text()), KDirModel::Type); uiDisplay.sortCombo->addItem(KGlobal::locale()->removeAcceleratorMarker(m_actionCollection.action("sort_date")->text()), KDirModel::ModifiedTime); + uiDisplay.directionCombo->addItem(KGlobal::locale()->removeAcceleratorMarker(m_actionCollection.action("sort_ascending")->text()), QVariant::fromValue(Qt::AscendingOrder)); + uiDisplay.directionCombo->addItem(KGlobal::locale()->removeAcceleratorMarker(m_actionCollection.action("sort_descending")->text()), QVariant::fromValue(Qt::DescendingOrder)); + uiDisplay.flowCombo->addItem(KGlobal::locale()->removeAcceleratorMarker(m_actionCollection.action("arrange_ver_ltr")->text()), QVariant::fromValue(IconView::VerLeftToRight)); uiDisplay.flowCombo->addItem(KGlobal::locale()->removeAcceleratorMarker(m_actionCollection.action("arrange_ver_rtl")->text()), QVariant::fromValue(IconView::VerRightToLeft)); uiDisplay.flowCombo->addItem(KGlobal::locale()->removeAcceleratorMarker(m_actionCollection.action("arrange_hor_ltr")->text()), QVariant::fromValue(IconView::HorLeftToRight)); @@ -822,6 +825,7 @@ void FolderView::createConfigurationInterface(KConfigDialog *parent) connect(uiDisplay.flowCombo, SIGNAL(currentIndexChanged(int)), parent, SLOT(settingsModified())); connect(uiDisplay.sortCombo, SIGNAL(currentIndexChanged(int)), parent, SLOT(settingsModified())); + connect(uiDisplay.directionCombo, SIGNAL(currentIndexChanged(int)), parent, SLOT(settingsModified())); connect(uiDisplay.sizeSlider, SIGNAL(valueChanged(int)), parent, SLOT(settingsModified())); connect(uiDisplay.showPreviews, SIGNAL(toggled(bool)), parent, SLOT(settingsModified())); connect(uiDisplay.lockInPlace, SIGNAL(toggled(bool)), parent, SLOT(settingsModified())); @@ -893,6 +897,9 @@ void FolderView::configAccepted() const int sortColumn = uiDisplay.sortCombo->itemData(uiDisplay.sortCombo->currentIndex()).toInt(); cg.writeEntry("sortColumn", sortColumn); + const Qt::SortOrder order = uiDisplay.directionCombo->itemData(uiDisplay.directionCombo->currentIndex()).value(); + cg.writeEntry("sortOrder", sortOrderEnumToString(order)); + const IconView::Flow flow = uiDisplay.flowCombo->itemData(uiDisplay.flowCombo->currentIndex()).value(); cg.writeEntry("flow", static_cast(flow)); diff --git a/plasma/applets/folderview/folderviewDisplayConfig.ui b/plasma/applets/folderview/folderviewDisplayConfig.ui index 8cf5189428..9d73f0eafd 100644 --- a/plasma/applets/folderview/folderviewDisplayConfig.ui +++ b/plasma/applets/folderview/folderviewDisplayConfig.ui @@ -7,67 +7,10 @@ 0 0 442 - 401 + 430 - - - - Lock in place: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Previews: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Lines: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - numLinesEdit - - - - - - - Check this option if you do not want the icons to be moveable in the view. - -This option is useful if you want to avoid accidentally moving the icons while interacting with them. - - - - - - - - - - Check this option if you want the icons to be arranged in a grid. - -When this option is checked, icons will automatically snap to the nearest grid cell when you move them around in the view. - - - - - - @@ -87,249 +30,6 @@ When this option is checked, icons will automatically snap to the nearest grid c - - - - - - Check this option if you want to see previews of the file contents in the icons. - - - - - - - - - - Click this button to choose for which types of files previews will be shown. - - - More Preview Options... - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Shadows: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - numLinesEdit - - - - - - - Check this option if you want folder previews to appear only when clicked. When this option is turned off, folder previews will appear automatically when the mouse hovers over a folder. - - - - - - - - - - Align to grid: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Use this control to choose if you want the icons to be arranged top to bottom starting on the left side of the view, or arranged left to right starting at the top of the view. - - - - - - - Click this button to choose the color which is used for the text labels in the view. - - - - - - - - - - Use this control to choose the criteria by which the icons will be sorted in the view. - - - - - - - Color: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - colorButton - - - - - - - Qt::Horizontal - - - - 160 - 23 - - - - - - - - Arrangement: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - flowCombo - - - - - - - Click to view folder: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - <html><body><p>Check this option if you want the text labels to cast a shadow on the background.</p> -<p></p> -<p>Shadows help make the text easier to read by making it stand out more from the background.</p> -<p></p> -<p><i>Note that with dark text colors, this option will cause the text to glow with a bright halo, instead of casting a shadow.</i></p></body></html> - - - - - - - - - - Qt::Vertical - - - - 44 - 216 - - - - - - - - Size: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - sizeSlider - - - - - - - - 0 - 0 - - - - Use this control to choose how many lines of text will be shown below the icons. - - - 1 line - - - lines - - - 1 - - - 10 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 12 - 20 - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Icon Text - - - @@ -346,7 +46,106 @@ When this option is checked, icons will automatically snap to the nearest grid c - + + + + Arrangement: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + flowCombo + + + + + + + Use this control to choose if you want the icons to be arranged top to bottom starting on the left side of the view, or arranged left to right starting at the top of the view. + + + + + + + Sorting: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + sortCombo + + + + + + + Use this control to choose the criteria by which the icons will be sorted in the view. + + + + + + + Qt::Horizontal + + + + 160 + 23 + + + + + + + + Direction: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + directionCombo + + + + + + + Use this control to choose the criteria by which the icons will be sorted in the view. + + + + + + + Qt::Horizontal + + + + 208 + 23 + + + + + + + + Size: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + sizeSlider + + + + @@ -389,19 +188,253 @@ When this option is checked, icons will automatically snap to the nearest grid c - - + + - Sorting: + Previews: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + Check this option if you want to see previews of the file contents in the icons. + + + + + + + + + + Click this button to choose for which types of files previews will be shown. + + + More Preview Options... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Lock in place: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Check this option if you do not want the icons to be moveable in the view. + +This option is useful if you want to avoid accidentally moving the icons while interacting with them. + + + + + + + + + + Align to grid: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Check this option if you want the icons to be arranged in a grid. + +When this option is checked, icons will automatically snap to the nearest grid cell when you move them around in the view. + + + + + + + + + + Click to view folder: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Check this option if you want folder previews to appear only when clicked. When this option is turned off, folder previews will appear automatically when the mouse hovers over a folder. + + + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Icon Text + + + + + + + Lines: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - sortCombo + numLinesEdit + + + + + 0 + 0 + + + + Use this control to choose how many lines of text will be shown below the icons. + + + 1 line + + + lines + + + 1 + + + 10 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 12 + 20 + + + + + + + + Color: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + colorButton + + + + + + + Click this button to choose the color which is used for the text labels in the view. + + + + + + + + + + Shadows: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + numLinesEdit + + + + + + + <html><body><p>Check this option if you want the text labels to cast a shadow on the background.</p> +<p></p> +<p>Shadows help make the text easier to read by making it stand out more from the background.</p> +<p></p> +<p><i>Note that with dark text colors, this option will cause the text to glow with a bright halo, instead of casting a shadow.</i></p></body></html> + + + + + + + + + + Qt::Vertical + + + + 44 + 216 + + + + @@ -421,6 +454,20 @@ When this option is checked, icons will automatically snap to the nearest grid c
knuminput.h
+ + flowCombo + sortCombo + directionCombo + sizeSlider + showPreviews + previewsAdvanced + lockInPlace + alignToGrid + clickToView + numLinesEdit + colorButton + drawShadows +