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

#include <dlg_bundle_manager.h>

+ Inheritance diagram for DlgBundleManager:

Classes

class  ItemDelegate
 

Public Slots

void done (int res) override
 
- Public Slots inherited from KoDialog
void delayedDestruct ()
 
void enableButton (ButtonCode id, bool state)
 
void enableButtonApply (bool state)
 
void enableButtonCancel (bool state)
 
void enableButtonOk (bool state)
 
void enableLinkedHelp (bool state)
 
bool isDetailsWidgetVisible () const
 
virtual void setCaption (const QString &caption)
 
virtual void setCaption (const QString &caption, bool modified)
 
void setDetailsWidget (QWidget *detailsWidget)
 
void setDetailsWidgetVisible (bool visible)
 
void setHelp (const QString &anchor, const QString &appname=QString())
 
void setHelpLinkText (const QString &text)
 
virtual void setPlainCaption (const QString &caption)
 

Public Member Functions

 DlgBundleManager (QWidget *parent=0)
 
- Public Member Functions inherited from KoDialog
QPushButton * button (ButtonCode id) const
 
QIcon buttonIcon (ButtonCode id) const
 
QString buttonText (ButtonCode id) const
 
QString buttonToolTip (ButtonCode id) const
 
QString buttonWhatsThis (ButtonCode id) const
 
ButtonCode defaultButton () const
 
QString helpLinkText () const
 
void incrementInitialSize (const QSize &size)
 
bool isButtonEnabled (ButtonCode id) const
 
 KoDialog (QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags())
 
QWidget * mainWidget ()
 
QSize minimumSizeHint () const override
 
void setButtonFocus (ButtonCode id)
 
void setButtonGuiItem (ButtonCode id, const KGuiItem &item)
 
void setButtonIcon (ButtonCode id, const QIcon &icon)
 
void setButtons (ButtonCodes buttonMask)
 
void setButtonsOrientation (Qt::Orientation orientation)
 
void setButtonText (ButtonCode id, const QString &text)
 
void setButtonToolTip (ButtonCode id, const QString &text)
 
void setButtonWhatsThis (ButtonCode id, const QString &text)
 
void setDefaultButton (ButtonCode id)
 
void setEscapeButton (ButtonCode id)
 
void setInitialSize (const QSize &size)
 
void setMainWidget (QWidget *widget)
 
void showButton (ButtonCode id, bool state)
 
void showButtonSeparator (bool state)
 
QSize sizeHint () const override
 
 ~KoDialog () override
 

Private Slots

void addBundle ()
 
void createBundle ()
 
void currentCellSelectedChanged (QModelIndex current, QModelIndex previous)
 
void editBundle ()
 
void slotModelAboutToBeReset ()
 
void slotModelReset ()
 
void slotRowsInserted (const QModelIndex &parent, int first, int last)
 
void slotRowsRemoved (const QModelIndex &parent, int first, int last)
 
void toggleBundle ()
 

Private Member Functions

void updateBundleInformation (QModelIndex idx)
 
void updateToggleButton (bool active)
 

Private Attributes

QPersistentModelIndex lastIndex
 
KisStorageFilterProxyModelm_proxyModel
 
WdgDlgBundleManagerm_ui
 

Additional Inherited Members

- Public Types inherited from KoDialog
enum  ButtonCode {
  None = 0x00000000 , Help = 0x00000001 , Default = 0x00000002 , Ok = 0x00000004 ,
  Apply = 0x00000008 , Try = 0x00000010 , Cancel = 0x00000020 , Close = 0x00000040 ,
  No = 0x00000080 , Yes = 0x00000100 , Reset = 0x00000200 , Details = 0x00000400 ,
  User1 = 0x00001000 , User2 = 0x00002000 , User3 = 0x00004000 , NoDefault = 0x00008000
}
 
enum  ButtonPopupMode { InstantPopup = 0 , DelayedPopup = 1 }
 
enum  CaptionFlag { NoCaptionFlags = 0 , AppNameCaption = 1 , ModifiedCaption = 2 , HIGCompliantCaption = AppNameCaption }
 
- Signals inherited from KoDialog
void aboutToShowDetails ()
 
void applyClicked ()
 
void buttonClicked (KoDialog::ButtonCode button)
 
void cancelClicked ()
 
void closeClicked ()
 
void defaultClicked ()
 
void finished ()
 
void helpClicked ()
 
void hidden ()
 
