~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/utilities/lighttable/lighttablewindow.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.2.15 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080717202539-6n7dtirbkoo7qvhd
Tags: 2:0.9.4-1
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * Date        : 2007-03-05
7
7
 * Description : digiKam light table GUI
8
8
 *
9
 
 * Copyright (C) 2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
9
 * Copyright (C) 2007-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
10
10
 *
11
11
 * This program is free software; you can redistribute it
12
12
 * and/or modify it under the terms of the GNU General
57
57
#include "setup.h"
58
58
#include "syncjob.h"
59
59
#include "thumbnailsize.h"
 
60
#include "rawcameradlg.h"
60
61
#include "lighttablepreview.h"
61
62
#include "lighttablewindowprivate.h"
62
63
#include "lighttablewindow.h"
155
156
    d->autoSyncPreview       = config->readBoolEntry("Auto Sync Preview",       true);
156
157
    d->fullScreenHideToolBar = config->readBoolEntry("FullScreen Hide ToolBar", false);
157
158
    d->previewView->setLoadFullImageSize(config->readBoolEntry("Load Full Image size", false));
 
159
    refreshView();
 
160
}
 
161
 
 
162
void LightTableWindow::refreshView()
 
163
{
 
164
    d->leftSidebar->refreshTagsView();
 
165
    d->rightSidebar->refreshTagsView();
158
166
}
159
167
 
160
168
void LightTableWindow::closeEvent(QCloseEvent* e)
178
186
    QWidget* centralW = new QWidget(d->hSplitter);
179
187
    QVBoxLayout *vlay = new QVBoxLayout(centralW);
180
188
    d->vSplitter      = new QSplitter(Qt::Vertical, centralW);
