~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to krita/plugins/extensions/dockers/defaultdockers/kis_layer_box.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
#include <kmenu.h>
47
47
#include <kmessagebox.h>
48
48
#include <kpushbutton.h>
49
 
#include <kiconloader.h>
50
 
#include <kicontheme.h>
51
49
#include <klocale.h>
52
50
#include <khbox.h>
53
 
#include <kicon.h>
54
51
#include <kaction.h>
55
52
 
 
53
#include <KoIcon.h>
56
54
#include <KoDocumentSectionView.h>
57
55
#include <KoColorSpace.h>
58
56
#include <KoCompositeOp.h>
106
104
    QActionGroup *group = new QActionGroup(this);
107
105
    QList<QAction*> actions;
108
106
 
109
 
    actions << m_viewModeMenu->addAction(KIcon("view-list-text"),
 
107
    actions << m_viewModeMenu->addAction(koIcon("view-list-text"),
110
108
                                         i18n("Minimal View"), this, SLOT(slotMinimalView()));
111
 
    actions << m_viewModeMenu->addAction(KIcon("view-list-details"),
 
109
    actions << m_viewModeMenu->addAction(koIcon("view-list-details"),
112
110
                                         i18n("Detailed View"), this, SLOT(slotDetailedView()));
113
 
    actions << m_viewModeMenu->addAction(KIcon("view-preview"),
 
111
    actions << m_viewModeMenu->addAction(koIcon("view-preview"),
114
112
                                         i18n("Thumbnail View"), this, SLOT(slotThumbnailView()));
115
113
 
116
114
    for (int i = 0, n = actions.count(); i < n; ++i) {
119
117
    }
120
118
    actions[1]->trigger(); //TODO save/load previous state
121
119
 
122
 
    m_wdgLayerBox->bnAdd->setIcon(BarIcon("list-add"));
 
120
    m_wdgLayerBox->bnAdd->setIcon(koIcon("list-add"));
123
121
 
124
122
    m_wdgLayerBox->bnViewMode->setMenu(m_viewModeMenu);
125
123
    m_wdgLayerBox->bnViewMode->setPopupMode(QToolButton::InstantPopup);
126
 
    m_wdgLayerBox->bnViewMode->setIcon(KIcon("view-choose"));
 
124
    m_wdgLayerBox->bnViewMode->setIcon(koIcon("view-choose"));
127
125
    m_wdgLayerBox->bnViewMode->setText(i18n("View mode"));
128
126
 
129
 
    m_wdgLayerBox->bnDelete->setIcon(BarIcon("list-remove"));
 
127
    m_wdgLayerBox->bnDelete->setIcon(koIcon("list-remove"));
130
128
    m_wdgLayerBox->bnDelete->setIconSize(QSize(22, 22));
131
129
 
132
130
    m_wdgLayerBox->bnRaise->setEnabled(false);
133
 
    m_wdgLayerBox->bnRaise->setIcon(BarIcon("go-up"));
 
131
    m_wdgLayerBox->bnRaise->setIcon(koIcon("go-up"));
134
132
    m_wdgLayerBox->bnRaise->setIconSize(QSize(22, 22));
135
 
    
 
133
 
136
134
    m_wdgLayerBox->bnLower->setEnabled(false);
137
 
    m_wdgLayerBox->bnLower->setIcon(BarIcon("go-down"));
 
135
    m_wdgLayerBox->bnLower->setIcon(koIcon("go-down"));
138
136
    m_wdgLayerBox->bnLower->setIconSize(QSize(22, 22));
139
 
    
 
137
 
140
138
    m_wdgLayerBox->bnLeft->setEnabled(true);
141
 
    m_wdgLayerBox->bnLeft->setIcon(BarIcon("arrow-left"));
 
139
    m_wdgLayerBox->bnLeft->setIcon(koIcon("arrow-left"));
142
140
    m_wdgLayerBox->bnLeft->setIconSize(QSize(22, 22));
143
 
    
 
141
 
144
142
    m_wdgLayerBox->bnRight->setEnabled(true);
145
 
    m_wdgLayerBox->bnRight->setIcon(BarIcon("arrow-right"));
 
143
    m_wdgLayerBox->bnRight->setIcon(koIcon("arrow-right"));
146
144
    m_wdgLayerBox->bnRight->setIconSize(QSize(22, 22));
147
145
 
148
 
    m_wdgLayerBox->bnProperties->setIcon(BarIcon("document-properties"));
 
146
    m_wdgLayerBox->bnProperties->setIcon(koIcon("document-properties"));
149
147
    m_wdgLayerBox->bnProperties->setIconSize(QSize(22, 22));
150
148
 
151
 
    m_wdgLayerBox->bnDuplicate->setIcon(BarIcon("edit-copy"));
 
149
    m_wdgLayerBox->bnDuplicate->setIcon(koIcon("edit-copy"));
152
150
    m_wdgLayerBox->bnDuplicate->setIconSize(QSize(22, 22));
153
151
 
154
152
    connect(m_wdgLayerBox->bnDelete, SIGNAL(clicked()), SLOT(slotRmClicked()));
168
166
    connect(m_wdgLayerBox->cmbComposite, SIGNAL(activated(int)), SLOT(slotCompositeOpChanged(int)));
169
167
    connect(m_wdgLayerBox->bnAdd, SIGNAL(clicked()), SLOT(slotNewPaintLayer()));
170
168
 
171
 
    m_newPainterLayerAction = new KAction(KIcon("document-new"), i18n("&Paint Layer"), this);
 
169
    m_newPainterLayerAction = new KAction(koIcon("document-new"), i18n("&Paint Layer"), this);
172
170
    connect(m_newPainterLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewPaintLayer()));
173
171
 
174
 
    m_newGroupLayerAction = new KAction(KIcon("folder-new"), i18n("&Group Layer"), this);
 
172
    m_newGroupLayerAction = new KAction(koIcon("folder-new"), i18n("&Group Layer"), this);
175
173
    connect(m_newGroupLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewGroupLayer()));
176
174
 
177
 
    m_newCloneLayerAction = new KAction(KIcon("edit-copy"), i18n("&Clone Layer"), this);
 
175
    m_newCloneLayerAction = new KAction(koIcon("edit-copy"), i18n("&Clone Layer"), this);
178
176
    connect(m_newCloneLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewCloneLayer()));
