#include <QButtonGroup>
#include <QCheckBox>
+#include <QFontDatabase>
#include <QFormLayout>
+#include <QLabel>
+#include <QMimeDatabase>
#include <QVBoxLayout>
GeneralViewSettingsPage::GeneralViewSettingsPage(const QUrl &url, QWidget *parent)
: SettingsPageBase(parent)
, m_url(url)
- , m_localViewProps(nullptr)
- , m_globalViewProps(nullptr)
- , m_showToolTips(nullptr)
- , m_showSelectionToggle(nullptr)
- , m_renameInline(nullptr)
{
QFormLayout *topLayout = new QFormLayout(this);
// Display style
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->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);
viewGroup->addButton(m_globalViewProps);
viewGroup->addButton(m_localViewProps);
topLayout->addRow(i18nc("@title:group", "Display style: "), m_globalViewProps);
+ topLayout->addRow(QString(), globalViewPropsLabel);
topLayout->addRow(QString(), m_localViewProps);
+ topLayout->addRow(QString(), localViewPropsLabel);
topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed));
m_renameInline = new QCheckBox(i18nc("option:check", "Rename inline"));
topLayout->addRow(QString(), m_renameInline);
+ m_hideXtrashFiles = new QCheckBox(i18nc("option:check", "Also hide backup files while hiding hidden files"));
+ QMimeDatabase db;
+ QMimeType mime = db.mimeTypeForName(QStringLiteral("application/x-trash"));
+ m_hideXtrashFiles->setToolTip(i18nc("@info:tooltip %1 are the file patterns for mimetype application/x-trash",
+ "Backup files are the files whose mime-type is application/x-trash, patterns: %1",
+ (mime.globPatterns().join(", "))));
+ topLayout->addRow(QString(), m_hideXtrashFiles);
+
loadSettings();
connect(m_localViewProps, &QRadioButton::toggled, this, &GeneralViewSettingsPage::changed);
#endif
connect(m_showSelectionToggle, &QCheckBox::toggled, this, &GeneralViewSettingsPage::changed);
connect(m_renameInline, &QCheckBox::toggled, this, &GeneralViewSettingsPage::changed);
+ connect(m_hideXtrashFiles, &QCheckBox::toggled, this, &GeneralViewSettingsPage::changed);
}
GeneralViewSettingsPage::~GeneralViewSettingsPage()
#endif
settings->setShowSelectionToggle(m_showSelectionToggle->isChecked());
settings->setRenameInline(m_renameInline->isChecked());
+ settings->setHideXTrashFile(m_hideXtrashFiles->isChecked());
settings->setAutoExpandFolders(m_autoExpandFolders->isChecked());
+ settings->setBrowseThroughArchives(m_openArchivesAsFolder->isChecked());
settings->save();
if (useGlobalViewProps) {
// Remember the global view properties by applying the current view properties.
#endif
m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle());
m_renameInline->setChecked(GeneralSettings::renameInline());
+ m_hideXtrashFiles->setChecked(GeneralSettings::hideXTrashFile());
m_localViewProps->setChecked(!useGlobalViewProps);
m_globalViewProps->setChecked(useGlobalViewProps);