181
 
    d->barView        = new LightTableBar(d->vSplitter, ThumbBarView::Horizontal, 
 
189
    d->barView        = new LightTableBar(d->vSplitter, ThumbBarView::Horizontal,
182
190
                                          AlbumSettings::instance()->getExifRotate());
183
191
    d->previewView    = new LightTableView(d->vSplitter);
184
192
    vlay->addWidget(d->vSplitter);
212
220
 
213
221
    d->statusProgressBar = new StatusProgressBar(statusBar());
214
222
    d->statusProgressBar->setAlignment(Qt::AlignCenter);
215
 
    d->statusProgressBar->setMaximumHeight(fontMetrics().height()+2);    
 
223
    d->statusProgressBar->setMaximumHeight(fontMetrics().height()+2);
216
224
    statusBar()->addWidget(d->statusProgressBar, 100);
217
 
 
 
225
 
218
226
    d->rightZoomBar = new StatusZoomBar(statusBar());
219
227
    d->rightZoomBar->setMaximumHeight(fontMetrics().height()+2);
220
228
    statusBar()->addWidget(d->rightZoomBar, 1);
226
234
    connect(d->statusProgressBar, SIGNAL(signalCancelButtonPressed()),
227
235
           this, SLOT(slotProgressBarCancelButtonPressed()));
228
236
 
 
237
    connect(ThemeEngine::instance(), SIGNAL(signalThemeChanged()),
 
238
            this, SLOT(slotThemeChanged()));
 
239
 
229
240
    // Thumbs bar connections ---------------------------------------
230
241
 
231
242
    connect(d->barView, SIGNAL(signalSetItemOnLeftPanel(ImageInfo*)),
291
302
 
292
303
    connect(d->previewView, SIGNAL(signalRightDroppedItems(const ImageInfoList&)),
293
304
           this, SLOT(slotRightDroppedItems(const ImageInfoList&)));
294
 
                                  
 
305
 
295
306
    connect(d->previewView, SIGNAL(signalToggleOnSyncPreview(bool)),
296
307
           this, SLOT(slotToggleOnSyncPreview(bool)));
297
308
 
332
343
                                actionCollection(), "lighttable_last");
333
344
    d->lastAction->setEnabled(false);
334
345
 
335
 
    d->setItemLeftAction = new KAction(i18n("Show item on left panel"), "previous",
 
346
    d->setItemLeftAction = new KAction(i18n("On Left"), "previous",
336
347
                                       CTRL+Key_L, this, SLOT(slotSetItemLeft()),
337
348
                                       actionCollection(), "lighttable_setitemleft");
338
349
    d->setItemLeftAction->setEnabled(false);
 
350
    d->setItemLeftAction->setWhatsThis(i18n("Show item on left panel"));
339
351
 
340
 
    d->setItemRightAction = new KAction(i18n("Show item on right panel"), "next",
 
352
    d->setItemRightAction = new KAction(i18n("On Right"), "next",
341
353
                                       CTRL+Key_R, this, SLOT(slotSetItemRight()),
342
354
                                       actionCollection(), "lighttable_setitemright");
343
355
    d->setItemRightAction->setEnabled(false);
 
356
    d->setItemRightAction->setWhatsThis(i18n("Show item on right panel"));
344
357
 
345
358
    d->editItemAction = new KAction(i18n("Edit"), "editimage",
346
359
                                       Key_F4, this, SLOT(slotEditItem()),
367
380
 
368
381
    // -- Standard 'View' menu actions ---------------------------------------------
369
382
 
370
 
    d->syncPreviewAction = new KToggleAction(i18n("Synchronize Preview"), "goto",
 
383
    d->syncPreviewAction = new KToggleAction(i18n("Synchronize"), "goto",
371
384
                                            CTRL+SHIFT+Key_Y, this,
372
385
                                            SLOT(slotToggleSyncPreview()),
373
386
                                            actionCollection(), "lighttable_syncpreview");
374
387
    d->syncPreviewAction->setEnabled(false);
 
388
    d->syncPreviewAction->setWhatsThis(i18n("Synchronize preview from left and right panels"));
375
389
 
376
 
    d->navigateByPairAction = new KToggleAction(i18n("Navigate by Pair"), "kcmsystem",
 
390
    d->navigateByPairAction = new KToggleAction(i18n("By Pair"), "kcmsystem",
377
391
                                            CTRL+SHIFT+Key_P, this,
378
392
                                            SLOT(slotToggleNavigateByPair()),
379
393
                                            actionCollection(), "lighttable_navigatebypair");
380
394
    d->navigateByPairAction->setEnabled(false);
 
395
    d->navigateByPairAction->setWhatsThis(i18n("Navigate by pair with all items"));
381
396
 
382
397
    d->zoomPlusAction = KStdAction::zoomIn(d->previewView, SLOT(slotIncreaseZoom()),
383
398
                                          actionCollection(), "lighttable_zoomplus");
396
411
                                           CTRL+SHIFT+Key_E, this, SLOT(slotFitToWindow()),
397
412
                                           actionCollection(), "lighttable_zoomfit2window");
398
413
 
399
 
#if KDE_IS_VERSION(3,2,0)
400
 
    d->fullScreenAction = KStdAction::fullScreen(this, SLOT(slotToggleFullScreen()),
401
 
                                                 actionCollection(), this, "lighttable_fullscreen");
402
 
#else
403
 
    d->fullScreenAction = new KToggleAction(i18n("Fullscreen"), "window_fullscreen",
 
414
    // Do not use std KDE action for full screen because action text is too large for app. toolbar.
 
415
    d->fullScreenAction = new KToggleAction(i18n("Full Screen"), "window_fullscreen",
404
416
                                            CTRL+SHIFT+Key_F, this,
405
417
                                            SLOT(slotToggleFullScreen()),
406
418
                                            actionCollection(), "lighttable_fullscreen");
407
 
#endif
 
419
    d->fullScreenAction->setWhatsThis(i18n("Toggle the window to full screen mode"));
408
420
 
409
 
    d->slideShowAction = new KAction(i18n("Slide Show"), "slideshow", Key_F9,
 
421
    d->slideShowAction = new KAction(i18n("Slide"), "slideshow", Key_F9,
410
422
                                     this, SLOT(slotToggleSlideShow()),
411
423
                                     actionCollection(),"lighttable_slideshow");
412
424
 
416
428
    KStdAction::configureToolbars(this, SLOT(slotConfToolbars()), actionCollection());
417
429
    KStdAction::preferences(this, SLOT(slotSetup()),              actionCollection());
418
430
 
 
431
    // -----------------------------------------------------------------------------------------
 
432
 
 
433
    d->themeMenuAction = new KSelectAction(i18n("&Themes"), 0, actionCollection(), "theme_menu");
 
434
    connect(d->themeMenuAction, SIGNAL(activated(const QString&)),
 
435
            this, SLOT(slotChangeTheme(const QString&)));
 
436
 
 
437
    d->themeMenuAction->setItems(ThemeEngine::instance()->themeNames());
 
438
    slotThemeChanged();
 
439
 
419
440
    // -- Standard 'Help' menu actions ---------------------------------------------
420
441
 
421
442
 
422
 
    d->donateMoneyAction = new KAction(i18n("Donate Money..."),
 
443
    d->donateMoneyAction = new KAction(i18n("Donate..."),
423
444
                                       0, 0, 
424
445
                                       this, SLOT(slotDonateMoney()),
425
446
                                       actionCollection(),
426
 
                                       "lighttable_donatemoney");    
 
447
                                       "lighttable_donatemoney");
 
448
 
 
449
    d->contributeAction = new KAction(i18n("Contribute..."),
 
450
                                      0, 0, 
 
451
                                      this, SLOT(slotContribute()),
 
452
                                      actionCollection(),
 
453
                                      "lighttable_contribute");
 
454
 
 
455
    d->rawCameraListAction = new KAction(i18n("RAW camera supported"), 
 
456
                                         "kdcraw", 
 
457
                                         0, 
 
458
                                         this,
 
459
                                         SLOT(slotRawCameraList()),
 
460
                                         actionCollection(),
 
461
                                         "lighttable_rawcameralist");
 
462
 
427
463
 
428
464
    // Provides a menu entry that allows showing/hiding the toolbar(s)
429
465
    setStandardToolBarMenuEnabled(true);
433
469
 
434
470
    // -- Rating actions ---------------------------------------------------------------
435
471
 
436
 
    d->star0 = new KAction(i18n("Assign Rating \"No Star\""), CTRL+Key_0,
 
472
    d->star0 = new KAction(i18n("Assign Rating \"No Stars\""), CTRL+Key_0,
437
473
                          d->barView, SLOT(slotAssignRatingNoStar()),
438
474
                          actionCollection(), "lighttable_ratenostar");
439
475
    d->star1 = new KAction(i18n("Assign Rating \"One Star\""), CTRL+Key_1,
455
491
    // ---------------------------------------------------------------------------------
456
492
 
457
493
    new DLogoAction(actionCollection(), "logo_action");
458
 
    
 
494
 
459
495
    createGUI("lighttablewindowui.rc", false);
460
496
}
461
497
 
464
500
    d->accelerators = new KAccel(this);
465
501
 
466
502
    d->accelerators->insert("Exit fullscreen", i18n("Exit Fullscreen mode"),
467
 
                    i18n("Exit from fullscreen viewing mode"),
 
503
                    i18n("Exit fullscreen viewing mode"),
468
504
                    Key_Escape, this, SLOT(slotEscapePressed()),
469
505
                    false, true);
470
506
 
473
509
                    Key_Space, this, SLOT(slotForward()),
474
510
                    false, true);
475
511
 
 
512
    d->accelerators->insert("Previous Image SHIFT+Key_Space", i18n("Previous Image"),
 
513
                    i18n("Load Previous Image"),
 
514
                    SHIFT+Key_Space, this, SLOT(slotBackward()),
 
515
                    false, true);
 
516
 
476
517
    d->accelerators->insert("Previous Image Key_Backspace", i18n("Previous Image"),
477
518
                    i18n("Load Previous Image"),
478
519
                    Key_Backspace, this, SLOT(slotBackward()),
492
533
                    i18n("Zoom in on image"),
493
534
                    Key_Plus, d->previewView, SLOT(slotIncreaseZoom()),
494
535
                    false, true);
495
 
    
 
536
 
496
537
    d->accelerators->insert("Zoom Plus Key_Minus", i18n("Zoom out"),
497
 
                    i18n("Zoom out of image"),
 
538
                    i18n("Zoom out from image"),
498
539
                    Key_Minus, d->previewView, SLOT(slotDecreaseZoom()),
499
540
                    false, true);
500
541
}
505
546
    // Setting the third parameter of loadImageInfos to true 
506
547
    // means that the images are added to the presently available images.
507
548
    loadImageInfos(list, 0, true);
508
 
    setLeftRightItems(list);
509
549
}
510
550
 
511
551
// We get here either
552
592
        {
553
593
            new LightTableBarItem(d->barView, *it);
554
594
        }
555
 
    }   
 
595
    }
556
596
    d->barView->blockSignals(false);
557
 
    
 
597
 
558
598
    // if window is iconified, show it
559
599
    if (isMinimized())
560
600
    {
562
602
    }
563
603
 
564
604
    refreshStatusBar();
565
 
}   
 
605
}
566
606
 
567
607
void LightTableWindow::refreshStatusBar()
568
608
{
569
609
    switch (d->barView->countItems())
570
610
    {
571
611
        case 0:
572
 
            d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, 
573
 
                                                  i18n("No item on Light Table"));   
 
612
            d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode,
 
613
                                                  i18n("No item on Light Table"));
574
614
            break;
575
615
        case 1:
576
 
            d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, 
577
 
                                                  i18n("1 item on Light Table"));   
 
