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

« back to all changes in this revision

Viewing changes to utilities/setup/setupslideshow.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:
21
21
 *
22
22
 * ============================================================ */
23
23
 
24
 
#include "setupslideshow.h"
25
24
#include "setupslideshow.moc"
26
25
 
27
26
// Qt includes
46
45
{
47
46
public:
48
47
 
49
 
    SetupSlideShowPriv()
50
 
    {
51
 
        delayInput          = 0;
52
 
        startWithCurrent    = 0;
53
 
        loopMode            = 0;
54
 
        showName            = 0;
55
 
        showDate            = 0;
56
 
        showApertureFocal   = 0;
57
 
        showExpoSensitivity = 0;
58
 
        showMakeModel       = 0;
59
 
        showComment         = 0;
60
 
        showRating          = 0;
61
 
    }
62
 
 
63
 
    QCheckBox    *startWithCurrent;
64
 
    QCheckBox    *loopMode;
65
 
    QCheckBox    *showName;
66
 
    QCheckBox    *showDate;
67
 
    QCheckBox    *showApertureFocal;
68
 
    QCheckBox    *showExpoSensitivity;
69
 
    QCheckBox    *showMakeModel;
70
 
    QCheckBox    *showComment;
71
 
    QCheckBox    *showRating;
72
 
 
73
 
    KIntNumInput *delayInput;
 
48
    SetupSlideShowPriv() :
 
49
        configGroupName("ImageViewer Settings"),
 
50
        configSlideShowDelayEntry("SlideShowDelay"),
 
51
        configSlideShowStartCurrentEntry("SlideShowStartCurrent"),
 
52
        configSlideShowLoopEntry("SlideShowLoop"),
 
53
        configSlideShowPrintNameEntry("SlideShowPrintName"),
 
54
        configSlideShowPrintDateEntry("SlideShowPrintDate"),
 
55
        configSlideShowPrintApertureFocalEntry("SlideShowPrintApertureFocal"),
 
56
        configSlideShowPrintExpoSensitivityEntry("SlideShowPrintExpoSensitivity"),
 
57
        configSlideShowPrintMakeModelEntry("SlideShowPrintMakeModel"),
 
58
        configSlideShowPrintCommentEntry("SlideShowPrintComment"),
 
59
        configSlideShowPrintRatingEntry("SlideShowPrintRating"),
 
60
 
 
61
        startWithCurrent(0),
 
62
        loopMode(0),
 
63
        showName(0),
 
64
        showDate(0),
 
65
        showApertureFocal(0),
 
66
        showExpoSensitivity(0),
 
67
        showMakeModel(0),
 
68
        showComment(0),
 
69
        showRating(0),
 
70
        delayInput(0)
 
71
        {}
 
72
 
 
73
    const QString configGroupName;
 
74
    const QString configSlideShowDelayEntry;
 
75
    const QString configSlideShowStartCurrentEntry;
 
76
    const QString configSlideShowLoopEntry;
 
77
    const QString configSlideShowPrintNameEntry;
 
78
    const QString configSlideShowPrintDateEntry;
 
79
    const QString configSlideShowPrintApertureFocalEntry;
 
80
    const QString configSlideShowPrintExpoSensitivityEntry;
 
81
    const QString configSlideShowPrintMakeModelEntry;
 
82
    const QString configSlideShowPrintCommentEntry;
 
83
    const QString configSlideShowPrintRatingEntry;
 
84
 
 
85
    QCheckBox*    startWithCurrent;
 
86
    QCheckBox*    loopMode;
 
87
    QCheckBox*    showName;
 
88
    QCheckBox*    showDate;
 
89
    QCheckBox*    showApertureFocal;
 
90
    QCheckBox*    showExpoSensitivity;
 
91
    QCheckBox*    showMakeModel;
 
92
    QCheckBox*    showComment;
 
93
    QCheckBox*    showRating;
 
94
 
 
95
    KIntNumInput* delayInput;
74
96
};
75
97
 
76
98
SetupSlideShow::SetupSlideShow(QWidget* parent)
77
99
              : QScrollArea(parent), d(new SetupSlideShowPriv)
78
100
{
79
101
    QWidget *panel = new QWidget(viewport());
80
 
    panel->setAutoFillBackground(false);
81
102
    setWidget(panel);
82
103
    setWidgetResizable(true);
83
 
    viewport()->setAutoFillBackground(false);
84
104
 
85
105
    QVBoxLayout *layout = new QVBoxLayout(panel);
86
106
 
137
157
    layout->setSpacing(KDialog::spacingHint());
138
158
 
139
159
    readSettings();
 
160
 
 
161
    // --------------------------------------------------------
 
162
 
 
163
    setAutoFillBackground(false);
 
164
    viewport()->setAutoFillBackground(false);
 
165
    panel->setAutoFillBackground(false);
140
166
}
141
167
 