void layoutHintChanged ()
 
void noClicked ()
 
void okClicked ()
 
void resetClicked ()
 
void tryClicked ()
 
void user1Clicked ()
 
void user2Clicked ()
 
void user3Clicked ()
 
void yesClicked ()
 
- Static Public Member Functions inherited from KoDialog
static int groupSpacingHint ()
 
static QString makeStandardCaption (const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption)
 
static int marginHint ()
 
static void resizeLayout (QLayout *lay, int margin, int spacing)
 
static void resizeLayout (QWidget *widget, int margin, int spacing)
 
static int spacingHint ()
 
- Protected Slots inherited from KoDialog
virtual void slotButtonClicked (int button)
 
- Protected Member Functions inherited from KoDialog
void closeEvent (QCloseEvent *e) override
 
void hideEvent (QHideEvent *) override
 
void keyPressEvent (QKeyEvent *) override
 
void showEvent (QShowEvent *e) override
 

Detailed Description

Definition at line 33 of file dlg_bundle_manager.h.

Constructor & Destructor Documentation

◆ DlgBundleManager()

DlgBundleManager::DlgBundleManager ( QWidget * parent = 0)
explicit

Definition at line 129 of file dlg_bundle_manager.cpp.

130 : KoDialog(parent)
131{
132 setCaption(i18n("Manage Resource Libraries"));
133
134 m_ui = new WdgDlgBundleManager(this);
135 Q_CHECK_PTR(m_ui);
137
138 m_ui->bnAdd->setIcon(KisIconUtils::loadIcon("list-add"));
139 m_ui->bnAdd->setText(i18nc("In bundle manager; press button to import a resource library", "Import"));
140 connect(m_ui->bnAdd, SIGNAL(clicked(bool)), SLOT(addBundle()));
141
142 m_ui->bnToggle->setIcon(KisIconUtils::loadIcon("edit-delete"));
143 m_ui->bnToggle->setText(i18nc("In bundle manager; press button to deactivate the resource library"
144 "(remove resources from the resource library from the available resources)", "Deactivate"));
145 connect(m_ui->bnToggle, SIGNAL(clicked(bool)), SLOT(toggleBundle()));
146
147 m_ui->bnNew->setIcon(KisIconUtils::loadIcon("document-new"));
148 m_ui->bnNew->setText(i18nc("In bundle manager; press button to create a new bundle", "Create Bundle"));
149 connect(m_ui->bnNew, SIGNAL(clicked(bool)), SLOT(createBundle()));
150
151 m_ui->bnEdit->setIcon(KisIconUtils::loadIcon("document-new"));
152 m_ui->bnEdit->setText(i18nc("In bundle manager; press button to edit existing bundle", "Edit Bundle"));
153 connect(m_ui->bnEdit, SIGNAL(clicked(bool)), SLOT(editBundle()));
154
156
158 m_proxyModel->setSourceModel(KisStorageModel::instance());
164
165 m_ui->listView->setModel(m_proxyModel);
166 m_ui->listView->setItemDelegate(new ItemDelegate(this, m_proxyModel));
167 QScroller *scroller = KisKineticScroller::createPreconfiguredScroller(m_ui->listView);
168 if (scroller) {
169 connect(scroller, &QScroller::stateChanged, this, [&](QScroller::State state) {
171 });
172 }
173
174 QItemSelectionModel* selectionModel = m_ui->listView->selectionModel();
175 connect(selectionModel, &QItemSelectionModel::currentChanged, this, &DlgBundleManager::currentCellSelectedChanged);
176
177 connect(KisStorageModel::instance(), &KisStorageModel::modelAboutToBeReset, this, &DlgBundleManager::slotModelAboutToBeReset);
178 connect(KisStorageModel::instance(), &KisStorageModel::modelReset, this, &DlgBundleManager::slotModelReset);
179 connect(KisStorageModel::instance(), &KisStorageModel::rowsRemoved, this, &DlgBundleManager::slotRowsRemoved);
180 connect(KisStorageModel::instance(), &KisStorageModel::rowsInserted, this, &DlgBundleManager::slotRowsInserted);
181
182 updateToggleButton(m_proxyModel->data(m_ui->listView->currentIndex(), Qt::UserRole + KisStorageModel::Active).toBool());
183}
QList< QString > QStringList
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void slotRowsRemoved(const QModelIndex &parent, int first, int last)
WdgDlgBundleManager * m_ui
KisStorageFilterProxyModel * m_proxyModel
void currentCellSelectedChanged(QModelIndex current, QModelIndex previous)
void updateToggleButton(bool active)
void slotRowsInserted(const QModelIndex &parent, int first, int last)
static QString storageTypeToUntranslatedString(StorageType storageType)
@ ByStorageType
Pass a string list of storage types.
void setFilter(FilterType filterType, QVariant filter)
static KisStorageModel * instance()
void setMainWidget(QWidget *widget)
Definition KoDialog.cpp:354
virtual void setCaption(const QString &caption)
Definition KoDialog.cpp:498
void setButtons(ButtonCodes buttonMask)
Definition KoDialog.cpp:195
@ Close
Show Close-button. (this button closes the dialog)
Definition KoDialog.h:131
KoDialog(QWidget *parent=0, Qt::WindowFlags f=Qt::WindowFlags())
Definition KoDialog.cpp:176
QIcon loadIcon(const QString &name)
KRITAWIDGETUTILS_EXPORT void updateCursor(QWidget *source, QScroller::State state)
KRITAWIDGETUTILS_EXPORT QScroller * createPreconfiguredScroller(QAbstractScrollArea *target)