616
            d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode,
 
617
                                                  i18n("1 item on Light Table"));
578
618
            break;
579
619
        default:
580
 
            d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, 
 
620
            d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode,
581
621
                                                  i18n("%1 items on Light Table")
582
 
                                                  .arg(d->barView->countItems()));   
 
622
                                                  .arg(d->barView->countItems()));
583
623
            break;
584
 
    }  
 
624
    }
585
625
}
586
626
 
587
627
void LightTableWindow::slotItemsUpdated(const KURL::List& urls)
598
638
                d->leftSidebar->itemChanged(d->previewView->leftImageInfo());
599
639
            }
600
640
        }
601
 
    
 
641
 
602
642
        if (d->previewView->rightImageInfo())
603
643
        {
604
644
            if (d->previewView->rightImageInfo()->kurl() == *it)
633
673
    {
634
674
        d->previewView->checkForSelection(d->barView->currentItemImageInfo());
635
675
        d->barView->setOnLeftPanel(d->previewView->leftImageInfo());
636
 
    
 
676
 
637
677
        LightTableBarItem *item = d->barView->findItemByInfo(d->previewView->leftImageInfo());
638
678
        if (item) item->setOnLeftPanel(true);
639
 
    
 
679
 
640
680
        if (d->navigateByPairAction->isChecked() && item)
641
681
        {
642
682
            LightTableBarItem* next = dynamic_cast<LightTableBarItem*>(item->next());
661
701
    {
662
702
        d->previewView->checkForSelection(d->barView->currentItemImageInfo());
663
703
        d->barView->setOnRightPanel(d->previewView->rightImageInfo());
664
 
    
 
704
 
665
705
        LightTableBarItem *item = d->barView->findItemByInfo(d->previewView->rightImageInfo());
666
706
        if (item) item->setOnRightPanel(true);
667
707
    }
685
725
        d->zoomPlusAction->setEnabled(true);
686
726
        d->zoomMinusAction->setEnabled(true);
687
727
        d->navigateByPairAction->setEnabled(true);
 
728
        d->slideShowAction->setEnabled(true);
688
729
 
689
730
        LightTableBarItem* curr = d->barView->findItemByInfo(info);
690
731
        if (curr)
694
735
                d->backwardAction->setEnabled(false);
695
736
                d->firstAction->setEnabled(false);
696
737
            }
697
 
    
 
738
 
698
739
            if (!curr->next())
699
740
            {
700
741
                d->forwardAction->setEnabled(false);
705
746
            {
706
747
                d->setItemLeftAction->setEnabled(false);
707
748
                d->setItemRightAction->setEnabled(false);
708
 
  
 
749
 
709
750
                d->barView->setOnLeftPanel(info);
710
751
                slotSetItemOnLeftPanel(info);
711
752
            }
732
773
        d->zoomMinusAction->setEnabled(false);
733
774
        d->syncPreviewAction->setEnabled(false);
734
775
        d->navigateByPairAction->setEnabled(false);
 
776
        d->slideShowAction->setEnabled(false);
735
777
    }
736
778
 
737
779
    d->previewView->checkForSelection(info);
738
 
}    
 
780
}
739
781
 
740
782
// Deal with one (or more) items dropped onto the left panel
741
783
void LightTableWindow::slotLeftDroppedItems(const ImageInfoList& list)
745
787
    loadImageInfos(list, info, true);
746
788
 
747
789
    // We will check if first item from list is already stored in thumbbar
748
 
    // Note that the thumbbar stores all ImageInfo reference 
 
790
    // Note that the thumbbar stores all ImageInfo reference
749
791
    // in memory for preview object.
750
792
    LightTableBarItem *item = d->barView->findItemByInfo(info);
751
793
    if (item) 
753
795
        slotSetItemOnLeftPanel(item->info());
754
796
        // One approach is to make this item the current one, via
755
797
        //    d->barView->setSelectedItem(item);
756
 
        // However, this is not good, because this also sets 
 
798
        // However, this is not good, because this also sets
757
799
        // the right thumb to the same image.
758
 
        // Therefore we use setLeftRightItems if there is more than 
759
 
        // one item in the list of dropped images.        
 
800
        // Therefore we use setLeftRightItems if there is more than
 
801
        // one item in the list of dropped images.
760
802
    }
761
 
    setLeftRightItems(list);
762
803
}
763
804
 
764
805
// Deal with one (or more) items dropped onto the right panel
767
808
    ImageInfo *info = *(list.begin());
768
809
    // add the image to the existing images
769
810
    loadImageInfos(list, info, true);
770
 
    setLeftRightItems(list);
771
811
 
772
812
    // We will check if first item from list is already stored in thumbbar
773
 
    // Note that the thumbbar stores all ImageInfo reference 
 
813
    // Note that the thumbbar stores all ImageInfo reference
774
814
    // in memory for preview object.
775
815
    LightTableBarItem *item = d->barView->findItemByInfo(info);
776
816
    if (item) 
782
822
}
783
823
 
784
824
// Set the images for the left and right panel.
785
 
void LightTableWindow::setLeftRightItems(const ImageInfoList &list)
 
825
void LightTableWindow::setLeftRightItems(const ImageInfoList &list, bool addTo)
786
826
{
787
827
    ImageInfoList l = list;
788
828
 
789
 
    if (l.count()==0)
 
829
    if (l.count() == 0)
790
830
        return;
791
 
    
792
 
 
793
 
    ImageInfo *info = l.first();
794
 
 
795
 
    LightTableBarItem *ltItem = dynamic_cast<LightTableBarItem*>(d->barView->findItemByInfo(info));
796
 
 
797
 
 
798
 
    if (l.count()==1)
 
831
 
 
832
    ImageInfo *info           = l.first();
 
833
    LightTableBarItem *ltItem = d->barView->findItemByInfo(info);
 
834
 
 
835
    if (l.count() == 1 && !addTo)
799
836
    {
800
837
        // Just one item; this is used for the left panel.
801
838
        d->barView->setOnLeftPanel(info);
808
845
    if (ltItem)
809
846
    {
810
847
        // The first item is used for the left panel.
811
 
        d->barView->setOnLeftPanel(info);
812
 
        slotSetItemOnLeftPanel(info);
 
848
        if (!addTo)
 
849
        {
 
850
            d->barView->setOnLeftPanel(info);
 
851
            slotSetItemOnLeftPanel(info);
 
852
        }
813
853
 
814
854
        // The subsequent item is used for the right panel.
815
855
        LightTableBarItem* next = dynamic_cast<LightTableBarItem*>(ltItem->next());
816
 
        if (next)
 
856
        if (next && !addTo)
817
857
        {
818
858
            d->barView->setOnRightPanel(next->info());
819
859
            slotSetItemOnRightPanel(next->info());
833
873
            d->barView->setSelectedItem(ltItem); 
834
874
            d->barView->ensureItemVisible(ltItem);
835
875
        }
836
 
 
837
876
    }
838
 
 
839
877
}
840
878
 
841
879
void LightTableWindow::slotSetItemLeft()
1096
1134
        {
1097
1135
            // See if there is an item next to the left one:
1098
1136
            LightTableBarItem *ltItem = d->barView->findItemByInfo(new_linfo);
1099
 
            LightTableBarItem* next   = dynamic_cast<LightTableBarItem*>(ltItem->next());
 
1137
            LightTableBarItem* next   = 0;
 
1138
            // re-check if ltItem is really set
 
1139
            if (ltItem)
 
1140
            {
 
1141
                next = dynamic_cast<LightTableBarItem*>(ltItem->next());
 
1142
            }
1100
1143
            if (next)
1101
1144
            {
1102
1145
                new_rinfo = next->info();
1104
1147
            else
1105
1148
            {
1106
1149
                // If there is no item to the right of new_linfo
1107
 
                // then we can choose the first item for new_rinfo
 
1150
                // then we can choose the last item for new_rinfo
1108
1151
                // (as we made sure that there are at least two items)
1109
 
                LightTableBarItem* first = dynamic_cast<LightTableBarItem*>(d->barView->firstItem());
1110
 
                new_rinfo = first->info();
 
1152
                LightTableBarItem* last = dynamic_cast<LightTableBarItem*>(d->barView->lastItem());
 
1153
                new_rinfo               = last->info();
1111
1154
            }
1112
1155
        }
1113
1156
    }
1183
1226
    ImageInfoList list = d->barView->itemsImageInfoList();
1184
1227
 
1185
1228
    im->loadImageInfos(list, info, i18n("Light Table"), true);
1186
 
    
 
1229
 
1187
1230
    if (im->isHidden())
1188
1231
        im->show();
1189
1232
    else
1190
1233
        im->raise();
1191
 
        
 
1234
 
1192
1235
    im->setFocus();
1193
1236
}
1194
1237
 
