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

« back to all changes in this revision

Viewing changes to utilities/setup/setupalbumview.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:
53
53
{
54
54
public:
55
55
 
56
 
    SetupAlbumViewPriv()
 
56
    SetupAlbumViewPriv() :
 
57
        iconTreeThumbLabel(0),
 
58
        iconShowNameBox(0),
 
59
        iconShowSizeBox(0),
 
60
        iconShowDateBox(0),
 
61
        iconShowModDateBox(0),
 
62
        iconShowResolutionBox(0),
 
63
        iconShowCommentsBox(0),
 
64
        iconShowTagsBox(0),
 
65
        iconShowRatingBox(0),
 
66
        iconShowOverlaysBox(0),
 
67
        previewLoadFullImageSize(0),
 
68
        showFolderTreeViewItemsCount(0),
 
69
        iconTreeThumbSize(0),
 
70
        leftClickActionComboBox(0),
 
71
        iconViewFontSelect(0),
 
72
        treeViewFontSelect(0)
57
73
    {
58
 
        iconTreeThumbSize            = 0;
59
 
        iconTreeThumbLabel           = 0;
60
 
        iconShowNameBox              = 0;
61
 
        iconShowSizeBox              = 0;
62
 
        iconShowDateBox              = 0;
63
 
        iconShowModDateBox           = 0;
64
 
        iconShowResolutionBox        = 0;
65
 
        iconShowCommentsBox          = 0;
66
 
        iconShowTagsBox              = 0;
67
 
        iconShowRatingBox            = 0;
68
 
        iconShowOverlaysBox          = 0;
69
 
        leftClickActionComboBox      = 0;
70
 
        previewLoadFullImageSize     = 0;
71
 
        showFolderTreeViewItemsCount = 0;
72
 
        treeViewFontSelect           = 0;
73
 
        iconViewFontSelect           = 0;
74
74
    }
75
75
 
76
76
    QLabel*      iconTreeThumbLabel;
95
95
};
96
96
 
97
97
SetupAlbumView::SetupAlbumView(QWidget* parent)
98
 
              : QScrollArea(parent), d(new SetupAlbumViewPriv)
 
98
    : QScrollArea(parent), d(new SetupAlbumViewPriv)
99
99
{
100
 
    QWidget *panel = new QWidget(viewport());
 
100
    QWidget* panel = new QWidget(viewport());
101
101
    setWidget(panel);
102
102
    setWidgetResizable(true);
103
103
 
104
 
    QVBoxLayout *layout = new QVBoxLayout(panel);
 
104
    QVBoxLayout* layout = new QVBoxLayout(panel);
105
105
 
106
106
    // --------------------------------------------------------
107
107
 
108
 
    QGroupBox *iconViewGroup = new QGroupBox(i18n("Icon-View Options"), panel);
109
 
    QGridLayout *grid        = new QGridLayout(iconViewGroup);
 
108
    QGroupBox* iconViewGroup = new QGroupBox(i18n("Icon-View Options"), panel);
 
109
    QGridLayout* grid        = new QGridLayout(iconViewGroup);
110
110
 
111
111
    d->iconShowNameBox       = new QCheckBox(i18n("Show file&name"), iconViewGroup);
112
112
    d->iconShowNameBox->setWhatsThis(i18n("Set this option to show the filename below the image thumbnail."));
120
120
 
121
121
    d->iconShowModDateBox    = new QCheckBox(i18n("Show file &modification date"), iconViewGroup);
122
122
    d->iconShowModDateBox->setWhatsThis(i18n("Set this option to show the file modification date "
123
 
                                             "below the image thumbnail."));
 
123
                                        "below the image thumbnail."));
124
124
 
125
125
    d->iconShowResolutionBox = new QCheckBox(i18n("Show ima&ge dimensions"), iconViewGroup);
126
126
    d->iconShowResolutionBox->setWhatsThis(i18n("Set this option to show the image size in pixels "
127
 
                                                "below the image thumbnail."));
 
127
                                           "below the image thumbnail."));
128
128
 
129
129
    d->iconShowCommentsBox   = new QCheckBox(i18n("Show digiKam &captions"), iconViewGroup);
130
130
    d->iconShowCommentsBox->setWhatsThis(i18n("Set this option to show the digiKam captions "
131
 
                                              "below the image thumbnail."));
 
131
                                         "below the image thumbnail."));
132
132
 
133
133
    d->iconShowTagsBox       = new QCheckBox(i18n("Show digiKam &tags"), iconViewGroup);