142
168
SetupSlideShow::~SetupSlideShow()
147
173
void SetupSlideShow::applySettings()
148
174
{
149
175
    KSharedConfig::Ptr config = KGlobal::config();
150
 
    KConfigGroup group        = config->group(QString("ImageViewer Settings"));
 
176
    KConfigGroup group        = config->group(d->configGroupName);
151
177
 
152
 
    group.writeEntry("SlideShowDelay", d->delayInput->value());
153
 
    group.writeEntry("SlideShowStartCurrent", d->startWithCurrent->isChecked());
154
 
    group.writeEntry("SlideShowLoop", d->loopMode->isChecked());
155
 
    group.writeEntry("SlideShowPrintName", d->showName->isChecked());
156
 
    group.writeEntry("SlideShowPrintDate", d->showDate->isChecked());
157
 
    group.writeEntry("SlideShowPrintApertureFocal", d->showApertureFocal->isChecked());
158
 
    group.writeEntry("SlideShowPrintExpoSensitivity", d->showExpoSensitivity->isChecked());
159
 
    group.writeEntry("SlideShowPrintMakeModel", d->showMakeModel->isChecked());
160
 
    group.writeEntry("SlideShowPrintComment", d->showComment->isChecked());
161
 
    group.writeEntry("SlideShowPrintRating", d->showRating->isChecked());
 
178
    group.writeEntry(d->configSlideShowDelayEntry,                d->delayInput->value());
 
179
    group.writeEntry(d->configSlideShowStartCurrentEntry,         d->startWithCurrent->isChecked());
 
180
    group.writeEntry(d->configSlideShowLoopEntry,                 d->loopMode->isChecked());
 
181
    group.writeEntry(d->configSlideShowPrintNameEntry,            d->showName->isChecked());
 
182
    group.writeEntry(d->configSlideShowPrintDateEntry,            d->showDate->isChecked());
 
183
    group.writeEntry(d->configSlideShowPrintApertureFocalEntry,   d->showApertureFocal->isChecked());
 
184
    group.writeEntry(d->configSlideShowPrintExpoSensitivityEntry, d->showExpoSensitivity->isChecked());
 
185
    group.writeEntry(d->configSlideShowPrintMakeModelEntry,       d->showMakeModel->isChecked());
 
186
    group.writeEntry(d->configSlideShowPrintCommentEntry,         d->showComment->isChecked());
 
187
    group.writeEntry(d->configSlideShowPrintRatingEntry,          d->showRating->isChecked());
162
188
    config->sync();
163
189
}
164
190
 
165
191
void SetupSlideShow::readSettings()
166
192
{
167
193
    KSharedConfig::Ptr config = KGlobal::config();
168
 
    KConfigGroup group        = config->group(QString("ImageViewer Settings"));
 
194
    KConfigGroup group        = config->group(d->configGroupName);
169
195
 
170
 
    d->delayInput->setValue(group.readEntry("SlideShowDelay", 5));
171
 
    d->startWithCurrent->setChecked(group.readEntry("SlideShowStartCurrent", false));
172
 
    d->loopMode->setChecked(group.readEntry("SlideShowLoop", false));
173
 
    d->showName->setChecked(group.readEntry("SlideShowPrintName", true));
174
 
    d->showDate->setChecked(group.readEntry("SlideShowPrintDate", false));
175
 
    d->showApertureFocal->setChecked(group.readEntry("SlideShowPrintApertureFocal", false));
176
 
    d->showExpoSensitivity->setChecked(group.readEntry("SlideShowPrintExpoSensitivity", false));
177
 
    d->showMakeModel->setChecked(group.readEntry("SlideShowPrintMakeModel", false));
178
 
    d->showComment->setChecked(group.readEntry("SlideShowPrintComment", false));
179
 
    d->showRating->setChecked(group.readEntry("SlideShowPrintRating", false));
 
196
    d->delayInput->setValue(group.readEntry(d->configSlideShowDelayEntry,                           5));
 
197
    d->startWithCurrent->setChecked(group.readEntry(d->configSlideShowStartCurrentEntry,            false));
 
198
    d->loopMode->setChecked(group.readEntry(d->configSlideShowLoopEntry,                            false));
 
199
    d->showName->setChecked(group.readEntry(d->configSlideShowPrintNameEntry,                       true));
 
200
    d->showDate->setChecked(group.readEntry(d->configSlideShowPrintDateEntry,                       false));
 
201
    d->showApertureFocal->setChecked(group.readEntry(d->configSlideShowPrintApertureFocalEntry,     false));
 
202
    d->showExpoSensitivity->setChecked(group.readEntry(d->configSlideShowPrintExpoSensitivityEntry, false));
 
203
    d->showMakeModel->setChecked(group.readEntry(d->configSlideShowPrintMakeModelEntry,             false));
 
204
    d->showComment->setChecked(group.readEntry(d->configSlideShowPrintCommentEntry,                 false));
 
205
    d->showRating->setChecked(group.readEntry(d->configSlideShowPrintRatingEntry,                   false));
180
206
}
181
207
 
182
208
}   // namespace Digikam