1195
1238
void LightTableWindow::slotZoomTo100Percents()
1196
1239
{
1197
 
    d->previewView->setLeftZoomFactor(1.0);
1198
 
    d->previewView->setRightZoomFactor(1.0);
 
1240
    d->previewView->toggleFitToWindowOr100();
1199
1241
}
1200
1242
 
1201
1243
void LightTableWindow::slotFitToWindow()
1210
1252
    bool startWithCurrent = config->readBoolEntry("SlideShowStartCurrent", false);
1211
1253
 
1212
1254
    SlideShowSettings settings;
 
1255
    settings.exifRotate           = AlbumSettings::instance()->getExifRotate();
1213
1256
    settings.delay                = config->readNumEntry("SlideShowDelay", 5) * 1000;
1214
1257
    settings.printName            = config->readBoolEntry("SlideShowPrintName", true);
1215
1258
    settings.printDate            = config->readBoolEntry("SlideShowPrintDate", false);
1223
1266
 
1224
1267
void LightTableWindow::slideShow(bool startWithCurrent, SlideShowSettings& settings)
1225
1268
{
1226
 
    int       i = 0;
 
1269
    if (!d->barView->countItems()) return;
 
1270
 
1227
1271
    DMetadata meta;
 
1272
    int              i = 0;
1228
1273
    d->cancelSlideShow = false;
1229
1274
 
1230
1275
    d->statusProgressBar->progressBarMode(StatusProgressBar::CancelProgressBarMode, 
1253
1298
        kapp->processEvents();
1254
1299
    }
1255
1300
 
1256
 
    d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, QString());   
 
1301
    d->statusProgressBar->progressBarMode(StatusProgressBar::TextMode, QString());
1257
1302
    refreshStatusBar();
1258
1303
 
1259
1304
    if (!d->cancelSlideShow)
1260
1305
    {
1261
1306
        settings.exifRotate = AlbumSettings::instance()->getExifRotate();
1262
 
    
 
1307
 
1263
1308
        SlideShow *slide = new SlideShow(settings);
1264
1309
        if (startWithCurrent)
1265
1310
            slide->setCurrent(d->barView->currentItemImageInfo()->kurl());
1266
 
    
 
1311
 
1267
1312
        slide->show();
1268
1313
    }
1269
1314
}
1289
1334
        rightDock()->show();
1290
1335
        topDock()->show();
1291
1336
        bottomDock()->show();
1292
 
        
 
1337
 
1293
1338
        QObject* obj = child("ToolBar","KToolBar");
1294
 
        
 
1339
 
1295
1340
        if (obj)
1296
1341
        {
1297
1342
            KToolBar* toolBar = static_cast<KToolBar*>(obj);
1298
 
            
 
1343
 
1299
1344
            if (d->fullScreenAction->isPlugged(toolBar) && d->removeFullScreenButton)
1300
1345
                d->fullScreenAction->unplug(toolBar);
1301
 
                
 
1346
 
1302
1347
            if (toolBar->isHidden())
1303
1348
                showToolBars();
1304
1349
        }
1312
1357
            d->leftSidebar->restore();
1313
1358
            d->rightSidebar->restore();
1314
1359
        }
1315
 
        else       
 
1360
        else
1316
1361
        {
1317
 
            d->leftSidebar->backup();        
1318
 
            d->rightSidebar->backup();        
 
1362
            d->leftSidebar->backup();
 
1363
            d->rightSidebar->backup();
1319
1364
        }
1320
 
        
 
