Commit ad998572 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remember the show-all setting for the preset chooser.

parent 8e844764
......@@ -693,6 +693,17 @@ void KisConfig::setPresetChooserViewMode(const int mode)
m_cfg.writeEntry("presetChooserViewMode", mode);
}
bool KisConfig::presetShowAllMode() const
{
return m_cfg.readEntry("presetChooserShowAllPresets", true);
}
void KisConfig::setPresetShowAllMode(bool showAll)
{
m_cfg.writeEntry("presetChooserShowAllPresets", showAll);
}
bool KisConfig::firstRun() const
{
return m_cfg.readEntry("firstRun", true);
......
......@@ -221,6 +221,9 @@ public:
int presetChooserViewMode() const;
void setPresetChooserViewMode(const int mode);
bool presetShowAllMode() const;
void setPresetShowAllMode(bool showAll);
bool firstRun() const;
void setFirstRun(const bool firstRun) const;
......
......@@ -40,12 +40,12 @@ KisPaintOpPresetsChooserPopup::KisPaintOpPresetsChooserPopup(QWidget * parent)
{
m_d->uiWdgPaintOpPresets.setupUi(this);
KMenu* menu = new KMenu(this);
QActionGroup *actionGroup = new QActionGroup(this);
KisPresetChooser::ViewMode mode = (KisPresetChooser::ViewMode)KisConfig().presetChooserViewMode();
bool showAll = KisConfig().presetShowAllMode();
QAction* action = menu->addAction(KIcon("view-preview"), i18n("Thumbnails"), this, SLOT(slotThumbnailMode()));
action->setCheckable(true);
action->setChecked(mode == KisPresetChooser::THUMBNAIL);
......@@ -55,13 +55,14 @@ KisPaintOpPresetsChooserPopup::KisPaintOpPresetsChooserPopup(QWidget * parent)
action->setCheckable(true);
action->setChecked(mode == KisPresetChooser::DETAIL);
action->setActionGroup(actionGroup);
m_d->uiWdgPaintOpPresets.viewModeButton->setIcon(KIcon("view-choose"));
m_d->uiWdgPaintOpPresets.viewModeButton->setMenu(menu);
m_d->uiWdgPaintOpPresets.viewModeButton->setPopupMode(QToolButton::InstantPopup);
m_d->uiWdgPaintOpPresets.wdgPresetChooser->setViewMode(mode);
m_d->uiWdgPaintOpPresets.wdgPresetChooser->showTaggingBar(false,true);
m_d->uiWdgPaintOpPresets.showAllCheckBox->setChecked(showAll);
connect(m_d->uiWdgPaintOpPresets.wdgPresetChooser, SIGNAL(resourceSelected(KoResource*)),
this, SIGNAL(resourceSelected(KoResource*)));
......@@ -81,6 +82,7 @@ KisPaintOpPresetsChooserPopup::KisPaintOpPresetsChooserPopup(QWidget * parent)
KisPaintOpPresetsChooserPopup::~KisPaintOpPresetsChooserPopup()
{
KisConfig().setPresetShowAllMode(m_d->uiWdgPaintOpPresets.showAllCheckBox->isChecked());
delete m_d;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment