~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to imageplugins/decorate/superimpose/superimposetool.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
        gboxSettings(0),
75
75
        previewWidget(0),
76
76
        dirSelect(0)
77
 
        {}
 
77
    {}
78
78
 
79
79
    static const QString configGroupName;
80
80
    static const QString configTemplatesRootURLEntry;
95
95
// --------------------------------------------------------
96
96
 
97
97
SuperImposeTool::SuperImposeTool(QObject* parent)
98
 
               : EditorTool(parent),
99
 
                 d(new SuperImposeToolPriv)
 
98
    : EditorTool(parent),
 
99
      d(new SuperImposeToolPriv)
100
100
{
101
101
    setObjectName("superimpose");
102
102
    setToolName(i18n("Template Superimpose"));
104
104
 
105
105
    // -------------------------------------------------------------
106
106
 
107
 
    QFrame *frame = new QFrame(0);
 
107
    QFrame* frame = new QFrame(0);
108
108
    frame->setFrameStyle(QFrame::Panel|QFrame::Sunken);
109
109
 
110
110
    QGridLayout* gridFrame = new QGridLayout(frame);
113
113
 
114
114
    // -------------------------------------------------------------
115
115
 
116
 
    QWidget *toolBox     = new QWidget(frame);
117
 
    QHBoxLayout *hlay    = new QHBoxLayout(toolBox);
118
 
    QButtonGroup *bGroup = new QButtonGroup(frame);
 
116
    QWidget* toolBox     = new QWidget(frame);
 
117
    QHBoxLayout* hlay    = new QHBoxLayout(toolBox);
 
118
    QButtonGroup* bGroup = new QButtonGroup(frame);
119
119
 
120
 
    QToolButton *zoomInButton = new QToolButton(toolBox);
 
120
    QToolButton* zoomInButton = new QToolButton(toolBox);
121
121
    bGroup->addButton(zoomInButton, ZOOMIN);
122
122
    zoomInButton->setIcon(KIcon("zoom-in"));
123
123
    zoomInButton->setCheckable(true);
124
124
    zoomInButton->setToolTip(i18n("Zoom in"));
125
125
 
126
 
    QToolButton *zoomOutButton = new QToolButton(toolBox);
 
126
    QToolButton* zoomOutButton = new QToolButton(toolBox);
127
127
    bGroup->addButton(zoomOutButton, ZOOMOUT);
128
128
    zoomOutButton->setIcon(KIcon("zoom-out"));
129
129
    zoomOutButton->setCheckable(true);
130
130
    zoomOutButton->setToolTip(i18n("Zoom out"));
131
131
 
132
 
    QToolButton *moveButton = new QToolButton(toolBox);
 
132
    QToolButton* moveButton = new QToolButton(toolBox);
133
133
    bGroup->addButton(moveButton, MOVE);
134
134
    moveButton->setIcon(KIcon("transform-move"));
135
135
    moveButton->setCheckable(true);
170
170
    d->thumbnailsBar->setToolTip(new ThumbBarToolTip(d->thumbnailsBar));
171
171
 
172
172
    d->dirSelect = new DirSelectWidget(d->gboxSettings->plainPage());
173
 
    QPushButton *templateDirButton = new QPushButton(i18n("Root Directory..."), d->gboxSettings->plainPage());
 
173
    QPushButton* templateDirButton = new QPushButton(i18n("Root Directory..."), d->gboxSettings->plainPage());
174
174
    templateDirButton->setWhatsThis(i18n("Set here the current templates' root directory."));
175
175
 
176
176
    // -------------------------------------------------------------
193
193
    connect(d->thumbnailsBar, SIGNAL(signalUrlSelected(const KUrl&)),
194
194
            d->previewWidget, SLOT(slotSetCurrentTemplate(const KUrl&)));
195
195
 
196
 
    connect(d->dirSelect, SIGNAL(folderItemSelected(const KUrl &)),
197
 
            this, SLOT(slotTemplateDirChanged(const KUrl &)));
 
196
    connect(d->dirSelect, SIGNAL(folderItemSelected(const KUrl&)),
 
197
            this, SLOT(slotTemplateDirChanged(const KUrl&)));
198
198
 
199
199
    connect(templateDirButton, SIGNAL(clicked()),
200
200
            this, SLOT(slotRootTemplateDirChanged()));
214
214
    d->thumbnailsBar->clear(true);
215
215
 
216
216
    if (!d->templatesUrl.isValid() || !d->templatesUrl.isLocalFile())
217
 
       return;
 
217
    {
 
218
        return;
 
219
    }
218
220
 
219
221
    QDir dir(d->templatesUrl.toLocalFile(), "*.png *.PNG");
220
222
 
221
223
    if (!dir.exists())
222
 
       return;
 
224
    {
 
225
        return;
 
226
    }
223
227
 
224
228
    dir.setFilter ( QDir::Files | QDir::NoSymLinks );
225
229
 
226
230
    QFileInfoList fileinfolist = dir.entryInfoList();
 
231
 
227
232
    if (fileinfolist.isEmpty())
228
 
       return;
 
233
    {
 
234
        return;
 
235
    }
229
236
 
230
237
    QFileInfoList::const_iterator fi;
231
238
 
264
271
void SuperImposeTool::slotRootTemplateDirChanged(void)
265
272
{
266
273
    KUrl url = KFileDialog::getExistingDirectory(d->templatesRootUrl.toLocalFile(), kapp->activeWindow(),
267
 
                                                 i18n("Select Template Root Directory to Use"));
 
274
               i18n("Select Template Root Directory to Use"));
268
275
 
269
276
    if ( url.isValid() )
270
277
    {