1365
 
1321
1366
        d->fullScreen = false;
1322
1367
    }
1323
1368
    else  // go to fullscreen
1329
1374
        leftDock()->hide();
1330
1375
        rightDock()->hide();
1331
1376
        bottomDock()->hide();
1332
 
        
 
1377
 
1333
1378
        QObject* obj = child("ToolBar","KToolBar");
1334
 
        
 
1379
 
1335
1380
        if (obj)
1336
1381
        {
1337
1382
            KToolBar* toolBar = static_cast<KToolBar*>(obj);
1338
 
            
 
1383
 
1339
1384
            if (d->fullScreenHideToolBar)
1340
1385
            {
1341
1386
                hideToolBars();
1342
1387
            }
1343
1388
            else
1344
 
            {   
 
1389
            {
1345
1390
                showToolBars();
1346
1391
 
1347
1392
                if ( !d->fullScreenAction->isPlugged(toolBar) )
1369
1414
        }
1370
1415
        else
1371
1416
        {
1372
 
            d->leftSidebar->backup();        
1373
 
            d->rightSidebar->backup();        
 
1417
            d->leftSidebar->backup();
 
1418
            d->rightSidebar->backup();
1374
1419
        }
1375
1420
 
1376
1421
        showFullScreen();
1392
1437
    for( ; it.current()!=0L ; ++it)
1393
1438
    {
1394
1439
        bar=it.current();
1395
 
        
 
1440
 
1396
1441
        if (bar->area())
1397
1442
            bar->area()->show();
1398
1443
        else
1408
1453
    for( ; it.current()!=0L ; ++it)
1409
1454
    {
1410
1455
        bar=it.current();
1411
 
        
 
1456
 
1412
1457
        if (bar->area()) 
1413
1458
            bar->area()->hide();
1414
1459
        else 
1439
1484
    KApplication::kApplication()->invokeBrowser("http://www.digikam.org/?q=donation");
1440
1485
}
1441
1486
 
 
1487
void LightTableWindow::slotContribute()
 
1488
{
 
1489
    KApplication::kApplication()->invokeBrowser("http://www.digikam.org/?q=contrib");
 
1490
}
 
1491
 
1442
1492
void LightTableWindow::slotEditKeys()
1443
1493
{
1444
1494
    KKeyDialog dialog(true, this);
1464
1514
 
1465
1515
void LightTableWindow::slotSetup()
1466
1516
{
1467
 
    Setup setup(this, 0);    
1468
 
        
 
1517
    Setup setup(this, 0);
 
1518
 
1469
1519
    if (setup.exec() != QDialog::Accepted)
1470
1520
        return;
1471
1521
 
1472
1522
    kapp->config()->sync();
1473
 
    
 
1523
 
1474
1524
    applySettings();
1475
1525
}
1476
1526
 
1522
1572
 
1523
1573
void LightTableWindow::slotToggleSyncPreview()
1524
1574
{
1525
 
    d->previewView->setSyncPreview(d->syncPreviewAction->isChecked());    
 
1575
    d->previewView->setSyncPreview(d->syncPreviewAction->isChecked());
1526
1576
}
1527
1577
 
1528
1578
void LightTableWindow::slotToggleOnSyncPreview(bool t)
1571
1621
    slotItemSelected(d->barView->currentItemImageInfo());
1572
1622
}
1573
1623
 
 
1624
void LightTableWindow::slotRawCameraList()
 
1625
{
 
1626
    RawCameraDlg dlg(this);
 
1627
    dlg.exec();
 
1628
}
 
1629
 
 
1630
void LightTableWindow::slotThemeChanged()
 
1631
{
 
1632
    QStringList themes(ThemeEngine::instance()->themeNames());
 
1633
    int index = themes.findIndex(AlbumSettings::instance()->getCurrentTheme());
 
1634
    if (index == -1)
 
1635
        index = themes.findIndex(i18n("Default"));
 
1636
 
 
1637
    d->themeMenuAction->setCurrentItem(index);
 
1638
}
 
1639
 
 
1640
void LightTableWindow::slotChangeTheme(const QString& theme)
 
1641
{
 
1642
    AlbumSettings::instance()->setCurrentTheme(theme);
 
1643
    ThemeEngine::instance()->slotChangeTheme(theme);
 
1644
}
 
1645
 
1574
1646
}  // namespace Digikam
1575