m_previewsShown(nullptr),
m_showInGroups(nullptr),
m_showHiddenFiles(nullptr),
m_previewsShown(nullptr),
m_showInGroups(nullptr),
m_showHiddenFiles(nullptr),
auto layout = new QFormLayout(this);
// Otherwise the dialog won't resize when we collapse the KCollapsibleGroupBox.
layout->setSizeConstraint(QLayout::SetFixedSize);
auto layout = new QFormLayout(this);
// Otherwise the dialog won't resize when we collapse the KCollapsibleGroupBox.
layout->setSizeConstraint(QLayout::SetFixedSize);
// create 'Properties' group containing view mode, sorting, sort order and show hidden files
m_viewMode = new QComboBox();
// create 'Properties' group containing view mode, sorting, sort order and show hidden files
m_viewMode = new QComboBox();
m_previewsShown = new QCheckBox(i18nc("@option:check", "Show preview"));
m_showInGroups = new QCheckBox(i18nc("@option:check", "Show in groups"));
m_showHiddenFiles = new QCheckBox(i18nc("@option:check", "Show hidden files"));
auto additionalInfoBox = new KCollapsibleGroupBox();
additionalInfoBox->setTitle(i18nc("@title:group", "Additional Information"));
m_previewsShown = new QCheckBox(i18nc("@option:check", "Show preview"));
m_showInGroups = new QCheckBox(i18nc("@option:check", "Show in groups"));
m_showHiddenFiles = new QCheckBox(i18nc("@option:check", "Show hidden files"));
auto additionalInfoBox = new KCollapsibleGroupBox();
additionalInfoBox->setTitle(i18nc("@title:group", "Additional Information"));
QHBoxLayout* sortingLayout = new QHBoxLayout();
sortingLayout->setContentsMargins(0, 0, 0, 0);
sortingLayout->addWidget(m_sortOrder);
QHBoxLayout* sortingLayout = new QHBoxLayout();
sortingLayout->setContentsMargins(0, 0, 0, 0);
sortingLayout->addWidget(m_sortOrder);
layout->addRow(QString(), m_previewsShown);
layout->addRow(QString(), m_showInGroups);
layout->addRow(QString(), m_showHiddenFiles);
layout->addRow(QString(), m_previewsShown);
layout->addRow(QString(), m_showInGroups);
layout->addRow(QString(), m_showHiddenFiles);
this, &ViewPropertiesDialog::slotSortOrderChanged);
connect(m_sortFoldersFirst, &QCheckBox::clicked,
this, &ViewPropertiesDialog::slotSortFoldersFirstChanged);
this, &ViewPropertiesDialog::slotSortOrderChanged);
connect(m_sortFoldersFirst, &QCheckBox::clicked,
this, &ViewPropertiesDialog::slotSortFoldersFirstChanged);
connect(m_previewsShown, &QCheckBox::clicked,
this, &ViewPropertiesDialog::slotShowPreviewChanged);
connect(m_showInGroups, &QCheckBox::clicked,
connect(m_previewsShown, &QCheckBox::clicked,
this, &ViewPropertiesDialog::slotShowPreviewChanged);
connect(m_showInGroups, &QCheckBox::clicked,
const bool applyToSubFolders = m_applyToSubFolders && m_applyToSubFolders->isChecked();
if (applyToSubFolders) {
const QString text(i18nc("@info", "The view properties of all sub-folders will be changed. Do you want to continue?"));
const bool applyToSubFolders = m_applyToSubFolders && m_applyToSubFolders->isChecked();
if (applyToSubFolders) {
const QString text(i18nc("@info", "The view properties of all sub-folders will be changed. Do you want to continue?"));
- if (KMessageBox::questionYesNo(this, text) == KMessageBox::No) {
+ if (KMessageBox::questionYesNo(this, text, {},
+ KStandardGuiItem::cont(),
+ KStandardGuiItem::cancel()) == KMessageBox::No) {
- if (KMessageBox::questionYesNo(this, text) == KMessageBox::No) {
+ if (KMessageBox::questionYesNo(this, text, {},
+ KStandardGuiItem::cont(),
+ KStandardGuiItem::cancel()) == KMessageBox::No) {
m_dolphinView->setSortRole(m_viewProps->sortRole());
m_dolphinView->setSortOrder(m_viewProps->sortOrder());
m_dolphinView->setSortFoldersFirst(m_viewProps->sortFoldersFirst());
m_dolphinView->setSortRole(m_viewProps->sortRole());
m_dolphinView->setSortOrder(m_viewProps->sortOrder());
m_dolphinView->setSortFoldersFirst(m_viewProps->sortFoldersFirst());
m_dolphinView->setGroupedSorting(m_viewProps->groupedSorting());
m_dolphinView->setVisibleRoles(m_viewProps->visibleRoles());
m_dolphinView->setPreviewsShown(m_viewProps->previewsShown());
m_dolphinView->setGroupedSorting(m_viewProps->groupedSorting());
m_dolphinView->setVisibleRoles(m_viewProps->visibleRoles());
m_dolphinView->setPreviewsShown(m_viewProps->previewsShown());
m_sorting->setCurrentIndex(sortRoleIndex);
m_sortFoldersFirst->setChecked(m_viewProps->sortFoldersFirst());
m_sorting->setCurrentIndex(sortRoleIndex);
m_sortFoldersFirst->setChecked(m_viewProps->sortFoldersFirst());
// Load show preview, show in groups and show hidden files settings
m_previewsShown->setChecked(m_viewProps->previewsShown());
// Load show preview, show in groups and show hidden files settings
m_previewsShown->setChecked(m_viewProps->previewsShown());