References KisStorageModel::Active, addBundle(), KisResourceStorage::AdobeBrushLibrary, KisResourceStorage::AdobeStyleLibrary, KisResourceStorage::Bundle, KisStorageFilterProxyModel::ByStorageType, KoDialog::Close, connect(), createBundle(), KisKineticScroller::createPreconfiguredScroller(), currentCellSelectedChanged(), editBundle(), KisStorageModel::instance(), KisIconUtils::loadIcon(), m_proxyModel, m_ui, KoDialog::setButtons(), KoDialog::setCaption(), KisStorageFilterProxyModel::setFilter(), KoDialog::setMainWidget(), slotModelAboutToBeReset(), slotModelReset(), slotRowsInserted(), slotRowsRemoved(), KisResourceStorage::storageTypeToUntranslatedString(), toggleBundle(), KisKineticScroller::updateCursor(), and updateToggleButton().

Member Function Documentation

◆ addBundle

void DlgBundleManager::addBundle ( )
privateslot

Definition at line 207 of file dlg_bundle_manager.cpp.

208{
209 KoFileDialog dlg(this, KoFileDialog::OpenFiles, i18n("Choose the resource library to import"));
210 dlg.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
211 dlg.setMimeTypeFilters(
212 {"application/x-krita-bundle", "image/x-adobe-brushlibrary", "application/x-photoshop-style-library"});
213 dlg.setCaption(i18n("Select the bundle"));
214
215 Q_FOREACH(const QString &filename, dlg.filenames()) {
216 if (!filename.isEmpty()) {
217 KisCursorOverrideLock cursorLock(Qt::BusyCursor);
218
219 // 0. Validate bundle
220 {
222 KIS_ASSERT(!storage.isNull());
223
224 if (!storage->valid()) {
225 cursorLock.unlock();
226 qWarning() << "Attempted to import an invalid bundle!" << filename;
227 QMessageBox::warning(this,
228 i18nc("@title:window", "Krita"),
229 i18n("Could not load bundle %1.", filename));
230 continue;
231 }
232 }
233
234 // 1. Copy the bundle to the resource folder
235 QFileInfo oldFileInfo(filename);
236
237 QString newDir = KoResourcePaths::getAppDataLocation();
238 QString newName = oldFileInfo.fileName();
239 const QString newLocation = QStringLiteral("%1/%2").arg(newDir, newName);
240
241 QFileInfo newFileInfo(newLocation);
242 if (newFileInfo.exists()) {
243 cursorLock.unlock();
244 if (QMessageBox::warning(
245 this,
246 i18nc("@title:window", "Warning"),
247 i18n("There is already a bundle with this name installed. Do you want to overwrite it?"),
248 QMessageBox::Ok | QMessageBox::Cancel)
249 == QMessageBox::Cancel) {
250 continue;
251 } else {
252 QFile::remove(newLocation);
253 }
254 cursorLock.lock();
255 }
256 QFile::copy(filename, newLocation);
257
258 // 2. Add the bundle as a storage/update database
260 KIS_ASSERT(!storage.isNull());
261 if (!KisResourceLocator::instance()->addStorage(newLocation, storage)) {
262 qWarning() << "Could not add bundle to the storages" << newLocation;
263 }
264 }
265 }
266}
static KisResourceLocator * instance()
static QString getAppDataLocation()
#define KIS_ASSERT(cond)
Definition kis_assert.h:33