179
177
 
180
 
    m_newShapeLayerAction = new KAction(KIcon("bookmark-new"), i18n("&Vector Layer"), this);
 
178
    m_newShapeLayerAction = new KAction(koIcon("bookmark-new"), i18n("&Vector Layer"), this);
181
179
    connect(m_newShapeLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewShapeLayer()));
182
180
 
183
 
    m_newAdjustmentLayerAction = new KAction(KIcon("view-filter"), i18n("&Filter Layer..."), this);
 
181
    m_newAdjustmentLayerAction = new KAction(koIcon("view-filter"), i18n("&Filter Layer..."), this);
184
182
    connect(m_newAdjustmentLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewAdjustmentLayer()));
185
183
 
186
 
    m_newGeneratorLayerAction = new KAction(KIcon("view-filter"), i18n("&Generated Layer..."), this);
 
184
    m_newGeneratorLayerAction = new KAction(koIcon("view-filter"), i18n("&Generated Layer..."), this);
187
185
    connect(m_newGeneratorLayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNewGeneratorLayer()));
188
186
 
189
 
    m_newTransparencyMaskAction = new KAction(KIcon("edit-copy"), i18n("&Transparency Mask"), this);
 
187
    m_newTransparencyMaskAction = new KAction(koIcon("edit-copy"), i18n("&Transparency Mask"), this);
190
188
    connect(m_newTransparencyMaskAction, SIGNAL(triggered(bool)), this, SLOT(slotNewTransparencyMask()));
191
189
 
192
 
    m_newEffectMaskAction = new KAction(KIcon("bookmarks"), i18n("&Filter Mask..."), this);
 
190
    m_newEffectMaskAction = new KAction(koIcon("bookmarks"), i18n("&Filter Mask..."), this);
193
191
    connect(m_newEffectMaskAction, SIGNAL(triggered(bool)), this, SLOT(slotNewEffectMask()));
194
192
 
195
 
    m_newSelectionMaskAction = new KAction(KIcon("edit-paste"), i18n("&Local Selection"), this);
 
193
    m_newSelectionMaskAction = new KAction(koIcon("edit-paste"), i18n("&Local Selection"), this);
196
194
    connect(m_newSelectionMaskAction, SIGNAL(triggered(bool)), this, SLOT(slotNewSelectionMask()));
197
195
 
198
196
    m_newLayerMenu = new KMenu(this);
209
207
    m_newLayerMenu->addAction(m_newTransparencyMaskAction);
210
208
    m_newLayerMenu->addAction(m_newEffectMaskAction);
211
209
#if 0 // XXX_2.0
212
 
    m_newLayerMenu->addAction(KIcon("view-filter"), i18n("&Transformation Mask..."), this, SLOT(slotNewTransformationMa
 
210
    m_newLayerMenu->addAction(koIcon("view-filter"), i18n("&Transformation Mask..."), this, SLOT(slotNewTransformationMa
213
211
    sk()));
214
212
#endif
215
213
    m_newLayerMenu->addAction(m_newSelectionMaskAction);
219
217
 
220
218
    /**
221
219
     * Connect model updateUI() to enable/disable controls.
222
 
     * Note: nodeActivated() is connected seperately in setImage(), because
 
220
     * Note: nodeActivated() is connected separately in setImage(), because
223
221
     *       it needs particular order of calls: first the connection to the
224
222
     *       node manager should be called, then updateUI()
225
223
     */
413
411
    QMenu menu;
414
412
 
415
413
    if (index.isValid()) {
416
 
        menu.addAction(KIcon("document-properties"), i18n("&Properties..."), this, SLOT(slotPropertiesClicked()));
 
414
        menu.addAction(koIcon("document-properties"), i18n("&Properties..."), this, SLOT(slotPropertiesClicked()));
417
415
        menu.addSeparator();
418
 
        menu.addAction(KIcon("edit-delete"), i18n("&Remove Layer"), this, SLOT(slotRmClicked()));
419
 
        menu.addAction(KIcon("edit-copy"), i18n("&Duplicate Layer or Mask"), this, SLOT(slotDuplicateClicked()));
 
416
        menu.addAction(koIcon("edit-delete"), i18n("&Remove Layer"), this, SLOT(slotRmClicked()));
 
417
        menu.addAction(koIcon("edit-copy"), i18n("&Duplicate Layer or Mask"), this, SLOT(slotDuplicateClicked()));
420
418
        // TODO: missing icon "edit-merge"
421
419
        QAction* mergeLayerDown = menu.addAction(i18n("&Merge with Layer Below"), this, SLOT(slotMergeLayer()));
422
420
        if (!index.sibling(index.row() + 1, 0).isValid()) mergeLayerDown->setEnabled(false);
512
510
void KisLayerBox::slotRmClicked()
513
511
{
514
512
    if(!m_canvas) return;
515
 
 
516
 
    KisNodeSP node = m_nodeManager->activeNode();
517
 
    m_nodeManager->removeNode(node);
 
513
    m_nodeManager->removeNode();
518
514
}
519
515
 
520
516
void KisLayerBox::slotRaiseClicked()