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 133 of file dlg_bundle_manager.cpp.

134 : KoDialog(parent)
135{
136 setCaption(i18n("Manage Resource Libraries"));
137
138 m_ui = new WdgDlgBundleManager(this);
139 Q_CHECK_PTR(m_ui);
141
142 m_ui->bnAdd->setIcon(KisIconUtils::loadIcon("list-add"));
143 m_ui->bnAdd->setText(i18nc("In bundle manager; press button to import a resource library", "Import"));
144 connect(m_ui->bnAdd, SIGNAL(clicked(bool)), SLOT(addBundle()));
145
146 m_ui->bnToggle->setIcon(KisIconUtils::loadIcon("edit-delete"));
147 m_ui->bnToggle->setText(i18nc("In bundle manager; press button to deactivate the resource library"
148 "(remove resources from the resource library from the available resources)", "Deactivate"));
149 connect(m_ui->bnToggle, SIGNAL(clicked(bool)), SLOT(toggleBundle()));
150
151 m_ui->bnNew->setIcon(KisIconUtils::loadIcon("document-new"));
152 m_ui->bnNew->setText(i18nc("In bundle manager; press button to create a new bundle", "Create Bundle"));
153 connect(m_ui->bnNew, SIGNAL(clicked(bool)), SLOT(createBundle()));
154
155 m_ui->bnEdit->setIcon(KisIconUtils::loadIcon("document-new"));
156 m_ui->bnEdit->setText(i18nc("In bundle manager; press button to edit existing bundle", "Edit Bundle"));
157 connect(m_ui->bnEdit, SIGNAL(clicked(bool)), SLOT(editBundle()));
158
159#ifdef Q_OS_ANDROID
160 connect(m_ui->bnSupport, &QPushButton::clicked, this, &DlgBundleManager::slotShowSupporterBundlesDialog);
161#else
162 m_ui->bnSupport->hide();
163#endif
164
166
168 m_proxyModel->setSourceModel(KisStorageModel::instance());
174
175 m_ui->listView->setModel(m_proxyModel);
176 m_ui->listView->setItemDelegate(new ItemDelegate(this, m_proxyModel));
177 QScroller *scroller = KisKineticScroller::createPreconfiguredScroller(m_ui->listView);
178 if (scroller) {
179 connect(scroller, &QScroller::stateChanged, this, [&](QScroller::State state) {
181 });
182 }
183
184 QItemSelectionModel* selectionModel = m_ui->listView->selectionModel();
185 connect(selectionModel, &QItemSelectionModel::currentChanged, this, &DlgBundleManager::currentCellSelectedChanged);
186
187 connect(KisStorageModel::instance(), &KisStorageModel::modelAboutToBeReset, this, &DlgBundleManager::slotModelAboutToBeReset);
188 connect(KisStorageModel::instance(), &KisStorageModel::modelReset, this, &DlgBundleManager::slotModelReset);
189 connect(KisStorageModel::instance(), &KisStorageModel::rowsRemoved, this, &DlgBundleManager::slotRowsRemoved);
190 connect(KisStorageModel::instance(), &KisStorageModel::rowsInserted, this, &DlgBundleManager::slotRowsInserted);
191
192 updateToggleButton(m_proxyModel->data(m_ui->listView->currentIndex(), Qt::UserRole + KisStorageModel::Active).toBool());
193}
QList< QString > QStringList
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:345
virtual void setCaption(const QString &caption)
Definition KoDialog.cpp:489
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, 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 217 of file dlg_bundle_manager.cpp.

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

279{
280 DlgCreateBundle* dlg = new DlgCreateBundle(0, this);
281 dlg->exec();
282}

◆ currentCellSelectedChanged

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

Definition at line 411 of file dlg_bundle_manager.cpp.

412{
413 Q_UNUSED(previous);
415 if (!current.isValid()) {
416 ENTER_FUNCTION() << "Index is invalid\n";
417 return;
418 }
419 bool active = m_proxyModel->data(current, Qt::UserRole + KisStorageModel::Active).toBool();
420 updateToggleButton(active);
422}
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 195 of file dlg_bundle_manager.cpp.

