Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/widgets/kis_paintop_presets_save.cpp
Context not available. | |||||
21 | #include <QDebug> | 21 | #include <QDebug> | ||
---|---|---|---|---|---|
22 | #include <QDate> | 22 | #include <QDate> | ||
23 | #include <QTime> | 23 | #include <QTime> | ||
24 | #include <QVBoxLayout> | ||||
25 | #include <QDialogButtonBox> | ||||
24 | 26 | | |||
25 | 27 | | |||
26 | #include <KoFileDialog.h> | 28 | #include <KoFileDialog.h> | ||
27 | #include "KisImportExportManager.h" | 29 | #include "KisImportExportManager.h" | ||
28 | #include "QDesktopServices" | 30 | #include "QDesktopServices" | ||
29 | #include "kis_resource_server_provider.h" | 31 | #include "kis_resource_server_provider.h" | ||
32 | #include <kis_paintop_preset_icon_library.h> | ||||
30 | 33 | | |||
31 | 34 | | |||
32 | KisPresetSaveWidget::KisPresetSaveWidget(QWidget * parent) | 35 | KisPresetSaveWidget::KisPresetSaveWidget(QWidget * parent) | ||
Context not available. | |||||
44 | 47 | | |||
45 | connect(loadScratchPadThumbnailButton, SIGNAL(clicked(bool)), this, SLOT(loadScratchpadThumbnail())); | 48 | connect(loadScratchPadThumbnailButton, SIGNAL(clicked(bool)), this, SLOT(loadScratchpadThumbnail())); | ||
46 | connect(loadExistingThumbnailButton, SIGNAL(clicked(bool)), this, SLOT(loadExistingThumbnail())); | 49 | connect(loadExistingThumbnailButton, SIGNAL(clicked(bool)), this, SLOT(loadExistingThumbnail())); | ||
50 | connect(loadIconLibraryThumbnailButton, SIGNAL(clicked(bool)), this, SLOT(loadImageFromLibrary())); | ||||
47 | 51 | | |||
48 | connect(savePresetButton, SIGNAL(clicked(bool)), this, SLOT(savePreset())); | 52 | connect(savePresetButton, SIGNAL(clicked(bool)), this, SLOT(savePreset())); | ||
49 | connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(close())); | 53 | connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(close())); | ||
Context not available. | |||||
126 | brushPresetThumbnailWidget->paintPresetImage(); | 130 | brushPresetThumbnailWidget->paintPresetImage(); | ||
127 | } | 131 | } | ||
128 | 132 | | |||
133 | void KisPresetSaveWidget::loadImageFromLibrary() | ||||
134 | { | ||||
135 | //add dialog code here. | ||||
136 | QDialog *dlg = new QDialog(this); | ||||
137 | dlg->setWindowTitle(i18n("Preset Icon Library")); | ||||
138 | QVBoxLayout *layout = new QVBoxLayout(); | ||||
139 | dlg->setLayout(layout); | ||||
140 | KisPaintopPresetIconLibrary *libWidget = new KisPaintopPresetIconLibrary(dlg); | ||||
141 | layout->addWidget(libWidget); | ||||
142 | QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, dlg); | ||||
143 | connect(buttons, SIGNAL(accepted()), dlg, SLOT(accept())); | ||||
144 | connect(buttons, SIGNAL(rejected()), dlg, SLOT(reject())); | ||||
145 | layout->addWidget(buttons); | ||||
146 | | ||||
147 | //if dialog accepted, get image. | ||||
148 | if (dlg->exec()==QDialog::Accepted) { | ||||
149 | | ||||
150 | QImage presetImage = libWidget->getImage(); | ||||
151 | brushPresetThumbnailWidget->paintCustomImage(presetImage); | ||||
152 | } | ||||
153 | } | ||||
154 | | ||||
129 | void KisPresetSaveWidget::setFavoriteResourceManager(KisFavoriteResourceManager * favManager) | 155 | void KisPresetSaveWidget::setFavoriteResourceManager(KisFavoriteResourceManager * favManager) | ||
130 | { | 156 | { | ||
131 | m_favoriteResourceManager = favManager; | 157 | m_favoriteResourceManager = favManager; | ||
Context not available. |