Krita Source Code Documentation
Loading...
Searching...
No Matches
KisBookmarkedConfigurationsEditor Class Reference

#include <kis_bookmarked_configurations_editor.h>

+ Inheritance diagram for KisBookmarkedConfigurationsEditor:

Classes

struct  Private
 

Public Member Functions

 KisBookmarkedConfigurationsEditor (QWidget *parent, KisBookmarkedConfigurationsModel *manager, const KisSerializableConfigurationSP currentConfig)
 
 ~KisBookmarkedConfigurationsEditor () override
 

Private Slots

void addCurrentConfiguration ()
 
void currentConfigChanged (const QItemSelection &selected, const QItemSelection &)
 
void deleteConfiguration ()
 

Private Attributes

Private *const d
 

Detailed Description

This dialog is used to edit the content of a bookmark manager

Definition at line 21 of file kis_bookmarked_configurations_editor.h.

Constructor & Destructor Documentation

◆ KisBookmarkedConfigurationsEditor()

KisBookmarkedConfigurationsEditor::KisBookmarkedConfigurationsEditor ( QWidget * parent,
KisBookmarkedConfigurationsModel * manager,
const KisSerializableConfigurationSP currentConfig )
Parameters
parent
managerthe model representing the bookmark manager
currentConfigis used if the user choose to create a new configuration entry or to replace an existing entry

Definition at line 19 of file kis_bookmarked_configurations_editor.cc.

19 : QDialog(parent), d(new Private)
20{
21 d->editorUi.setupUi(this);
22 d->model = model;
23 d->currentConfig = currentConfig;
24 d->editorUi.listConfigurations->setModel(d->model);
25 connect(d->editorUi.pushButtonClose, SIGNAL(pressed()), SLOT(accept()));
26
27 connect(d->editorUi.listConfigurations->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
28 this, SLOT(currentConfigChanged(QItemSelection,QItemSelection)));
29 currentConfigChanged(d->editorUi.listConfigurations->selectionModel()->selection(),
30 d->editorUi.listConfigurations->selectionModel()->selection());
31
32 connect(d->editorUi.pushButtonDelete, SIGNAL(pressed()), SLOT(deleteConfiguration()));
33 connect(d->editorUi.pushButtonBookmarkCurrent, SIGNAL(pressed()), SLOT(addCurrentConfiguration()));
34
35 if (!d->currentConfig) {
36 d->editorUi.pushButtonBookmarkCurrent->setEnabled(false);
37 }
38}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void currentConfigChanged(const QItemSelection &selected, const QItemSelection &)

References addCurrentConfiguration(), connect(), KisBookmarkedConfigurationsEditor::Private::currentConfig, currentConfigChanged(), d, deleteConfiguration(), KisBookmarkedConfigurationsEditor::Private::editorUi, and KisBookmarkedConfigurationsEditor::Private::model.

◆ ~KisBookmarkedConfigurationsEditor()

KisBookmarkedConfigurationsEditor::~KisBookmarkedConfigurationsEditor ( )
override

Definition at line 40 of file kis_bookmarked_configurations_editor.cc.

41{
42 delete d;
43}

References d.

Member Function Documentation

◆ addCurrentConfiguration

void KisBookmarkedConfigurationsEditor::addCurrentConfiguration ( )
privateslot

Definition at line 54 of file kis_bookmarked_configurations_editor.cc.

55{
56 if (d->model) {
57 d->model->newConfiguration(ki18n("New configuration %1"), d->currentConfig);
58 }
59}
virtual void newConfiguration(KLocalizedString baseName, const KisSerializableConfigurationSP config)

References KisBookmarkedConfigurationsEditor::Private::currentConfig, d, KisBookmarkedConfigurationsEditor::Private::model, and KisBookmarkedConfigurationsModel::newConfiguration().

◆ currentConfigChanged

void KisBookmarkedConfigurationsEditor::currentConfigChanged ( const QItemSelection & selected,
const QItemSelection &  )
privateslot

Definition at line 45 of file kis_bookmarked_configurations_editor.cc.

46{
47 if (d->model) {
48 d->editorUi.pushButtonDelete->setEnabled(!(selected.indexes().isEmpty()) ?
49 d->model->isIndexDeletable(selected.indexes().first()) :
50 false);
51 }
52}
virtual bool isIndexDeletable(const QModelIndex &index) const

References d, KisBookmarkedConfigurationsEditor::Private::editorUi, KisBookmarkedConfigurationsModel::isIndexDeletable(), and KisBookmarkedConfigurationsEditor::Private::model.

◆ deleteConfiguration

void KisBookmarkedConfigurationsEditor::deleteConfiguration ( )
privateslot

Member Data Documentation

◆ d

Private* const KisBookmarkedConfigurationsEditor::d
private

Definition at line 39 of file kis_bookmarked_configurations_editor.h.


The documentation for this class was generated from the following files: