~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/utilities/imageeditor/editor/imagewindow.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.2.15 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080717202539-6n7dtirbkoo7qvhd
Tags: 2:0.9.4-1
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Description : digiKam image editor GUI
8
8
 *
9
9
 * Copyright (C) 2004-2005 by Renchi Raju <renchi@pooh.tam.uiuc.edu>
10
 
 * Copyright (C) 2004-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 * Copyright (C) 2004-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
11
11
 *
12
12
 * This program is free software; you can redistribute it
13
13
 * and/or modify it under the terms of the GNU General
68
68
#include "dragobjects.h"
69
69
#include "canvas.h"
70
70
#include "dimginterface.h"
71
 
#include "themeengine.h"
72
71
#include "dimg.h"
73
72
#include "dmetadata.h"
74
73
#include "imageplugin.h"
93
92
#include "imageattributeswatch.h"
94
93
#include "deletedialog.h"
95
94
#include "metadatahub.h"
 
95
#include "themeengine.h"
96
96
#include "imagewindow.h"
97
97
#include "imagewindow.moc"
98
98
 
263
263
 
264
264
    connect(watch, SIGNAL(signalFileMetadataChanged(const KURL &)),
265
265
            this, SLOT(slotFileMetadataChanged(const KURL &)));
266
 
 
267
 
    connect(ThemeEngine::instance(), SIGNAL(signalThemeChanged()),
268
 
            this, SLOT(slotThemeChanged()));
269
266
}
270
267
 
271
268
void ImageWindow::setupUserArea()
305
302
 
306
303
    // -- Rating actions ---------------------------------------------------------------
307
304
 
308
 
    d->star0 = new KAction(i18n("Assign Rating \"No Star\""), CTRL+Key_0,
 
305
    d->star0 = new KAction(i18n("Assign Rating \"No Stars\""), CTRL+Key_0,
309
306
                          d->rightSidebar, SLOT(slotAssignRatingNoStar()),
310
307
                          actionCollection(), "imageview_ratenostar");
311
308
    d->star1 = new KAction(i18n("Assign Rating \"One Star\""), CTRL+Key_1,
366
363
{
367
364
    applyStandardSettings();
368
365
 
369
 
    KConfig* config = kapp->config();
370
 
    config->setGroup("ImageViewer Settings");
371
 
 
372
 
    if (!config->readBoolEntry("UseThemeBackgroundColor", true))
373
 
        m_bgColor = config->readColorEntry("BackgroundColor", &Qt::black);
374
 
    else
375
 
        m_bgColor = ThemeEngine::instance()->baseColor();
376
 
 
377
 
    m_canvas->setBackgroundColor(m_bgColor);
378
 
 
379
366
    AlbumSettings *settings = AlbumSettings::instance();
380
367
    m_canvas->setExifOrient(settings->getExifRotate());
381
368
    m_setExifOrientationTag = settings->getExifSetOrientation();
 
369
    refreshView();
 
370
}
 
371
 
 
372
void ImageWindow::refreshView()
 
373
{
 
374
    d->rightSidebar->refreshTagsView();
382
375
}
383
376
 
384
377
void ImageWindow::loadURL(const KURL::List& urlList, const KURL& urlCurrent,
736
729
bool ImageWindow::setup(bool iccSetupPage)
737
730
{
738
731
    Setup setup(this, 0, iccSetupPage ? Setup::IccProfiles : Setup::LastPageUsed);    
739
 
        
 
732
 
740
733
    if (setup.exec() != QDialog::Accepted)
741
734
        return false;
742
735
 
743
736
    kapp->config()->sync();
744
 
    
 
737
 
745
738
    applySettings();
746
739
    return true;
747
740
}
1012
1005
    }
1013
1006
}
1014
1007
 
1015
 
void ImageWindow::slotThemeChanged()
1016
 
{
1017
 
    m_canvas->setBackgroundColor(ThemeEngine::instance()->baseColor());
1018
 
}
1019
 
 
1020
1008
void ImageWindow::slotFilePrint()
1021
1009
{
1022
1010
    printImage(d->urlCurrent); 
1024
1012
 
1025
1013
void ImageWindow::slideShow(bool startWithCurrent, SlideShowSettings& settings)
1026
1014
{
1027
 
    int       i = 0;
1028
1015
    float     cnt;
1029
1016
    DMetadata meta;
1030
 
    m_cancelSlideShow = false;
 
1017
    int i               = 0;
 
1018
    m_cancelSlideShow   = false;
 
1019
    settings.exifRotate = AlbumSettings::instance()->getExifRotate();
1031
1020
 
1032
1021
    if (!d->imageInfoList.isEmpty())
1033
1022
    {
1034
1023
        // We have started image editor from Album GUI. we get picture comments from database.
1035
1024
 
1036
1025
        m_nameLabel->progressBarMode(StatusProgressBar::CancelProgressBarMode, 
1037
 
                                    i18n("Prepare slideshow. Please wait..."));
 
1026
                                    i18n("Preparing slideshow. Please wait..."));
1038
1027
 
1039
1028
        cnt = (float)d->imageInfoList.count();
1040
1029
 
1064
1053
        // We have started image editor from Camera GUI. we get picture comments from metadata.
1065
1054
 
1066
1055
        m_nameLabel->progressBarMode(StatusProgressBar::CancelProgressBarMode, 
1067
 
                                    i18n("Prepare slideshow. Please wait..."));
 
1056
                                    i18n("Preparing slideshow. Please wait..."));
1068
1057
 
1069
1058
        cnt = (float)d->urlList.count();
1070
1059
 
1088
1077
    {
1089
1078
        settings.exifRotate = AlbumSettings::instance()->getExifRotate();
1090
1079
        settings.fileList   = d->urlList;
1091
 
    
 
1080
 
1092
1081
        SlideShow *slide = new SlideShow(settings);
1093
1082
        if (startWithCurrent)
1094
1083
            slide->setCurrent(d->urlCurrent);
1095
 
    
 
1084
 
1096
1085
        slide->show();
1097
1086
    }
1098
1087
}
1103
1092
    QValueList<int> albumIDs;
1104
1093
    QValueList<int> imageIDs;
1105
1094
    KURL::List      urls;
1106
 
    KURL::List      kioURLs;        
 
1095
    KURL::List      kioURLs;
1107
1096
 
1108
1097
    if (ItemDrag::decode(e, urls, kioURLs, albumIDs, imageIDs) ||
1109
1098
        AlbumDrag::decode(e, urls, albumID) ||
1122
1111
    QValueList<int> albumIDs;
1123
1112
    QValueList<int> imageIDs;
1124
1113
    KURL::List      urls;
1125
 
    KURL::List      kioURLs;        
 
1114
    KURL::List      kioURLs;
1126
1115
 
1127
1116
    if (ItemDrag::decode(e, urls, kioURLs, albumIDs, imageIDs))
1128
1117
    {
1218
1207
    }
1219
1208
}
1220
1209
 
 
1210
void ImageWindow::slotRevert()
 
1211
{
 
1212
    if(!promptUserSave(d->urlCurrent))
 
1213
        return;
 
1214
 
 
1215
    m_canvas->slotRestore();
 
1216
}
 
1217
 
 
1218
void ImageWindow::slotChangeTheme(const QString& theme)
 
1219
{
 
1220
    AlbumSettings::instance()->setCurrentTheme(theme);
 
1221
    ThemeEngine::instance()->slotChangeTheme(theme);
 
1222
}
 
1223
 
1221
1224
}  // namespace Digikam
1222
 
 
1223