mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-02 14:45:04 +00:00
Enable custom view properties for special folders even if "remember for each folder" is off
Special folders include: search, trash, recents, timeline Not including Downloads, although we have a custom view when "remember for each folder" is on. Rational: These folders really need the custom view. So even if the user selects a global view for all "normal" folders, s/he probably still want a custom view for special folders.
This commit is contained in:
parent
af91586e00
commit
3a03f86b83
|
@ -13,7 +13,9 @@
|
||||||
|
|
||||||
#include <QButtonGroup>
|
#include <QButtonGroup>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
|
#include <QFontDatabase>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
|
#include <QLabel>
|
||||||
#include <QMimeDatabase>
|
#include <QMimeDatabase>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
@ -25,14 +27,26 @@ GeneralViewSettingsPage::GeneralViewSettingsPage(const QUrl &url, QWidget *paren
|
||||||
|
|
||||||
// Display style
|
// Display style
|
||||||
m_globalViewProps = new QRadioButton(i18nc("@option:radio", "Use common display style for all folders"));
|
m_globalViewProps = new QRadioButton(i18nc("@option:radio", "Use common display style for all folders"));
|
||||||
|
// i18n: The information in this sentence contradicts the preceding sentence. That's what the word "still" is communicating.
|
||||||
|
// The previous sentence is "Use common display style for all folders".
|
||||||
|
QLabel *globalViewPropsLabel = new QLabel(i18nc("@info", "Some special views like search, recent files, or trash will still use a custom display style."));
|
||||||
|
globalViewPropsLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
|
||||||
|
globalViewPropsLabel->setWordWrap(true);
|
||||||
|
globalViewPropsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||||
|
|
||||||
m_localViewProps = new QRadioButton(i18nc("@option:radio", "Remember display style for each folder"));
|
m_localViewProps = new QRadioButton(i18nc("@option:radio", "Remember display style for each folder"));
|
||||||
m_localViewProps->setToolTip(i18nc("@info", "Dolphin will create a hidden .directory file in each folder you change view properties for."));
|
QLabel *localViewPropsLabel = new QLabel(i18nc("@info", "Dolphin will create a hidden .directory file in each folder you change view properties for."));
|
||||||
|
localViewPropsLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
|
||||||
|
localViewPropsLabel->setWordWrap(true);
|
||||||
|
localViewPropsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||||
|
|
||||||
QButtonGroup *viewGroup = new QButtonGroup(this);
|
QButtonGroup *viewGroup = new QButtonGroup(this);
|
||||||
viewGroup->addButton(m_globalViewProps);
|
viewGroup->addButton(m_globalViewProps);
|
||||||
viewGroup->addButton(m_localViewProps);
|
viewGroup->addButton(m_localViewProps);
|
||||||
topLayout->addRow(i18nc("@title:group", "Display style: "), m_globalViewProps);
|
topLayout->addRow(i18nc("@title:group", "Display style: "), m_globalViewProps);
|
||||||
|
topLayout->addRow(QString(), globalViewPropsLabel);
|
||||||
topLayout->addRow(QString(), m_localViewProps);
|
topLayout->addRow(QString(), m_localViewProps);
|
||||||
|
topLayout->addRow(QString(), localViewPropsLabel);
|
||||||
|
|
||||||
topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed));
|
topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||||
|
|
||||||
|
|
|
@ -46,9 +46,7 @@ ViewProperties::ViewProperties(const QUrl &url)
|
||||||
// We try and save it to the file .directory in the directory being viewed.
|
// We try and save it to the file .directory in the directory being viewed.
|
||||||
// If the directory is not writable by the user or the directory is not local,
|
// If the directory is not writable by the user or the directory is not local,
|
||||||
// we store the properties information in a local file.
|
// we store the properties information in a local file.
|
||||||
if (useGlobalViewProps) {
|
if (url.scheme().contains(QLatin1String("search"))) {
|
||||||
m_filePath = destinationDir(QStringLiteral("global"));
|
|
||||||
} else if (url.scheme().contains(QLatin1String("search"))) {
|
|
||||||
m_filePath = destinationDir(QStringLiteral("search/")) + directoryHashForUrl(url);
|
m_filePath = destinationDir(QStringLiteral("search/")) + directoryHashForUrl(url);
|
||||||
useSearchView = true;
|
useSearchView = true;
|
||||||
} else if (url.scheme() == QLatin1String("trash")) {
|
} else if (url.scheme() == QLatin1String("trash")) {
|
||||||
|
@ -63,6 +61,8 @@ ViewProperties::ViewProperties(const QUrl &url)
|
||||||
} else if (url.scheme() == QLatin1String("timeline")) {
|
} else if (url.scheme() == QLatin1String("timeline")) {
|
||||||
m_filePath = destinationDir(QStringLiteral("timeline"));
|
m_filePath = destinationDir(QStringLiteral("timeline"));
|
||||||
useRecentDocumentsView = true;
|
useRecentDocumentsView = true;
|
||||||
|
} else if (useGlobalViewProps) {
|
||||||
|
m_filePath = destinationDir(QStringLiteral("global"));
|
||||||
} else if (url.isLocalFile()) {
|
} else if (url.isLocalFile()) {
|
||||||
m_filePath = url.toLocalFile();
|
m_filePath = url.toLocalFile();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue