[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/krita/plugins/extensions/rotateimage
From: Cyrille Berger <cyb () lepi ! org>
Date: 2009-08-31 20:24:59
Message-ID: 1251750299.164924.12086.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1017896 by berger:
Disable scaling menu on vector layer.
BUG:205635
M +23 -13 rotateimage.cc
M +6 -0 rotateimage.h
--- trunk/koffice/krita/plugins/extensions/rotateimage/rotateimage.cc \
#1017895:1017896 @@ -46,8 +46,8 @@
#include <kis_selection.h>
#include <kis_image_manager.h>
#include <kis_layer_manager.h>
+#include <kis_canvas_resource_provider.h>
-
#include "dlg_rotateimage.h"
typedef KGenericFactory<RotateImage> RotateImageFactory;
@@ -80,21 +80,23 @@
actionCollection()->addAction("rotateImageCCW90", action);
connect(action, SIGNAL(triggered()), this, SLOT(slotRotateImage270()));
- action = new KAction(i18n("&Rotate Layer..."), this);
- actionCollection()->addAction("rotatelayer", action);
- connect(action, SIGNAL(triggered()), this, SLOT(slotRotateLayer()));
+ m_rotateLayerAction = new KAction(i18n("&Rotate Layer..."), this);
+ actionCollection()->addAction("rotatelayer", m_rotateLayerAction);
+ connect(m_rotateLayerAction, SIGNAL(triggered()), this, \
SLOT(slotRotateLayer()));
- action = new KAction(i18nc("rotate the layer 180 degrees", "1&80 °"), \
this);
- actionCollection()->addAction("rotateLayer180", action);
- connect(action, SIGNAL(triggered()), m_view->layerManager(), \
SLOT(rotateLayer180())); + m_rotate90LayerAction = new KAction(i18nc("rotate \
the layer 180 degrees", "1&80 °"), this); + \
actionCollection()->addAction("rotateLayer180", m_rotate90LayerAction); + \
connect(m_rotate90LayerAction, SIGNAL(triggered()), m_view->layerManager(), \
SLOT(rotateLayer180()));
- action = new KAction(KIcon("object-rotate-right"), i18nc("rotate the layer \
90 degrees to the right", "Right 90 °"), this);
- actionCollection()->addAction("rotateLayerCW90", action);
- connect(action, SIGNAL(triggered()), m_view->layerManager(), \
SLOT(rotateLayerRight90())); + m_rotate180LayerAction = new \
KAction(KIcon("object-rotate-right"), i18nc("rotate the layer 90 degrees to the \
right", "Right 90 °"), this); + \
actionCollection()->addAction("rotateLayerCW90", m_rotate180LayerAction); + \
connect(m_rotate180LayerAction, SIGNAL(triggered()), m_view->layerManager(), \
SLOT(rotateLayerRight90()));
- action = new KAction(KIcon("object-rotate-left"), i18nc("rotate the layer \
90 degrees to the left", "Left 90 °"), this);
- actionCollection()->addAction("rotateLayerCCW90", action);
- connect(action, SIGNAL(triggered()), m_view->layerManager(), \
SLOT(rotateLayerLeft90())); + m_rotate270LayerAction = new \
KAction(KIcon("object-rotate-left"), i18nc("rotate the layer 90 degrees to the left", \
"Left 90 °"), this); + actionCollection()->addAction("rotateLayerCCW90", \
m_rotate270LayerAction); + connect(m_rotate270LayerAction, \
SIGNAL(triggered()), m_view->layerManager(), SLOT(rotateLayerLeft90())); +
+ connect(m_view->resourceProvider(), SIGNAL(sigNodeChanged(const KisNodeSP)), \
SLOT(slotNodeChanged(KisNodeSP))); }
}
@@ -156,4 +158,12 @@
delete dlgRotateImage;
}
+void RotateImage::slotNodeChanged(const KisNodeSP node)
+{
+ m_rotateLayerAction->setEnabled( m_view->activeDevice());
+ m_rotate90LayerAction->setEnabled( m_view->activeDevice());
+ m_rotate180LayerAction->setEnabled( m_view->activeDevice());
+ m_rotate270LayerAction->setEnabled( m_view->activeDevice());
+}
+
#include "rotateimage.moc"
--- trunk/koffice/krita/plugins/extensions/rotateimage/rotateimage.h #1017895:1017896
@@ -21,6 +21,7 @@
#define ROTATEIMAGE_H
#include <kparts/plugin.h>
+#include "kis_types.h"
class KisView2;
class KisPainter;
@@ -38,11 +39,16 @@
void slotRotateImage180();
void slotRotateImage270();
void slotRotateLayer();
+ void slotNodeChanged(const KisNodeSP);
private:
KisView2 * m_view;
KisPainter * m_painter;
+ KAction* m_rotateLayerAction;
+ KAction* m_rotate90LayerAction;
+ KAction* m_rotate180LayerAction;
+ KAction* m_rotate270LayerAction;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic