[PATCH 3/9] When selecting a saved preset, the name will be loaded in the edit field of the PaintOpSettings popup.
Silvio Heinrich
plassy at web.de
Sat Dec 25 21:50:04 CET 2010
---
krita/ui/kis_paintop_box.cc | 3 +++
krita/ui/widgets/kis_paintop_presets_popup.cpp | 5 +++++
krita/ui/widgets/kis_paintop_presets_popup.h | 3 ++-
3 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/krita/ui/kis_paintop_box.cc b/krita/ui/kis_paintop_box.cc
index 3cb6651..a200ef0 100644
--- a/krita/ui/kis_paintop_box.cc
+++ b/krita/ui/kis_paintop_box.cc
@@ -177,6 +177,9 @@ KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name
connect(m_resourceProvider, SIGNAL(sigNodeChanged(const KisNodeSP)),
this, SLOT(nodeChanged(const KisNodeSP)));
+
+ connect(m_presetsChooserPopup, SIGNAL(resourceSelected(KoResource*)),
+ m_presetsPopup, SLOT(resourceSelected(KoResource*)));
//Needed to connect canvas to favoriate resource manager
m_view->canvasBase()->createFavoriteResourceManager(this);
diff --git a/krita/ui/widgets/kis_paintop_presets_popup.cpp b/krita/ui/widgets/kis_paintop_presets_popup.cpp
index 6a41049..4d71b39 100644
--- a/krita/ui/widgets/kis_paintop_presets_popup.cpp
+++ b/krita/ui/widgets/kis_paintop_presets_popup.cpp
@@ -241,5 +241,10 @@ void KisPaintOpPresetsPopup::showScratchPad()
m_d->uiWdgPaintOpPresetSettings.scratchPad->setVisible(true);
}
+void KisPaintOpPresetsPopup::resourceSelected(KoResource* resource)
+{
+ m_d->uiWdgPaintOpPresetSettings.txtPreset->setText(resource->name());
+}
+
#include "kis_paintop_presets_popup.moc"
diff --git a/krita/ui/widgets/kis_paintop_presets_popup.h b/krita/ui/widgets/kis_paintop_presets_popup.h
index 71e00ac..49a242e 100644
--- a/krita/ui/widgets/kis_paintop_presets_popup.h
+++ b/krita/ui/widgets/kis_paintop_presets_popup.h
@@ -28,6 +28,7 @@ class QString;
class KisPaintOpPreset;
class KisPropertiesConfiguration;
class KisCanvasResourceProvider;
+class KoResource;
/**
* Popup widget for presets with built-in functionality
@@ -59,13 +60,13 @@ public:
QImage cutOutOverlay();
protected:
-
void contextMenuEvent(QContextMenuEvent *);
public slots:
void switchDetached();
void hideScratchPad();
void showScratchPad();
+ void resourceSelected(KoResource* resource);
signals:
void savePresetClicked();
--
1.7.1
More information about the kimageshop
mailing list