References KoFileDialog::filenames(), KoResourcePaths::getAppDataLocation(), KisResourceLocator::instance(), KIS_ASSERT, KoFileDialog::OpenFiles, KoFileDialog::setCaption(), KoFileDialog::setDefaultDir(), and KoFileDialog::setMimeTypeFilters().

◆ createBundle

void DlgBundleManager::createBundle ( )
privateslot

Definition at line 268 of file dlg_bundle_manager.cpp.

269{
270 DlgCreateBundle* dlg = new DlgCreateBundle(0, this);
271 dlg->exec();
272}

◆ currentCellSelectedChanged

void DlgBundleManager::currentCellSelectedChanged ( QModelIndex current,
QModelIndex previous )
privateslot

Definition at line 393 of file dlg_bundle_manager.cpp.

394{
395 Q_UNUSED(previous);
397 if (!current.isValid()) {
398 ENTER_FUNCTION() << "Index is invalid\n";
399 return;
400 }
401 bool active = m_proxyModel->data(current, Qt::UserRole + KisStorageModel::Active).toBool();
402 updateToggleButton(active);
404}
void updateBundleInformation(QModelIndex idx)
#define ENTER_FUNCTION()
Definition kis_debug.h:178

References KisStorageModel::Active, ENTER_FUNCTION, KIS_ASSERT, m_proxyModel, updateBundleInformation(), and updateToggleButton().

◆ done

void DlgBundleManager::done ( int res)
overrideslot

Definition at line 185 of file dlg_bundle_manager.cpp.

186{
188 if (mw) {
189 QString warning;
190 if (!mw->checkActiveBundlesAvailable()) {
191 warning = i18n("You don't have any resource bundles enabled.");
192 }
193
194 if (!mw->checkPaintOpAvailable()) {
195 warning += i18n("\nThere are no brush presets available. Please enable a bundle that has presets before continuing.\nIf there are no bundles, please import a bundle before continuing.");
196 QMessageBox::critical(this, i18nc("@title:window", "Krita"), warning);
197 return;
198 }
199
200 if (!mw->checkActiveBundlesAvailable()) {
201 QMessageBox::warning(this, i18nc("@title:window", "Krita"), warning + i18n("\nOnly your local resources are available."));
202 }
203 }
204 KoDialog::done(res);
205}
Main window for Krita.
bool checkPaintOpAvailable()
bool checkActiveBundlesAvailable()
checkActiveStorages checks whether there is at least one bundle available and at least one paintop pr...
static KisPart * instance()
Definition KisPart.cpp:131
KisMainWindow * currentMainwindow() const
Definition KisPart.cpp:483

References KisMainWindow::checkActiveBundlesAvailable(), KisMainWindow::checkPaintOpAvailable(), KisPart::currentMainwindow(), and KisPart::instance().

◆ editBundle

void DlgBundleManager::editBundle ( )
privateslot

Definition at line 274 of file dlg_bundle_manager.cpp.

275{
276 KoFileDialog dlg(this, KoFileDialog::OpenFiles, i18n("Choose the bundle to edit"));
277 dlg.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
278 dlg.setMimeTypeFilters(
279 {"application/x-krita-bundle", "image/x-adobe-brushlibrary", "application/x-photoshop-style-library"});
280 dlg.setCaption(i18n("Select the bundle"));
281
282
283 Q_FOREACH(const QString &filename, dlg.filenames()) {
284 if (!filename.isEmpty()) {
285
286 {
288 KIS_ASSERT(!storage.isNull());
289
290 if (!storage->valid()) {
291 qApp->restoreOverrideCursor();
292 qWarning() << "Attempted to edit an invalid bundle!" << filename;
293 QMessageBox::warning(this,
294 i18nc("@title:window", "Krita"),
295 i18n("Could not load bundle %1.", filename));
296 qApp->setOverrideCursor(Qt::BusyCursor);
297 continue;
298 }
299 }
300
302 if (storage.isNull()){continue;}
303 if (storage->valid()) {
304 if (!KisResourceLocator::instance()->hasStorage(filename)) {
305 if (!KisResourceLocator::instance()->addStorage(filename, storage)) {
306 qWarning() << "Could not add bundle to the storages" << filename;
307 }
308 }
309
310 KoResourceBundle *bundle = new KoResourceBundle(filename);
311 bool importedBundle = bundle->load();
312
313 KoResourceBundleSP bundleSP(bundle);
314 DlgCreateBundle* dlgBC = new DlgCreateBundle(bundleSP, this);
315 int response = dlgBC->exec();
316 }
317 }
318 }
319}
A KoResourceBundle is a zip file that contains resources, some metadata about the creator of the bund...
bool load()
load : Load this resource.