196{
198 if (mw) {
199 QString warning;
200 if (!mw->checkActiveBundlesAvailable()) {
201 warning = i18n("You don't have any resource bundles enabled.");
202 }
203
204 if (!mw->checkPaintOpAvailable()) {
205 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.");
206 QMessageBox::critical(this, i18nc("@title:window", "Krita"), warning);
207 return;
208 }
209
210 if (!mw->checkActiveBundlesAvailable()) {
211 QMessageBox::warning(this, i18nc("@title:window", "Krita"), warning + i18n("\nOnly your local resources are available."));
212 }
213 }
214 KoDialog::done(res);
215}
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:459

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

◆ editBundle

void DlgBundleManager::editBundle ( )
privateslot

Definition at line 284 of file dlg_bundle_manager.cpp.

285{
286 KoFileDialog dlg(this, KoFileDialog::OpenFiles, i18n("Choose the bundle to edit"));
287 dlg.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation));
288 dlg.setMimeTypeFilters(
289 {"application/x-krita-bundle", "image/x-adobe-brushlibrary", "application/x-photoshop-style-library"});
290 dlg.setCaption(i18n("Select the bundle"));
291
292
293 Q_FOREACH(const QString &filename, dlg.filenames()) {
294 if (!filename.isEmpty()) {
295
296 {
298 KIS_ASSERT(!storage.isNull());
299
300 if (!storage->valid()) {
301 qApp->restoreOverrideCursor();
302 qWarning() << "Attempted to edit an invalid bundle!" << filename;
303 QMessageBox::warning(this,
304 i18nc("@title:window", "Krita"),
305 i18n("Could not load bundle %1.", filename));
306 qApp->setOverrideCursor(Qt::BusyCursor);
307 continue;
308 }
309 }
310
312 if (storage.isNull()){continue;}
313 if (storage->valid()) {
314 if (!KisResourceLocator::instance()->hasStorage(filename)) {
315 if (!KisResourceLocator::instance()->addStorage(filename, storage)) {
316 qWarning() << "Could not add bundle to the storages" << filename;
317 }
318 }
319
320 KoResourceBundle *bundle = new KoResourceBundle(filename);
321 bool importedBundle = bundle->load();
322
323 KoResourceBundleSP bundleSP(bundle);
324 DlgCreateBundle* dlgBC = new DlgCreateBundle(bundleSP, this);
325 int response = dlgBC->exec();
326 }
327 }
328 }
329}
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 383 of file dlg_bundle_manager.cpp.

384{
386 lastIndex = QPersistentModelIndex(m_proxyModel->mapToSource(m_ui->listView->currentIndex()));
387 ENTER_FUNCTION() << ppVar(lastIndex) << ppVar(lastIndex.isValid());
388}
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 400 of file dlg_bundle_manager.cpp.

401{
403 ENTER_FUNCTION() << ppVar(lastIndex) << ppVar(lastIndex.isValid());
404 if (lastIndex.isValid()) {
405 ENTER_FUNCTION() << "last index valid!";
406 m_ui->listView->setCurrentIndex(m_proxyModel->mapToSource(lastIndex));
407 }
408 lastIndex = QModelIndex();
409}

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 395 of file dlg_bundle_manager.cpp.

396{
397 m_proxyModel->insertRows(start, end - start + 1, parent);
398}

References m_proxyModel.

◆ slotRowsRemoved

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

Definition at line 390 of file dlg_bundle_manager.cpp.

391{
392 m_proxyModel->removeRows(start, end - start + 1, parent);
393}

References m_proxyModel.

◆ toggleBundle

void DlgBundleManager::toggleBundle ( )
privateslot

Definition at line 339 of file dlg_bundle_manager.cpp.

