// m_sorting->addItem(i18nc("@item:inlistbox Sort", "By Tags"));
// }
#endif
- m_showPreview = new QCheckBox(i18nc("@option:check", "Show preview"), propsBox);
- m_showInGroups = new QCheckBox(i18nc("@option:check", "Show in groups"), propsBox);
- m_showHiddenFiles = new QCheckBox(i18nc("@option:check", "Show hidden files"), propsBox);
+ m_showPreview = 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"));
- m_additionalInfo = new QPushButton(i18nc("@action:button", "Additional Information"), propsBox);
+ m_additionalInfo = new QPushButton(i18nc("@action:button", "Additional Information"));
QHBoxLayout* sortingLayout = new QHBoxLayout();
sortingLayout->setMargin(0);
topLayout->addWidget(propsBox);
- connect(m_viewMode, SIGNAL(activated(int)),
+ connect(m_viewMode, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotViewModeChanged(int)));
- connect(m_sorting, SIGNAL(activated(int)),
+ connect(m_sorting, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotSortingChanged(int)));
- connect(m_sortOrder, SIGNAL(activated(int)),
+ connect(m_sortOrder, SIGNAL(currentIndexChanged(int)),
this, SLOT(slotSortOrderChanged(int)));
connect(m_additionalInfo, SIGNAL(clicked()),
this, SLOT(configureAdditionalInfo()));
topLayout->addWidget(applyBox);
topLayout->addWidget(m_useAsDefault);
- connect(m_applyToCurrentFolder, SIGNAL(clicked()),
- this, SLOT(markAsDirty()));
- connect(m_applyToSubFolders, SIGNAL(clicked()),
- this, SLOT(markAsDirty()));
- connect(m_applyToAllFolders, SIGNAL(clicked()),
- this, SLOT(markAsDirty()));
- connect(m_useAsDefault, SIGNAL(clicked()),
- this, SLOT(markAsDirty()));
+ connect(m_applyToCurrentFolder, SIGNAL(clicked(bool)),
+ this, SLOT(markAsDirty(bool)));
+ connect(m_applyToSubFolders, SIGNAL(clicked(bool)),
+ this, SLOT(markAsDirty(bool)));
+ connect(m_applyToAllFolders, SIGNAL(clicked(bool)),
+ this, SLOT(markAsDirty(bool)));
+ connect(m_useAsDefault, SIGNAL(clicked(bool)),
+ this, SLOT(markAsDirty(bool)));
}
main->setLayout(topLayout);
void ViewPropertiesDialog::slotApply()
{
applyViewProperties();
+ markAsDirty(false);
}
void ViewPropertiesDialog::slotViewModeChanged(int index)
{
m_viewProps->setViewMode(static_cast<DolphinView::Mode>(index));
- m_isDirty = true;
+ markAsDirty(true);
const DolphinView::Mode mode = m_viewProps->viewMode();
m_showInGroups->setEnabled(mode == DolphinView::IconsView);
{
const DolphinView::Sorting sorting = DolphinSortFilterProxyModel::sortingForColumn(index);
m_viewProps->setSorting(sorting);
- m_isDirty = true;
+ markAsDirty(true);
}
void ViewPropertiesDialog::slotSortOrderChanged(int index)
{
const Qt::SortOrder sortOrder = (index == 0) ? Qt::AscendingOrder : Qt::DescendingOrder;
m_viewProps->setSortOrder(sortOrder);
- m_isDirty = true;
+ markAsDirty(true);
}
void ViewPropertiesDialog::slotCategorizedSortingChanged()
{
m_viewProps->setCategorizedSorting(m_showInGroups->isChecked());
- m_isDirty = true;
+ markAsDirty(true);
}
void ViewPropertiesDialog::slotShowPreviewChanged()
{
const bool show = m_showPreview->isChecked();
m_viewProps->setShowPreview(show);
- m_isDirty = true;
+ markAsDirty(true);
}
void ViewPropertiesDialog::slotShowHiddenFilesChanged()
{
const bool show = m_showHiddenFiles->isChecked();
m_viewProps->setShowHiddenFiles(show);
- m_isDirty = true;
+ markAsDirty(true);
}
-void ViewPropertiesDialog::markAsDirty()
+void ViewPropertiesDialog::markAsDirty(bool isDirty)
{
- m_isDirty = true;
+ m_isDirty = isDirty;
+ enableButtonApply(isDirty);
}
void ViewPropertiesDialog::configureAdditionalInfo()
AdditionalInfoDialog dialog(this, info);
if (dialog.exec() == QDialog::Accepted) {
m_viewProps->setAdditionalInfo(dialog.additionalInfo());
- m_isDirty = true;
+ markAsDirty(true);
}
}
m_viewProps->save();
- m_isDirty = false;
+ markAsDirty(false);
}
void ViewPropertiesDialog::loadSettings()
m_showInGroups->setEnabled(index == DolphinView::IconsView); // only the icons view supports categorized sorting
m_showHiddenFiles->setChecked(m_viewProps->showHiddenFiles());
+ markAsDirty(false);
}
#include "viewpropertiesdialog.moc"