~ubuntu-branches/ubuntu/karmic/digikam/karmic-backports

« back to all changes in this revision

Viewing changes to utilities/setup/setupalbumview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ubuntu Archive Auto-Backport
  • Date: 2009-12-07 19:03:53 UTC
  • mfrom: (54.1.4 lucid)
  • Revision ID: james.westby@ubuntu.com-20091207190353-oara3lenjxymto3i
Tags: 2:1.0.0~rc-1ubuntu1~karmic1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 *
23
23
 * ============================================================ */
24
24
 
25
 
#include "setupalbumview.h"
26
25
#include "setupalbumview.moc"
27
26
 
28
27
// Qt includes
37
36
 
38
37
// KDE includes
39
38
 
 
39
#include <kapplication.h>
40
40
#include <kcombobox.h>
41
41
#include <kdialog.h>
42
 
#include <kapplication.h>
43
42
#include <klocale.h>
44
43
 
45
44
// Local includes
67
66
        iconShowTagsBox              = 0;
68
67
        iconShowRatingBox            = 0;
69
68
        iconShowOverlaysBox          = 0;
70
 
        rightClickActionComboBox     = 0;
 
69
        leftClickActionComboBox      = 0;
71
70
        previewLoadFullImageSize     = 0;
72
71
        showFolderTreeViewItemsCount = 0;
73
72
        treeViewFontSelect           = 0;
74
73
        iconViewFontSelect           = 0;
75
74
    }
76
75
 
77
 
    QLabel      *iconTreeThumbLabel;
78
 
 
79
 
    QCheckBox   *iconShowNameBox;
80
 
    QCheckBox   *iconShowSizeBox;
81
 
    QCheckBox   *iconShowDateBox;
82
 
    QCheckBox   *iconShowModDateBox;
83
 
    QCheckBox   *iconShowResolutionBox;
84
 
    QCheckBox   *iconShowCommentsBox;
85
 
    QCheckBox   *iconShowTagsBox;
86
 
    QCheckBox   *iconShowRatingBox;
87
 
    QCheckBox   *iconShowOverlaysBox;
88
 
    QCheckBox   *previewLoadFullImageSize;
89
 
    QCheckBox   *showFolderTreeViewItemsCount;
90
 
 
91
 
    KComboBox   *iconTreeThumbSize;
92
 
    KComboBox   *rightClickActionComboBox;
93
 
 
94
 
    DFontSelect *iconViewFontSelect;
95
 
    DFontSelect *treeViewFontSelect;
 
76
    QLabel*      iconTreeThumbLabel;
 
77
 
 
78
    QCheckBox*   iconShowNameBox;
 
79
    QCheckBox*   iconShowSizeBox;
 
80
    QCheckBox*   iconShowDateBox;
 
81
    QCheckBox*   iconShowModDateBox;
 
82
    QCheckBox*   iconShowResolutionBox;
 
83
    QCheckBox*   iconShowCommentsBox;
 
84
    QCheckBox*   iconShowTagsBox;
 
85
    QCheckBox*   iconShowRatingBox;
 
86
    QCheckBox*   iconShowOverlaysBox;
 
87
    QCheckBox*   previewLoadFullImageSize;
 
88
    QCheckBox*   showFolderTreeViewItemsCount;
 
89
 
 
90
    KComboBox*   iconTreeThumbSize;
 
91
    KComboBox*   leftClickActionComboBox;
 
92
 
 
93
    DFontSelect* iconViewFontSelect;
 
94
    DFontSelect* treeViewFontSelect;
96
95
};
97
96
 
98
97
SetupAlbumView::SetupAlbumView(QWidget* parent)
99
98
              : QScrollArea(parent), d(new SetupAlbumViewPriv)
