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

« back to all changes in this revision

Viewing changes to libs/widgets/common/dzoombar.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:
83
83
    DTipTracker* zoomTracker;
84
84
};
85
85
 
86
 
DZoomBar::DZoomBar(QWidget *parent)
87
 
        : KHBox(parent), d(new DZoomBarPriv)
 
86
DZoomBar::DZoomBar(QWidget* parent)
 
87
    : KHBox(parent), d(new DZoomBarPriv)
88
88
{
89
89
    setAttribute(Qt::WA_DeleteOnClose);
90
90
    setFocusPolicy(Qt::NoFocus);
166
166
DZoomBar::~DZoomBar()
167
167
{
168
168
    if (d->zoomTimer)
 
169
    {
169
170
        delete d->zoomTimer;
 
171
    }
170
172
 
171
173
    delete d;
172
174
}
276
278
{
277
279
    bool ok     = false;
278
280
    double zoom = d->zoomCombo->itemData(index).toDouble(&ok) / 100.0;
 
281
 
279
282
    if (ok && zoom > 0.0)
 
283
    {
280
284
        emit signalZoomValueEdited(zoom);
 
285
    }
281
286
}
282
287
 
283
288
void DZoomBar::slotZoomTextChanged(const QString& txt)
284
289
{
285
290
    bool ok     = false;
286
291
    double zoom = KGlobal::locale()->readNumber(txt, &ok) / 100.0;
 
292
 
287
293
    if (ok && zoom > 0.0)
 
294
    {
288
295
        emit signalZoomValueEdited(zoom);
 
296
    }
289
297
}
290
298
 
291
299
void DZoomBar::setBarMode(BarMode mode)
293
301
    QAction* zfitAction = d->zoomToFitButton->defaultAction();
294
302
    QAction* z100Action = d->zoomTo100Button->defaultAction();
295
303
 
296
 
    switch(mode)
 
304
    switch (mode)
297
305
    {
298
306
        case PreviewZoomCtrl:
299
307
        {
300
308
            d->zoomToFitButton->show();
301
 
            if (zfitAction) zfitAction->setEnabled(true);
 
309
 
 
310
            if (zfitAction)
 
311
            {
 
312
                zfitAction->setEnabled(true);
 
313
            }
 
314
 
302
315
            d->zoomTo100Button->show();
303
 
            if (z100Action) z100Action->setEnabled(true);
 
316
 
 
317
            if (z100Action)
 
318
            {
 
319
                z100Action->setEnabled(true);
 
320
            }
 
321
 
304
322
            d->zoomCombo->show();
305
323
            d->zoomCombo->setEnabled(true);
306
324
            d->zoomTracker->setEnable(false);
309
327
        case ThumbsSizeCtrl:
310
328
        {
311
329
            d->zoomToFitButton->show();
312
 
            if (zfitAction) zfitAction->setEnabled(false);
 
330
 
 
331
            if (zfitAction)
 
332
            {
 
333
                zfitAction->setEnabled(false);
 
334
            }
 
335
 
313
336
            d->zoomTo100Button->show();
314
 
            if (z100Action) z100Action->setEnabled(false);
 
337
 
 
338
            if (z100Action)
 
339
            {
 
340
                z100Action->setEnabled(false);
 
341
            }
 
342
 
315
343
            d->zoomCombo->show();
316
344
            d->zoomCombo->setEnabled(false);
317
345
            d->zoomTracker->setEnable(true);