References KoFileDialog::filenames(), KisResourceLocator::instance(), KIS_ASSERT, KoResourceBundle::load(), KoFileDialog::OpenFiles, KoFileDialog::setCaption(), KoFileDialog::setDefaultDir(), and KoFileDialog::setMimeTypeFilters().

◆ slotModelAboutToBeReset

void DlgBundleManager::slotModelAboutToBeReset ( )
privateslot

Definition at line 365 of file dlg_bundle_manager.cpp.

366{
368 lastIndex = QPersistentModelIndex(m_proxyModel->mapToSource(m_ui->listView->currentIndex()));
369 ENTER_FUNCTION() << ppVar(lastIndex) << ppVar(lastIndex.isValid());
370}
QPersistentModelIndex lastIndex
#define ppVar(var)
Definition kis_debug.h:155

References ENTER_FUNCTION, lastIndex, m_proxyModel, m_ui, and ppVar.

◆ slotModelReset

void DlgBundleManager::slotModelReset ( )
privateslot

Definition at line 382 of file dlg_bundle_manager.cpp.

383{
385 ENTER_FUNCTION() << ppVar(lastIndex) << ppVar(lastIndex.isValid());
386 if (lastIndex.isValid()) {
387 ENTER_FUNCTION() << "last index valid!";
388 m_ui->listView->setCurrentIndex(m_proxyModel->mapToSource(lastIndex));
389 }
390 lastIndex = QModelIndex();
391}

References ENTER_FUNCTION, lastIndex, m_proxyModel, m_ui, and ppVar.

◆ slotRowsInserted

void DlgBundleManager::slotRowsInserted ( const QModelIndex & parent,
int first,
int last )
privateslot

Definition at line 377 of file dlg_bundle_manager.cpp.

378{
379 m_proxyModel->insertRows(start, end - start + 1, parent);
380}

References m_proxyModel.

◆ slotRowsRemoved

void DlgBundleManager::slotRowsRemoved ( const QModelIndex & parent,
int first,
int last )
privateslot

Definition at line 372 of file dlg_bundle_manager.cpp.

373{
374 m_proxyModel->removeRows(start, end - start + 1, parent);
375}

References m_proxyModel.

◆ toggleBundle

void DlgBundleManager::toggleBundle ( )
privateslot

Definition at line 321 of file dlg_bundle_manager.cpp.

322{
323 QModelIndex idx = m_ui->listView->currentIndex();
325
326 if (!idx.isValid()) {
327 ENTER_FUNCTION() << "Index is invalid\n";
328 return;
329 }
330
331 bool active = m_proxyModel->data(idx, Qt::UserRole + KisStorageModel::Active).toBool();
332 idx = m_proxyModel->index(idx.row(), 0);
333 m_proxyModel->setData(idx, QVariant(!active), Qt::CheckStateRole);
334
335 if (active) {
336 m_ui->bnEdit->setEnabled(false);
337 } else {
338 m_ui->bnEdit->setEnabled(true);
339 }
340
342
344 if (mw) {
345 QString warning;
346 if (!mw->checkActiveBundlesAvailable()) {
347 warning = i18n("You don't have any resource bundles enabled.");
348 }
349
350 if (!mw->checkPaintOpAvailable()) {
351 button(KoDialog::Close)->setEnabled(false);
352
353 warning += i18n("\nThere are no brush presets available. Please enable a bundle that has presets before continuing.\nIf there are no bundles, please import a bundle before continuing.");
354 QMessageBox::critical(this, i18nc("@title:window", "Krita"), warning);
355 return;
356 }
357
358 if (!mw->checkActiveBundlesAvailable()) {
359 QMessageBox::warning(this, i18nc("@title:window", "Krita"), warning + i18n("\nOnly your local resources are available."));
360 }
361 }
362 button(KoDialog::Close)->setEnabled(true);
363}
QPushButton * button(ButtonCode id) const
Definition KoDialog.cpp:591

