9
9
* Copyright (C) 2002-2005 by Renchi Raju <renchi@pooh.tam.uiuc.edu>
10
10
* Copyright (C) 2006 by Tom Albers <tomalbers@kde.nl>
11
* Copyright (C) 2002-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
11
* Copyright (C) 2002-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
13
13
* This program is free software; you can redistribute it
14
14
* and/or modify it under the terms of the GNU General
115
118
d->splashScreen->show();
122
d->splashScreen->message(i18n("Initializing..."), AlignLeft, white);
124
// Register image formats (especially for TIFF )
125
KImageIO::registerFormats();
118
127
d->albumSettings = new AlbumSettings();
119
128
d->albumSettings->readSettings();
121
d->albumManager = AlbumManager::instance();
130
d->albumManager = new Digikam::AlbumManager();
122
132
AlbumLister::instance();
124
134
d->cameraMediaList = new KPopupMenu;
156
166
KDcrawIface::DcrawBinary::instance()->checkSystem();
158
// Actual file scanning is done in main() - is this necessary here?
159
d->albumManager->setLibraryPath(d->albumSettings->getAlbumLibraryPath());
169
d->splashScreen->message(i18n("Scan Albums"), AlignLeft, white);
171
d->albumManager->setLibraryPath(d->albumSettings->getAlbumLibraryPath(), d->splashScreen);
161
173
// Read albums from database
162
174
if(d->splashScreen)
266
278
// Report errors from dcraw detection.
268
279
KDcrawIface::DcrawBinary::instance()->checkReport();
270
281
// Init album icon view zoom factor.
271
282
slotThumbSizeChanged(d->albumSettings->getDefaultIconSize());
272
slotZoomSliderChanged(d->albumSettings->getDefaultIconSize());
275
285
const QPtrList<KAction>& DigikamApp::menuImageActions()
348
358
connect(d->view, SIGNAL(signalAlbumSelected(bool)),
349
359
this, SLOT(slotAlbumSelected(bool)));
351
361
connect(d->view, SIGNAL(signalTagSelected(bool)),
352
362
this, SLOT(slotTagSelected(bool)));
367
377
d->albumIconViewFilter = new AlbumIconViewFilter(statusBar());
368
378
d->albumIconViewFilter->setMaximumHeight(fontMetrics().height()+4);
369
379
statusBar()->addWidget(d->albumIconViewFilter, 100, true);
371
381
//------------------------------------------------------------------------------
373
383
d->statusZoomBar = new StatusZoomBar(statusBar());
397
407
connect(d->view, SIGNAL(signalZoomChanged(double, int)),
398
408
this, SLOT(slotZoomChanged(double, int)));
400
410
connect(d->view, SIGNAL(signalTogglePreview(bool)),
401
411
this, SLOT(slotTogglePreview(bool)));
413
connect(d->albumIconViewFilter, SIGNAL(signalResetTagFilters()),
414
this, SIGNAL(signalResetTagFilters()));
403
416
connect(d->statusNavigateBar, SIGNAL(signalFirstItem()),
404
417
d->view, SLOT(slotFirstItem()));
424
437
i18n("Exit preview mode"),
425
438
Key_Escape, this, SIGNAL(signalEscapePressed()),
428
441
d->accelerators->insert("Next Image Key_Space", i18n("Next Image"),
429
442
i18n("Next Image"),
430
443
Key_Space, this, SIGNAL(signalNextItem()),
433
d->accelerators->insert("Next Image SHIFT+Key_Space", i18n("Next Image"),
435
SHIFT+Key_Space, this, SIGNAL(signalNextItem()),
446
d->accelerators->insert("Previous Image SHIFT+Key_Space", i18n("Previous Image"),
447
i18n("Previous Image"),
448
SHIFT+Key_Space, this, SIGNAL(signalPrevItem()),
438
451
d->accelerators->insert("Previous Image Key_Backspace", i18n("Previous Image"),
487
500
connect(d->themeMenuAction, SIGNAL(activated(const QString&)),
488
501
this, SLOT(slotChangeTheme(const QString&)));
503
connect(ThemeEngine::instance(), SIGNAL(signalThemeChanged()),
504
this, SLOT(slotThemeChanged()));
490
506
// -----------------------------------------------------------------
492
508
d->backwardActionMenu = new KToolBarPopupAction(i18n("&Back"),
501
517
connect(d->backwardActionMenu->popupMenu(), SIGNAL(aboutToShow()),
502
518
this, SLOT(slotAboutToShowBackwardMenu()));
504
520
connect(d->backwardActionMenu->popupMenu(), SIGNAL(activated(int)),
505
521
d->view, SLOT(slotAlbumHistoryBack(int)));
512
528
actionCollection(),
513
529
"album_forward");
514
530
d->forwardActionMenu->setEnabled(false);
516
532
connect(d->forwardActionMenu->popupMenu(), SIGNAL(aboutToShow()),
517
533
this, SLOT(slotAboutToShowForwardMenu()));
519
535
connect(d->forwardActionMenu->popupMenu(), SIGNAL(activated(int)),
520
536
d->view, SLOT(slotAlbumHistoryForward(int)));
522
d->newAction = new KAction(i18n("&New Album..."),
538
d->newAction = new KAction(i18n("&New..."),
523
539
"albumfolder-new",
524
540
KStdAccel::shortcut(KStdAccel::New),
568
584
connect(d->recurseTagsAction, SIGNAL(toggled(bool)),
569
585
this, SLOT(slotRecurseTags(bool)));
571
d->deleteAction = new KAction(i18n("Delete Album"),
587
d->deleteAction = new KAction(i18n("Delete"),
593
609
actionCollection(),
594
610
"album_importFolder");
596
d->propsEditAction = new KAction( i18n("Album Properties..."),
612
d->propsEditAction = new KAction( i18n("Properties..."),
597
613
"albumfolder-properties",
619
635
actionCollection(),
620
636
"album_syncmetadata");
621
637
d->syncAlbumMetadataAction->setWhatsThis(i18n("Updates all image metadata of the current "
622
"album with digiKam database contents "
623
"(image metadata will be over-written with data from the database)."));
638
"album with the contents of the digiKam database "
639
"(image metadata will be over-written with data from the database)."));
625
641
d->openInKonquiAction = new KAction( i18n("Open in Konqueror"),
670
686
SLOT(slotImageLightTable()),
671
687
actionCollection(),
672
688
"image_lighttable");
673
d->imageLightTableAction->setWhatsThis(i18n("Put the selected items into the light table thumbbar."));
689
d->imageLightTableAction->setWhatsThis(i18n("Place the selected items on the light table thumbbar."));
675
691
d->imageAddLightTableAction = new KAction(i18n("Add to Light Table"),
688
704
SLOT(slotImageRename()),
689
705
actionCollection(),
691
d->imageRenameAction->setWhatsThis(i18n("Rename the filename of the currently selected item."));
707
d->imageRenameAction->setWhatsThis(i18n("Change the filename of the currently selected item."));
693
709
// Pop up dialog to ask user whether to move to trash
694
710
d->imageDeleteAction = new KAction(i18n("Delete"),
747
763
// -----------------------------------------------------------------
749
765
QSignalMapper *exifOrientationMapper = new QSignalMapper( d->view );
751
767
connect(exifOrientationMapper, SIGNAL(mapped(int) ),
752
768
d->view, SLOT(slotImageExifOrientation(int)));
785
801
connect(d->imageSetExifOrientation1Action, SIGNAL(activated()),
786
802
exifOrientationMapper, SLOT(map()));
788
804
connect(d->imageSetExifOrientation2Action, SIGNAL(activated()),
789
805
exifOrientationMapper, SLOT(map()));
791
807
connect(d->imageSetExifOrientation3Action, SIGNAL(activated()),
792
808
exifOrientationMapper, SLOT(map()));
794
810
connect(d->imageSetExifOrientation4Action, SIGNAL(activated()),
795
811
exifOrientationMapper, SLOT(map()));
797
813
connect(d->imageSetExifOrientation5Action, SIGNAL(activated()),
798
814
exifOrientationMapper, SLOT(map()));
800
816
connect(d->imageSetExifOrientation6Action, SIGNAL(activated()),
801
817
exifOrientationMapper, SLOT(map()));
803
819
connect(d->imageSetExifOrientation7Action, SIGNAL(activated()),
804
820
exifOrientationMapper, SLOT(map()));
806
822
connect(d->imageSetExifOrientation8Action, SIGNAL(activated()),
807
823
exifOrientationMapper, SLOT(map()));
881
897
actionCollection(),
882
898
"album_zoomfit2window");
884
#if KDE_IS_VERSION(3,2,0)
885
d->fullScreenAction = KStdAction::fullScreen(this, SLOT(slotToggleFullScreen()),
886
actionCollection(), this, "full_screen");
900
// Do not use std KDE action for full screen because action text is too large for app. toolbar.
888
901
d->fullScreenAction = new KToggleAction(i18n("Full Screen"),
889
902
"window_fullscreen",
890
903
CTRL+SHIFT+Key_F,
892
905
SLOT(slotToggleFullScreen()),
893
906
actionCollection(),
895
d->fullScreenAction->setWhatsThis(i18n("Toggle the main window to full screen mode"));
908
d->fullScreenAction->setWhatsThis(i18n("Switch the window to full screen mode"));
898
d->slideShowAction = new KActionMenu(i18n("Slide Show"), "slideshow",
910
d->slideShowAction = new KActionMenu(i18n("Slide"), "slideshow",
899
911
actionCollection(), "slideshow");
901
913
d->slideShowAction->setDelayed(false);
924
936
actionCollection(),
939
d->rawCameraListAction = new KAction(i18n("RAW camera supported"),
943
SLOT(slotRawCameraList()),
945
"help_rawcameralist");
927
947
d->kipiHelpAction = new KAction(i18n("Kipi Plugins Handbook"),
945
965
actionCollection(),
946
966
"help_donatemoney");
968
d->contributeAction = new KAction(i18n("Contribute..."),
970
this, SLOT(slotContribute()),
948
974
new DLogoAction(actionCollection(), "logo_action" );
950
976
// -- Rating actions ---------------------------------------------------------------
952
d->rating0Star = new KAction(i18n("Assign Rating \"No Star\""), CTRL+Key_0,
978
d->rating0Star = new KAction(i18n("Assign Rating \"No Stars\""), CTRL+Key_0,
953
979
d->view, SLOT(slotAssignRatingNoStar()),
954
980
actionCollection(), "ratenostar");
955
981
d->rating1Star = new KAction(i18n("Assign Rating \"One Star\""), CTRL+Key_1,
973
999
KAction* findAction = KStdAction::find(d->view, SLOT(slotNewQuickSearch()),
974
1000
actionCollection(), "search_quick");
975
findAction->setText(i18n("Quick Search..."));
1001
findAction->setText(i18n("Search..."));
976
1002
findAction->setIconSet(BarIcon("filefind"));
978
1004
KAction* advFindAction = KStdAction::find(d->view, SLOT(slotNewAdvancedSearch()),
1639
1666
d->albumManager->setLibraryPath(d->albumSettings->getAlbumLibraryPath());
1640
1667
d->albumManager->startScan();
1669
if(d->albumSettings->getShowFolderTreeViewItemsCount())
1670
d->albumManager->refresh();
1642
1672
d->view->applySettings();
1643
1673
d->albumIconViewFilter->readSettings();
1863
1898
void DigikamApp::loadCameras()
1865
1900
d->cameraList->load();
1867
1902
d->cameraMenuAction->popupMenu()->insertSeparator();
1869
1904
d->cameraMenuAction->popupMenu()->insertItem(i18n("Browse Media"), d->cameraMediaList);
1871
1906
d->cameraMenuAction->popupMenu()->insertSeparator();
1873
1908
d->cameraMenuAction->insert(new KAction(i18n("Add Camera..."), 0,
1874
1909
this, SLOT(slotSetupCamera()),
1875
1910
actionCollection(),
1882
1917
d->splashScreen->message(i18n("Loading themes"), AlignLeft, white);
1884
1919
ThemeEngine::instance()->scanThemes();
1920
d->themeMenuAction->setItems(ThemeEngine::instance()->themeNames());
1922
ThemeEngine::instance()->slotChangeTheme(d->themeMenuAction->currentText());
1925
void DigikamApp::slotChangeTheme(const QString& theme)
1927
d->albumSettings->setCurrentTheme(theme);
1928
ThemeEngine::instance()->slotChangeTheme(theme);
1931
void DigikamApp::slotThemeChanged()
1885
1933
QStringList themes(ThemeEngine::instance()->themeNames());
1887
d->themeMenuAction->setItems(themes);
1888
1934
int index = themes.findIndex(d->albumSettings->getCurrentTheme());
1890
1935
if (index == -1)
1891
1936
index = themes.findIndex(i18n("Default"));
1893
1938
d->themeMenuAction->setCurrentItem(index);
1894
ThemeEngine::instance()->slotChangeTheme(d->themeMenuAction->currentText());
1897
void DigikamApp::slotChangeTheme(const QString& theme)
1899
d->albumSettings->setCurrentTheme(theme);
1900
ThemeEngine::instance()->slotChangeTheme(theme);
1903
1941
void DigikamApp::slotDatabaseRescan()
1906
1944
sLib.startScan();
1946
d->view->refreshView();
1948
if (ImageWindow::imagewindowCreated())
1949
ImageWindow::imagewindow()->refreshView();
1951
if (LightTableWindow::lightTableWindowCreated())
1952
LightTableWindow::lightTableWindow()->refreshView();
1909
1955
void DigikamApp::slotRebuildAllThumbs()
1937
1983
BatchAlbumsSyncMetadata *syncMetadata = new BatchAlbumsSyncMetadata(this);
1939
1985
connect(syncMetadata, SIGNAL(signalComplete()),
1940
1986
this, SLOT(slotSyncAllPicturesMetadataDone()));
1952
1998
KApplication::kApplication()->invokeBrowser("http://www.digikam.org/?q=donation");
2001
void DigikamApp::slotContribute()
2003
KApplication::kApplication()->invokeBrowser("http://www.digikam.org/?q=contrib");
1955
2006
void DigikamApp::slotRecurseAlbums(bool checked)
1957
2008
AlbumLister::instance()->setRecurseAlbums(checked);