134
134
    d->iconShowTagsBox->setWhatsThis(i18n("Set this option to show the digiKam tags "
140
140
 
141
141
    d->iconShowOverlaysBox   = new QCheckBox(i18n("Show rotation overlay buttons"), iconViewGroup);
142
142
    d->iconShowOverlaysBox->setWhatsThis(i18n("Set this option to show overlay buttons on "
143
 
                                              "the image thumbnail for image rotation."));
 
143
                                         "the image thumbnail for image rotation."));
144
144
 
145
 
    QLabel *leftClickLabel     = new QLabel(i18n("Thumbnail click action:"), iconViewGroup);
 
145
    QLabel* leftClickLabel     = new QLabel(i18n("Thumbnail click action:"), iconViewGroup);
146
146
    d->leftClickActionComboBox = new KComboBox(iconViewGroup);
147
147
    d->leftClickActionComboBox->addItem(i18n("Show embedded preview"), AlbumSettings::ShowPreview);
148
148
    d->leftClickActionComboBox->addItem(i18n("Start image editor"), AlbumSettings::StartEditor);
168
168
 
169
169
    // --------------------------------------------------------
170
170
 
171
 
    QGroupBox *folderViewGroup = new QGroupBox(i18n("Folder View Options"), panel);
 
171
    QGroupBox* folderViewGroup = new QGroupBox(i18n("Folder View Options"), panel);
172
172
    QGridLayout* grid2         = new QGridLayout(folderViewGroup);
173
173
 
174
174
    d->iconTreeThumbLabel      = new QLabel(i18n("Tree View thumbnail size:"), folderViewGroup);
194
194
 
195
195
    // --------------------------------------------------------
196
196
 
197
 
    QGroupBox *interfaceOptionsGroup = new QGroupBox(i18n("Misc Options"), panel);
 
197
    QGroupBox* interfaceOptionsGroup = new QGroupBox(i18n("Misc Options"), panel);
198
198
    QGridLayout* grid3               = new QGridLayout(interfaceOptionsGroup);
199
199
 
200
200
    d->previewLoadFullImageSize      = new QCheckBox(i18n("Embedded preview loads full-sized images."), interfaceOptionsGroup);
201
201
    d->previewLoadFullImageSize->setWhatsThis(i18n("<p>Set this option to load images at their full size "
202
 
                                                   "for preview, rather than at a reduced size. As this option "
203
 
                                                   "will make it take longer to load images, only use it if you have "
204
 
                                                   "a fast computer.</p>"
205
 
                                                   "<p><b>Note:</b> for Raw images, a half size version of the Raw data "
206
 
                                                   "is used instead of the embedded JPEG preview.</p>"));
 
202
            "for preview, rather than at a reduced size. As this option "
 
203
            "will make it take longer to load images, only use it if you have "
 
204
            "a fast computer.</p>"
 
205
            "<p><b>Note:</b> for Raw images, a half size version of the Raw data "
 
206
            "is used instead of the embedded JPEG preview.</p>"));
207
207
 
208
208
    grid3->setMargin(KDialog::spacingHint());
209
209
    grid3->setSpacing(KDialog::spacingHint());
238
238
void SetupAlbumView::applySettings()
239
239
{
240
240
    AlbumSettings* settings = AlbumSettings::instance();
241
 
    if (!settings) return;
 
241
 
 
242
    if (!settings)
 
243
    {
 
244
        return;
 
245
    }
242
246
 
243
247
    settings->setTreeViewIconSize(d->iconTreeThumbSize->currentText().toInt());
244
248
    settings->setTreeViewFont(d->treeViewFontSelect->font());
264
268
void SetupAlbumView::readSettings()
265
269
{
266
270
    AlbumSettings* settings = AlbumSettings::instance();
267
 
    if (!settings) return;
 
271
 
 
272
    if (!settings)
 
273
    {
 
274
        return;
 
275
    }
268
276
 
269
277
    if (settings->getTreeViewIconSize() == 16)
 
278
    {
270
279
        d->iconTreeThumbSize->setCurrentIndex(0);
 
280
    }
271
281
    else if (settings->getTreeViewIconSize() == 22)
 
282
    {
272
283
        d->iconTreeThumbSize->setCurrentIndex(1);
 
284
    }
273
285
    else if (settings->getTreeViewIconSize() == 32)
 
286
    {
274
287
        d->iconTreeThumbSize->setCurrentIndex(2);
 
288
    }
275
289
    else
 
290
    {
276
291
        d->iconTreeThumbSize->setCurrentIndex(3);
 
292
    }
277
293
 
278
294
    d->treeViewFontSelect->setFont(settings->getTreeViewFont());
279
295
    d->iconShowNameBox->setChecked(settings->getIconShowName());