100
99
{
101
100
    QWidget *panel = new QWidget(viewport());
102
 
    panel->setAutoFillBackground(false);
103
101
    setWidget(panel);
104
102
    setWidgetResizable(true);
105
 
    viewport()->setAutoFillBackground(false);
106
103
 
107
104
    QVBoxLayout *layout = new QVBoxLayout(panel);
108
105
 
145
142
    d->iconShowOverlaysBox->setWhatsThis(i18n("Set this option to show overlay buttons on "
146
143
                                              "the image thumbnail for image rotation."));
147
144
 
148
 
    QLabel *rightClickLabel     = new QLabel(i18n("Thumbnail click action:"), iconViewGroup);
149
 
    d->rightClickActionComboBox = new KComboBox(iconViewGroup);
150
 
    d->rightClickActionComboBox->addItem(i18n("Show embedded preview"), AlbumSettings::ShowPreview);
151
 
    d->rightClickActionComboBox->addItem(i18n("Start image editor"), AlbumSettings::StartEditor);
152
 
    d->rightClickActionComboBox->setToolTip(i18n("Here, choose what should happen when you "
153
 
                                                 "click on a thumbnail."));
 
145
    QLabel *leftClickLabel     = new QLabel(i18n("Thumbnail click action:"), iconViewGroup);
 
146
    d->leftClickActionComboBox = new KComboBox(iconViewGroup);
 
147
    d->leftClickActionComboBox->addItem(i18n("Show embedded preview"), AlbumSettings::ShowPreview);
 
148
    d->leftClickActionComboBox->addItem(i18n("Start image editor"), AlbumSettings::StartEditor);
 
149
    d->leftClickActionComboBox->setToolTip(i18n("Choose what should happen when you click on a thumbnail."));
154
150
 
155
151
    d->iconViewFontSelect = new DFontSelect(i18n("Icon View font:"), panel);
156
152
    d->iconViewFontSelect->setToolTip(i18n("Select here the font used to display text in Icon Views."));
164
160
    grid->addWidget(d->iconShowTagsBox,          1, 1, 1, 1);
165
161
    grid->addWidget(d->iconShowRatingBox,        2, 1, 1, 1);
166
162
    grid->addWidget(d->iconShowOverlaysBox,      3, 1, 1, 1);
167
 
    grid->addWidget(rightClickLabel,             5, 0, 1, 1);
168
 
    grid->addWidget(d->rightClickActionComboBox, 5, 1, 1, 1);
 
163
    grid->addWidget(leftClickLabel,              5, 0, 1, 1);
 
164
    grid->addWidget(d->leftClickActionComboBox,  5, 1, 1, 1);
169
165
    grid->addWidget(d->iconViewFontSelect,       6, 0, 1, 2);
170
166
    grid->setSpacing(KDialog::spacingHint());
171
167
    grid->setMargin(KDialog::spacingHint());
223
219
 
224
220
    readSettings();
225
221
    adjustSize();
 
222
 
 
223
    // --------------------------------------------------------
 
224
 
 
225
    setAutoFillBackground(false);
 
226
    viewport()->setAutoFillBackground(false);
 
227
    panel->setAutoFillBackground(false);
226
228
}
227
229
 
228
230
SetupAlbumView::~SetupAlbumView()
248
250
    settings->setIconShowOverlays(d->iconShowOverlaysBox->isChecked());
249
251
    settings->setIconViewFont(d->iconViewFontSelect->font());
250
252
 
251
 
    settings->setItemRightClickAction((AlbumSettings::ItemRightClickAction)
252
 
                                      d->rightClickActionComboBox->currentIndex());
 
253
    settings->setItemLeftClickAction((AlbumSettings::ItemLeftClickAction)
 
254
                                     d->leftClickActionComboBox->currentIndex());
253
255
 
254
256
    settings->setPreviewLoadFullImageSize(d->previewLoadFullImageSize->isChecked());
255
257
    settings->setShowFolderTreeViewItemsCount(d->showFolderTreeViewItemsCount->isChecked());
282
284
    d->iconShowOverlaysBox->setChecked(settings->getIconShowOverlays());
283
285
    d->iconViewFontSelect->setFont(settings->getIconViewFont());
284
286
 
285
 
    d->rightClickActionComboBox->setCurrentIndex((int)settings->getItemRightClickAction());
 
287
    d->leftClickActionComboBox->setCurrentIndex((int)settings->getItemLeftClickAction());
286
288
 
287
289
    d->previewLoadFullImageSize->setChecked(settings->getPreviewLoadFullImageSize());
288
290
    d->showFolderTreeViewItemsCount->setChecked(settings->getShowFolderTreeViewItemsCount());