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

« back to all changes in this revision

Viewing changes to themedesigner/mainwindow.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:
110
110
};
111
111
 
112
112
MainWindow::MainWindow()
113
 
          : KDialog(0), d(new MainWindowPriv)
 
113
    : KDialog(0), d(new MainWindowPriv)
114
114
{
115
115
    setWindowTitle(i18n("digiKam Theme Designer"));
116
116
    setAttribute(Qt::WA_DeleteOnClose);
147
147
 
148
148
    // Property Editor ---------------------------------------------
149
149
 
150
 
    QGroupBox *groupBox = new QGroupBox(this);
 
150
    QGroupBox* groupBox = new QGroupBox(this);
151
151
    QVBoxLayout* vlay   = new QVBoxLayout(groupBox);
152
152
 
153
153
    QLabel* label1   = new QLabel(i18n("Property: "), groupBox);
282
282
    d->treeView->setHeaderLabel("My Albums");
283
283
    d->treeView->setRootIsDecorated(true);
284
284
 
285
 
    KIconLoader *iconLoader = KIconLoader::global();
 
285
    KIconLoader* iconLoader = KIconLoader::global();
286
286
 
287
 
    QTreeWidgetItem *root = new QTreeWidgetItem(d->treeView, QStringList(QString("Album Root")));
 
287
    QTreeWidgetItem* root = new QTreeWidgetItem(d->treeView, QStringList(QString("Album Root")));
288
288
    root->setIcon(0, iconLoader->loadIcon("folder", KIconLoader::NoGroup, 32));
289
289
    d->treeView->insertTopLevelItem(0, root);
290
290
 
291
291
    QList<QTreeWidgetItem*> items;
 
292
 
292
293
    for (int i=0; i<10; ++i)
293
294
    {
294
 
        QTreeWidgetItem *item = new QTreeWidgetItem(root, QStringList(QString("Album %1").arg(i)));
 
295
        QTreeWidgetItem* item = new QTreeWidgetItem(root, QStringList(QString("Album %1").arg(i)));
295
296
        item->setIcon(0, iconLoader->loadIcon("folder", KIconLoader::NoGroup, 32));
296
297
        items.append(item);
297
298
    }
 
299
 
298
300
    root->addChildren(items);
299
301
 
300
302
    // ------------------------------------------------------------------------
313
315
    KUrl themesUrl(KGlobal::dirs()->findResourceDir("themes", QString()));
314
316
 
315
317
    QString path = KFileDialog::getOpenFileName(themesUrl, QString(), this, QString());
 
318
 
316
319
    if (path.isEmpty())
 
320
    {
317
321
        return;
 
322
    }
318
323
 
319
324
    QFileInfo fi(path);
320
325
    d->theme->name     = fi.fileName();
328
333
void MainWindow::slotSave()
329
334
{
330
335
    QString path = KFileDialog::getSaveFileName(KUrl(), QString(), this, QString());
 
336
 
331
337
    if (path.isEmpty())
 
338
    {
332
339
        return;
 
340
    }
333
341
 
334
342
    QFile file(path);
 
343
 
335
344
    if (!file.open(QIODevice::WriteOnly))
336
345
    {
337
346
        KMessageBox::error(this, i18n("Failed to open file for writing"));
367
376
    d->borderColorBtn->setEnabled(false);
368
377
    d->borderColorLabel->setEnabled(false);
369
378
 
370
 
    switch(d->propertyCombo->currentIndex())
 
379
    switch (d->propertyCombo->currentIndex())
371
380
    {
372
381
        case(BASE):
373
382
        {
532
541
    };
533
542
 
534
543
    d->bevelCombo->blockSignals(false);
 
544
 
535
545
    d->gradientCombo->blockSignals(false);
 
546
 
536
547
    d->begColorBtn->blockSignals(false);
 
548
 
537
549
    d->endColorBtn->blockSignals(false);
 
550
 
538
551
    d->addBorderCheck->blockSignals(false);
 
552
 
539
553
    d->borderColorBtn->blockSignals(false);
540
554
}
541
555
 
542
556
void MainWindow::slotUpdateTheme()
543
557
{
544
 
    switch(d->propertyCombo->currentIndex())
 
558
    switch (d->propertyCombo->currentIndex())
545
559
    {
546
560
        case(BASE):
547
561
        {