340{
341 QModelIndex idx = m_ui->listView->currentIndex();
343
344 if (!idx.isValid()) {
345 ENTER_FUNCTION() << "Index is invalid\n";
346 return;
347 }
348
349 bool active = m_proxyModel->data(idx, Qt::UserRole + KisStorageModel::Active).toBool();
350 idx = m_proxyModel->index(idx.row(), 0);
351 m_proxyModel->setData(idx, QVariant(!active), Qt::CheckStateRole);
352
353 if (active) {
354 m_ui->bnEdit->setEnabled(false);
355 } else {
356 m_ui->bnEdit->setEnabled(true);
357 }
358
360
362 if (mw) {
363 QString warning;
364 if (!mw->checkActiveBundlesAvailable()) {
365 warning = i18n("You don't have any resource bundles enabled.");
366 }
367
368 if (!mw->checkPaintOpAvailable()) {
369 button(KoDialog::Close)->setEnabled(false);
370
371 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.");
372 QMessageBox::critical(this, i18nc("@title:window", "Krita"), warning);
373 return;
374 }
375
376 if (!mw->checkActiveBundlesAvailable()) {
377 QMessageBox::warning(this, i18nc("@title:window", "Krita"), warning + i18n("\nOnly your local resources are available."));
378 }
379 }
380 button(KoDialog::Close)->setEnabled(true);
381}
QPushButton * button(ButtonCode id) const
Definition KoDialog.cpp:582

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 439 of file dlg_bundle_manager.cpp.

440{
443
444 m_ui->detailsPanel->hide();
445 m_ui->lblDescription->hide();
446
447 m_ui->BundleSelectedGroupBox->setTitle(storage->name());
448
449 if (storage->type() == KisResourceStorage::StorageType::Bundle) {
450
451 m_ui->detailsPanel->show();
452 m_ui->lblDescription->show();
453
454 m_ui->lblAuthor->setText(storage->metaData(KisResourceStorage::s_meta_author).toString());
455 QString date = storage->metaData(KisResourceStorage::s_meta_creation_date).toString();
456 m_ui->lblCreated->setText(date);
457 QString date2 = storage->metaData(KisResourceStorage::s_meta_dc_date).toString();
458 m_ui->lblUpdated->setText(date2);
459
460 m_ui->lblDescription->setPlainText(storage->metaData(KisResourceStorage::s_meta_description).toString());
461 m_ui->lblEmail->setText(storage->metaData(KisResourceStorage::s_meta_email).toString());
462 m_ui->lblLicense->setText(storage->metaData(KisResourceStorage::s_meta_license).toString());
463 m_ui->lblWebsite->setText(storage->metaData(KisResourceStorage::s_meta_website).toString());
464
465
466 }
467
468 QImage thumbnail = KisStorageModel::instance()->data(m_proxyModel->mapToSource(idx), Qt::UserRole + KisStorageModel::Thumbnail).value<QImage>();
469 m_ui->lblPreview->setPixmap(QPixmap::fromImage(thumbnail));
470 m_ui->lblType->setText(KisResourceStorage::storageTypeToString(storage->type()));
471}
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 424 of file dlg_bundle_manager.cpp.

425{
426 if (active) {
427 m_ui->bnToggle->setIcon(KisIconUtils::loadIcon("edit-delete"));
428 m_ui->bnToggle->setText(i18nc("In bundle manager; press button to deactivate the bundle "
429 "(remove resources from the bundle from the available resources)","Deactivate"));
430 m_ui->bnEdit->setEnabled(true);
431 } else {
432 m_ui->bnToggle->setIcon(QIcon());
433 m_ui->bnToggle->setText(i18nc("In bundle manager; press button to activate the bundle "
434 "(add resources from the bundle to the available resources)","Activate"));
435 m_ui->bnEdit->setEnabled(false);
436 }
437}

References KisIconUtils::loadIcon(), and m_ui.

Member Data Documentation

◆ lastIndex

QPersistentModelIndex DlgBundleManager::lastIndex
private

Definition at line 79 of file dlg_bundle_manager.h.

◆ m_proxyModel

KisStorageFilterProxyModel* DlgBundleManager::m_proxyModel
private

Definition at line 80 of file dlg_bundle_manager.h.

◆ m_ui

WdgDlgBundleManager* DlgBundleManager::m_ui
private

Definition at line 78 of file dlg_bundle_manager.h.


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