References KisStorageModel::Active, KoDialog::button(), KisMainWindow::checkActiveBundlesAvailable(), KisMainWindow::checkPaintOpAvailable(), KoDialog::Close, currentCellSelectedChanged(), KisPart::currentMainwindow(), ENTER_FUNCTION, KisPart::instance(), KIS_ASSERT, m_proxyModel, and m_ui.

◆ updateBundleInformation()

void DlgBundleManager::updateBundleInformation ( QModelIndex idx)
private

Definition at line 421 of file dlg_bundle_manager.cpp.

422{
425
426 m_ui->detailsPanel->hide();
427 m_ui->lblDescription->hide();
428
429 m_ui->BundleSelectedGroupBox->setTitle(storage->name());
430
431 if (storage->type() == KisResourceStorage::StorageType::Bundle) {
432
433 m_ui->detailsPanel->show();
434 m_ui->lblDescription->show();
435
436 m_ui->lblAuthor->setText(storage->metaData(KisResourceStorage::s_meta_author).toString());
437 QString date = storage->metaData(KisResourceStorage::s_meta_creation_date).toString();
438 m_ui->lblCreated->setText(date);
439 QString date2 = storage->metaData(KisResourceStorage::s_meta_dc_date).toString();
440 m_ui->lblUpdated->setText(date2);
441
442 m_ui->lblDescription->setPlainText(storage->metaData(KisResourceStorage::s_meta_description).toString());
443 m_ui->lblEmail->setText(storage->metaData(KisResourceStorage::s_meta_email).toString());
444 m_ui->lblLicense->setText(storage->metaData(KisResourceStorage::s_meta_license).toString());
445 m_ui->lblWebsite->setText(storage->metaData(KisResourceStorage::s_meta_website).toString());
446
447
448 }
449
450 QImage thumbnail = KisStorageModel::instance()->data(m_proxyModel->mapToSource(idx), Qt::UserRole + KisStorageModel::Thumbnail).value<QImage>();
451 m_ui->lblPreview->setPixmap(QPixmap::fromImage(thumbnail));
452 m_ui->lblType->setText(KisResourceStorage::storageTypeToString(storage->type()));
453}
static const QString s_meta_author
static const QString s_meta_creation_date
static const QString s_meta_email
static QString storageTypeToString(StorageType storageType)
static const QString s_meta_license
static const QString s_meta_description
static const QString s_meta_dc_date
static const QString s_meta_website
KisResourceStorageSP storageForIndex(QModelIndex index=QModelIndex()) const
QVariant data(const QModelIndex &index, int role) const override
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128

References KisResourceStorage::Bundle, KisStorageModel::data(), KisStorageModel::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_proxyModel, m_ui, KisResourceStorage::s_meta_author, KisResourceStorage::s_meta_creation_date, KisResourceStorage::s_meta_dc_date, KisResourceStorage::s_meta_description, KisResourceStorage::s_meta_email, KisResourceStorage::s_meta_license, KisResourceStorage::s_meta_website, KisStorageFilterProxyModel::storageForIndex(), KisResourceStorage::storageTypeToString(), and KisStorageModel::Thumbnail.

◆ updateToggleButton()

void DlgBundleManager::updateToggleButton ( bool active)
private

Definition at line 406 of file dlg_bundle_manager.cpp.

407{
408 if (active) {
409 m_ui->bnToggle->setIcon(KisIconUtils::loadIcon("edit-delete"));
410 m_ui->bnToggle->setText(i18nc("In bundle manager; press button to deactivate the bundle "
411 "(remove resources from the bundle from the available resources)","Deactivate"));
412 m_ui->bnEdit->setEnabled(true);
413 } else {
414 m_ui->bnToggle->setIcon(QIcon());
415 m_ui->bnToggle->setText(i18nc("In bundle manager; press button to activate the bundle "
416 "(add resources from the bundle to the available resources)","Activate"));
417 m_ui->bnEdit->setEnabled(false);
418 }
419}

References KisIconUtils::loadIcon(), and m_ui.

Member Data Documentation

◆ lastIndex

QPersistentModelIndex DlgBundleManager::lastIndex
private

Definition at line 76 of file dlg_bundle_manager.h.

◆ m_proxyModel

KisStorageFilterProxyModel* DlgBundleManager::m_proxyModel
private

Definition at line 77 of file dlg_bundle_manager.h.

◆ m_ui

WdgDlgBundleManager* DlgBundleManager::m_ui
private

Definition at line 75 of file dlg_bundle_manager.h.


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