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

« back to all changes in this revision

Viewing changes to core/libs/widgets/metadata/mdkeylistviewitem.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer, Rohan Garg, Philip Muškovac, Felix Geyer
  • Date: 2011-09-23 18:18:55 UTC
  • mfrom: (1.2.36 upstream)
  • Revision ID: package-import@ubuntu.com-20110923181855-ifs67wxkugshev9k
Tags: 2:2.1.1-0ubuntu1
[ Rohan Garg ]
* New upstream release (LP: #834190)
  - debian/control
    + Build with libqtwebkit-dev
 - debian/kipi-plugins-common
    + Install libkvkontakte required by kipi-plugins
 - debian/digikam
    + Install panoramagui

[ Philip Muškovac ]
* New upstream release
  - debian/control:
    + Add libcv-dev, libcvaux-dev, libhighgui-dev, libboost-graph1.46-dev,
      libksane-dev, libxml2-dev, libxslt-dev, libqt4-opengl-dev, libqjson-dev,
      libgpod-dev and libqca2-dev to build-deps
    + Add packages for kipi-plugins, libmediawiki, libkface, libkgeomap and
      libkvkontakte
  - debian/rules:
    + Don't build with gphoto2 since it doesn't build with it.
  - Add kubuntu_fix_test_linking.diff to fix linking of the dngconverter test
  - update install files
  - update kubuntu_01_mysqld_executable_name.diff for new cmake layout
    and rename to kubuntu_mysqld_executable_name.diff
* Fix typo in digikam-data description (LP: #804894)
* Fix Vcs links

[ Felix Geyer ]
* Move library data files to the new packages libkface-data, libkgeomap-data
  and libkvkontakte-data.
* Override version of the embedded library packages to 1.0~digikam<version>.
* Exclude the library packages from digikam-dbg to prevent file conflicts in
  the future.
* Call dh_install with --list-missing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2006-02-21
 
7
 * Description : a generic list view item widget to
 
8
 *               display metadata key like a title
 
9
 *
 
10
 * Copyright (C) 2006-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
11
 *
 
12
 * This program is free software; you can redistribute it
 
13
 * and/or modify it under the terms of the GNU General
 
14
 * Public License as published by the Free Software Foundation;
 
15
 * either version 2, or (at your option)
 
16
 * any later version.
 
17
 *
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * ============================================================ */
 
24
 
 
25
#include "mdkeylistviewitem.moc"
 
26
 
 
27
// Qt includes
 
28
 
 
29
#include <QPalette>
 
30
#include <QFont>
 
31
#include <QPainter>
 
32
 
 
33
// KDE includes
 
34
 
 
35
#include <kapplication.h>
 
36
#include <klocale.h>
 
37
 
 
38
// Local includes
 
39
 
 
40
#include "thememanager.h"
 
41
 
 
42
namespace Digikam
 
43
{
 
44
 
 
45
MdKeyListViewItem::MdKeyListViewItem(QTreeWidget* parent, const QString& key)
 
46
    : QObject(parent), QTreeWidgetItem(parent)
 
47
{
 
48
    m_key          = key;
 
49
    m_decryptedKey = key;
 
50
 
 
51
    // Standard Exif key descriptions.
 
52
    if      (key == "Iop")
 
53
    {
 
54
        m_decryptedKey = i18n("Interoperability");
 
55
    }
 
56
    else if (key == "Image")
 
57
    {
 
58
        m_decryptedKey = i18n("Image Information");
 
59
    }
 
60
    else if (key == "Photo")
 
61
    {
 
62
        m_decryptedKey = i18n("Photograph Information");
 
63
    }
 
64
    else if (key == "GPSInfo")
 
65
    {
 
66
        m_decryptedKey = i18n("Global Positioning System");
 
67
    }
 
68
    else if (key == "Thumbnail")
 
69
    {
 
70
        m_decryptedKey = i18n("Embedded Thumbnail");
 
71
    }
 
72
 
 
73
    // Standard IPTC key descriptions.
 
74
    else if (key == "Envelope")
 
75
    {
 
76
        m_decryptedKey = i18n("IIM Envelope");
 
77
    }
 
78
    else if (key == "Application2")
 
79
    {
 
80
        m_decryptedKey = i18n("IIM Application 2");
 
81
    }
 
82
 
 
83
    // Standard XMP key descriptions.
 
84
    else if (key == "aux")
 
85
    {
 
86
        m_decryptedKey = i18n("Additional Exif Properties");
 
87
    }
 
88
    else if (key == "crs")
 
89
    {
 
90
        m_decryptedKey = i18n("Camera Raw");
 
91
    }
 
92
    else if (key == "dc")
 
93
    {
 
94
        m_decryptedKey = i18n("Dublin Core");
 
95
    }
 
96
    else if (key == "digiKam")
 
97
    {
 
98
        m_decryptedKey = i18n("digiKam schema");
 
99
    }
 
100
    else if (key == "exif")
 
101
    {
 
102
        m_decryptedKey = i18n("Exif-specific Properties");
 
103
    }
 
104
    else if (key == "iptc")
 
105
    {
 
106
        m_decryptedKey = i18n("IPTC Core");
 
107
    }
 
108
    else if (key == "iptcExt")
 
109
    {
 
110
        m_decryptedKey = i18n("IPTC Extension schema");
 
111
    }
 
112
    else if (key == "MicrosoftPhoto")
 
113
    {
 
114
        m_decryptedKey = i18n("Microsoft Photo");
 
115
    }
 
116
    else if (key == "pdf")
 
117
    {
 
118
        m_decryptedKey = i18n("Adobe PDF");
 
119
    }
 
120
    else if (key == "photoshop")
 
121
    {
 
122
        m_decryptedKey = i18n("Adobe Photoshop");
 
123
    }
 
124
    else if (key == "plus")
 
125
    {
 
126
        m_decryptedKey = i18n("PLUS License Data Format Schema");
 
127
    }
 
128
    else if (key == "tiff")
 
129
    {
 
130
        m_decryptedKey = i18n("TIFF Properties");
 
131
    }
 
132
    else if (key == "xmp")
 
133
    {
 
134
        m_decryptedKey = i18n("Basic Schema");
 
135
    }
 
136
    else if (key == "xmpBJ")
 
137
    {
 
138
        m_decryptedKey = i18n("Basic Job Ticket");
 
139
    }
 
140
    else if (key == "xmpDM")
 
141
    {
 
142
        m_decryptedKey = i18n("Dynamic Media");
 
143
    }
 
144
    else if (key == "xmpMM")
 
145
    {
 
146
        m_decryptedKey = i18n("Media Management ");
 
147
    }
 
148
    else if (key == "xmpRights")
 
149
    {
 
150
        m_decryptedKey = i18n("Rights Management");
 
151
    }
 
152
    else if (key == "xmpTPg")
 
153
    {
 
154
        m_decryptedKey = i18n("Paged-Text");
 
155
    }
 
156
 
 
157
    // Reset all item flags: item is not selectable.
 
158
    setFlags(Qt::ItemIsEnabled);
 
159
 
 
160
    setDisabled(false);
 
161
    setExpanded(true);
 
162
 
 
163
    setFirstColumnSpanned(true);
 
164
    setTextAlignment(0, Qt::AlignCenter);
 
165
    QFont fn0(font(0));
 
166
    fn0.setBold(true);
 
167
    fn0.setItalic(false);
 
168
    setFont(0, fn0);
 
169
    QFont fn1(font(1));
 
170
    fn1.setBold(true);
 
171
    fn1.setItalic(false);
 
172
    setFont(1, fn1);
 
173
    setText(0, m_decryptedKey);
 
174
    slotThemeChanged();
 
175
 
 
176
    connect(ThemeManager::instance(), SIGNAL(signalThemeChanged()),
 
177
            this, SLOT(slotThemeChanged()));
 
178
}
 
179
 
 
180
MdKeyListViewItem::~MdKeyListViewItem()
 
181
{
 
182
}
 
183
 
 
184
QString MdKeyListViewItem::getKey() const
 
185
{
 
186
    return m_key;
 
187
}
 
188
 
 
189
QString MdKeyListViewItem::getDecryptedKey() const
 
190
{
 
191
    return m_decryptedKey;
 
192
}
 
193
 
 
194
void MdKeyListViewItem::slotThemeChanged()
 
195
{
 
196
    setBackground(0, QBrush(kapp->palette().color(QPalette::Highlight)));
 
197
    setBackground(1, QBrush(kapp->palette().color(QPalette::Highlight)));
 
198
    setForeground(0, QBrush(kapp->palette().color(QPalette::HighlightedText)));
 
199
    setForeground(1, QBrush(kapp->palette().color(QPalette::HighlightedText)));
 
200
}
 
201
 
 
202
}  // namespace Digikam