globalViewPropsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
m_localViewProps = new QRadioButton(i18nc("@option:radio", "Remember display style for each folder"));
- QLabel *localViewPropsLabel = new QLabel(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 add file system metadata to folders you change view properties for. If that is not possible, "
+ "a hidden .directory file is created instead."));
localViewPropsLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
localViewPropsLabel->setWordWrap(true);
localViewPropsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+ m_dynamicView = new QCheckBox(i18nc("option:check", "Use icons view mode for locations which mostly contain media files"));
+
QButtonGroup *viewGroup = new QButtonGroup(this);
viewGroup->addButton(m_globalViewProps);
viewGroup->addButton(m_localViewProps);
topLayout->addRow(QString(), globalViewPropsLabel);
topLayout->addRow(QString(), m_localViewProps);
topLayout->addRow(QString(), localViewPropsLabel);
+ topLayout->addRow(QString(), m_dynamicView);
topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed));
"edit_select_all",
"toggle_selection_mode",
"create_dir",
+ "create_file",
"show_preview",
"show_hidden_files",
"show_in_groups",
m_doubleClickViewComboBox->addItem(QIcon::fromTheme("list-add"), i18nc("@item:inlistbox", "Custom Command"), customCommand);
m_doubleClickViewComboBox->insertSeparator(2);
- DolphinMainWindow *mainWindow = static_cast<DolphinMainWindow *>(QApplication::activeWindow());
+ DolphinMainWindow *mainWindow = qobject_cast<DolphinMainWindow *>(QApplication::activeWindow());
+
if (mainWindow != nullptr) {
KActionCollection *actions = mainWindow->actionCollection();
// get the allowed actions from actionCollection and add them to the combobox
connect(m_showSelectionToggle, &QCheckBox::toggled, this, &GeneralViewSettingsPage::changed);
connect(m_renameInline, &QCheckBox::toggled, this, &GeneralViewSettingsPage::changed);
connect(m_hideXtrashFiles, &QCheckBox::toggled, this, &GeneralViewSettingsPage::changed);
+ connect(m_dynamicView, &QCheckBox::toggled, this, &GeneralViewSettingsPage::changed);
connect(m_doubleClickViewCustomAction, &QLineEdit::textChanged, this, &GeneralViewSettingsPage::changed);
connect(m_doubleClickViewComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &GeneralViewSettingsPage::changed);
connect(m_doubleClickViewComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &GeneralViewSettingsPage::updateCustomActionVisibility);
settings->setShowSelectionToggle(m_showSelectionToggle->isChecked());
settings->setRenameInline(m_renameInline->isChecked());
settings->setHideXTrashFile(m_hideXtrashFiles->isChecked());
+ settings->setDynamicView(m_dynamicView->isChecked());
settings->setAutoExpandFolders(m_autoExpandFolders->isChecked());
settings->setBrowseThroughArchives(m_openArchivesAsFolder->isChecked());
settings->setDoubleClickViewCustomAction(m_doubleClickViewCustomAction->text());
m_showSelectionToggle->setChecked(GeneralSettings::showSelectionToggle());
m_renameInline->setChecked(GeneralSettings::renameInline());
m_hideXtrashFiles->setChecked(GeneralSettings::hideXTrashFile());
+ m_dynamicView->setChecked(GeneralSettings::dynamicView());
m_localViewProps->setChecked(!useGlobalViewProps);
m_globalViewProps->setChecked(useGlobalViewProps);