From kde-commits Fri Oct 31 22:09:12 2014 From: Gilles Caulier Date: Fri, 31 Oct 2014 22:09:12 +0000 To: kde-commits Subject: [digikam] /: clean code to prepare KF5 port in the future. Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=141479336807542 Git commit 36f646f949c1b7f24e9ab9a6f50592b757f26471 by Gilles Caulier. Committed on 31/10/2014 at 22:08. Pushed by cgilles into branch 'master'. clean code to prepare KF5 port in the future. Remove qmlshow implementation which have never been finalized and used M +0 -14 CMakeLists.txt M +0 -3 README M +0 -12 app/CMakeLists.txt M +0 -8 app/main/digikamapp.cpp M +0 -6 app/utils/config-digikam.h.cmake.in M +0 -24 app/views/digikamview.cpp M +0 -4 app/views/digikamview.h M +0 -4 data/CMakeLists.txt D +0 -15 data/qmlshow/CMakeLists.txt D +- -- data/qmlshow/blue_pencil.png D +- -- data/qmlshow/cross.png D +0 -10 data/qmlshow/def/CMakeLists.txt D +0 -63 data/qmlshow/def/back.svg D +0 -136 data/qmlshow/def/close.svg D +0 -187 data/qmlshow/def/grid.svg D +0 -63 data/qmlshow/def/next.svg D +0 -70 data/qmlshow/def/pause.svg D +0 -73 data/qmlshow/def/play.svg D +0 -120 data/qmlshow/def/zoom+.svg D +0 -112 data/qmlshow/def/zoom-.svg D +- -- data/qmlshow/edit_icon.png D +- -- data/qmlshow/empty_star.png D +- -- data/qmlshow/filled_star.png D +- -- data/qmlshow/flag.png D +- -- data/qmlshow/flag2.png D +0 -5 data/qmlshow/mapview.html D +0 -113 data/qmlshow/menu.svg D +0 -10 data/qmlshow/onpress/CMakeLists.txt D +0 -63 data/qmlshow/onpress/back1.svg D +0 -124 data/qmlshow/onpress/close1.svg D +0 -180 data/qmlshow/onpress/grid1.svg D +0 -63 data/qmlshow/onpress/next1.svg D +0 -70 data/qmlshow/onpress/pause1.svg D +0 -73 data/qmlshow/onpress/play1.svg D +0 -128 data/qmlshow/onpress/zoom+1.svg D +0 -112 data/qmlshow/onpress/zoom-1.svg D +0 -802 data/qmlshow/qmlview.qml D +0 -324 utilities/qmlshow/qmlshow.cpp D +0 -73 utilities/qmlshow/qmlshow.h http://commits.kde.org/digikam/36f646f949c1b7f24e9ab9a6f50592b757f26471 diff --git a/CMakeLists.txt b/CMakeLists.txt index 14a40c4..b2278ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,9 +14,6 @@ OPTION(ENABLE_KDEPIMLIBSSUPPORT "Build digiKam with Kdepi= mlibs support (default=3D OPTION(DIGIKAM_ENABLE_MODELTEST "Enable ModelTest on some models for debug= ging (default=3DOFF)" OFF) OPTION(ENABLE_ADVANCEDDEBUGMSG "Build digiKam with more internal debug me= ssage (default=3DOFF)" OFF) = -#experimental options: -OPTION(ENABLE_PRESENTATIONMODE "Build digiKam with presentation mode supp= ort (default=3DOFF)" OFF) - # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Information to update before to release this package. = @@ -280,7 +277,6 @@ MACRO_BOOL_TO_01(LENSFUN_FOUND HAVE_LENSFUN) MACRO_OPTIONAL_FIND_PACKAGE(Lqr-1) MACRO_BOOL_TO_01(LQR-1_FOUND HAVE_LIBLQR_1) = -MACRO_BOOL_TO_01(ENABLE_PRESENTATIONMODE USE_PRESENTATION_MODE) MACRO_BOOL_TO_01(ENABLE_THUMBS_DB USE_THUMBS_DB) MACRO_BOOL_TO_01(ENABLE_ADVANCEDDEBUGMSG USE_ADVANCEDDEBUGMSG) = @@ -601,10 +597,6 @@ IF(DIGIKAM_CAN_BE_COMPILED) INCLUDE_DIRECTORIES(${QT_QTSCRIPT_INCLUDE_DIR}) ENDIF(USE_SCRIPT_IFACE) = - IF(USE_PRESENTATION_MODE) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/utilities/qmlshow) - ENDIF(USE_PRESENTATION_MODE) - IF(Baloo_FOUND) INCLUDE_DIRECTORIES(${BALOO_INCLUDE_DIR} ${KFILEMETADATA_INCLUDE_D= IR}) ENDIF(Baloo_FOUND) @@ -950,12 +942,6 @@ IF(DIGIKAM_CAN_BE_COMPILED) ${CMAKE_CURRENT_SOURCE_DIR}/libs/widgets/metadata/picklabelwidget.= cpp ) = - IF(USE_PRESENTATION_MODE) - SET(libpresentationview_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/utilities/qmlshow/qmlshow.cpp - ) - ENDIF(USE_PRESENTATION_MODE) - SET(libslideshow_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/utilities/slideshow/slidetoolbar.cpp ${CMAKE_CURRENT_SOURCE_DIR}/utilities/slideshow/slideosd.cpp diff --git a/README b/README index 0b09b67..51727f8 100644 --- a/README +++ b/README @@ -127,9 +127,6 @@ Debug options: Use CMake "-DENABLE_ADVANCEDDEBUGMSG=3Don" flag to compile digiKam with m= ore internal debug messages, especially in image loaders (disabled by defau= lt). Use CMake "-DKDE4_BUILD_TESTS=3Don" flag to compile digiKam source= code unit tests (disabled by defau= lt). = -Experimental options: -Use CMake "-DENABLE_PRESENTATIONMODE=3Don" flag to compile digiKam with p= resentation mode (disabled by defau= lt). - digiKam do not have any video thumbnailer. Video support is delegate to KD= E. To support Video thumbnails, = please install "ffmpegthumbs" package, which is the kdemultimedia Video th= umbnail generator for KDE4 file managers. = diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 9cf35e6..79d05a7 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -94,10 +94,6 @@ TARGET_LINK_LIBRARIES(digikamcore ${LCMS_LIBRARIES} ) = -IF(USE_PRESENTATION_MODE) - TARGET_LINK_LIBRARIES(digikamcore ${QT_QTDECLARATIVE_LIBRARY}) -ENDIF(USE_PRESENTATION_MODE) - IF(Q_WS_X11) TARGET_LINK_LIBRARIES(digikamcore ${X11_LIBRARIES}) ENDIF(Q_WS_X11) @@ -215,10 +211,6 @@ SET(digikam_SRCS ${libeditorgui_SRCS} main/main.cpp ) = -IF(USE_PRESENTATION_MODE) - SET(digikam_SRCS ${digikam_SRCS} ${libpresentationview_SRCS}) -ENDIF(USE_PRESENTATION_MODE) - IF(KIPI_FOUND) SET(digikam_SRCS ${digikam_SRCS} ${libkipiiface_SRCS}) ENDIF(KIPI_FOUND) @@ -287,10 +279,6 @@ IF (NOT WIN32 AND GPHOTO2_FOUND) TARGET_LINK_LIBRARIES(digikam ${LIBUSB_LIBRARIES}) ENDIF (NOT WIN32 AND GPHOTO2_FOUND) = -IF(USE_PRESENTATION_MODE) - TARGET_LINK_LIBRARIES(digikam ${QT_QTDECLARATIVE_LIBRARY}) -ENDIF(USE_PRESENTATION_MODE) - IF(KDEPIMLIBS_FOUND) TARGET_LINK_LIBRARIES(digikam ${KDE4_KABC_LIBS} ${KDEPIMLIBS_AKONADI_LIB= S} ${KDEPIMLIBS_AKONADI_CONTACT_LIBS}) ENDIF(KDEPIMLIBS_FOUND) diff --git a/app/main/digikamapp.cpp b/app/main/digikamapp.cpp index 33d6ce2..aed5f3e 100644 --- a/app/main/digikamapp.cpp +++ b/app/main/digikamapp.cpp @@ -1277,14 +1277,6 @@ void DigikamApp::setupActions() actionCollection()->addAction("slideshow_recursive", d->slideShowRecur= siveAction); d->slideShowAction->addAction(d->slideShowRecursiveAction); = -#ifdef USE_PRESENTATION_MODE - d->slideShowQmlAction =3D new KAction(i18n("Presentation View"), this); - d->slideShowQmlAction->setShortcut(KShortcut(Qt::Key_F10)); - connect(d->slideShowQmlAction, SIGNAL(triggered()), d->view, SLOT(slot= SlideShowQml())); - actionCollection()->addAction("slideshow_qml", d->slideShowQmlAction); - d->slideShowAction->addAction(d->slideShowQmlAction); -#endif // USE_PRESENTATION_MODE - // ----------------------------------------------------------- = d->viewCMViewAction =3D new KToggleAction(KIcon("video-display"), i18n= ("Color-Managed View"), this); diff --git a/app/utils/config-digikam.h.cmake.in b/app/utils/config-digikam= .h.cmake.in index bb2e271..d7230f2 100644 --- a/app/utils/config-digikam.h.cmake.in +++ b/app/utils/config-digikam.h.cmake.in @@ -60,12 +60,6 @@ /* Define to 1 if thumbnails database is used */ #cmakedefine USE_THUMBS_DB 1 = -/* Define to 1 if script interface is enabled */ -#cmakedefine USE_SCRIPT_IFACE 1 - -/* Define to 1 if presentation mode is enabled */ -#cmakedefine USE_PRESENTATION_MODE 1 - /* Define to 1 if you want Qt to scale the preview images */ #cmakedefine USE_QT_SCALING 1 = diff --git a/app/views/digikamview.cpp b/app/views/digikamview.cpp index 0d4dc70..8729911 100644 --- a/app/views/digikamview.cpp +++ b/app/views/digikamview.cpp @@ -89,10 +89,6 @@ #include "mapwidgetview.h" #endif // HAVE_KGEOMAP = -#ifdef USE_PRESENTATION_MODE -#include "qmlshow.h" -#endif // USE_PRESENTATION_MODE - namespace Digikam { = @@ -2374,24 +2370,4 @@ void DigikamView::toggleFullScreen(bool set) d->stackedview->imagePreviewView()->toggleFullScreen(set); } = -#ifdef USE_PRESENTATION_MODE - -void DigikamView::slotSlideShowQml() -{ -/* - QStringList list; - foreach (const ImageInfo& info, d->iconView->imageInfos()) - { - list << info.filePath(); - } -*/ - SlideShowSettings settings; - settings.readFromConfig(); - QmlShow* const qmlShow =3D new QmlShow(allInfo(), settings); - qmlShow->setWindowState(Qt::WindowFullScreen); - qmlShow->show(); -} - -#endif // USE_PRESENTATION_MODE - } // namespace Digikam diff --git a/app/views/digikamview.h b/app/views/digikamview.h index 72ed777..23c9226 100644 --- a/app/views/digikamview.h +++ b/app/views/digikamview.h @@ -227,10 +227,6 @@ public Q_SLOTS: = void slotFocusAndNextImage(); = -#ifdef USE_PRESENTATION_MODE - void slotSlideShowQml(); -#endif // USE_PRESENTATION_MODE - private: = void toggleZoomActions(); diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 100083a..afb4cab 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -4,8 +4,4 @@ ADD_SUBDIRECTORY(about) ADD_SUBDIRECTORY(database) ADD_SUBDIRECTORY(hotplug) = -IF(USE_PRESENTATION_MODE) - ADD_SUBDIRECTORY(qmlshow) -ENDIF(USE_PRESENTATION_MODE) - INSTALL(FILES tips DESTINATION ${DATA_INSTALL_DIR}/digikam) diff --git a/data/qmlshow/CMakeLists.txt b/data/qmlshow/CMakeLists.txt deleted file mode 100644 index 88e0dc0..0000000 --- a/data/qmlshow/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -ADD_SUBDIRECTORY(def) -ADD_SUBDIRECTORY(onpress) - -INSTALL(FILES cross.png - blue_pencil.png - edit_icon.png - empty_star.png - filled_star.png - flag.png - flag2.png - menu.svg - qmlview.qml - mapview.html - DESTINATION ${DATA_INSTALL_DIR}/digikam/qmlshow - ) diff --git a/data/qmlshow/blue_pencil.png b/data/qmlshow/blue_pencil.png deleted file mode 100644 index 1d4411f..0000000 Binary files a/data/qmlshow/blue_pencil.png and /dev/null differ diff --git a/data/qmlshow/cross.png b/data/qmlshow/cross.png deleted file mode 100644 index be7218e..0000000 Binary files a/data/qmlshow/cross.png and /dev/null differ diff --git a/data/qmlshow/def/CMakeLists.txt b/data/qmlshow/def/CMakeLists.= txt deleted file mode 100644 index bcd0be3..0000000 --- a/data/qmlshow/def/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -INSTALL(FILES back.svg - close.svg - grid.svg - next.svg - pause.svg - play.svg - zoom-.svg - zoom+.svg - DESTINATION ${DATA_INSTALL_DIR}/digikam/qmlshow/def - ) diff --git a/data/qmlshow/def/back.svg b/data/qmlshow/def/back.svg deleted file mode 100644 index cd7e54f..0000000 --- a/data/qmlshow/def/back.svg +++ /dev/null @@ -1,63 +0,0 @@ - - -]> - - - - - - - - - - - - - - diff --git a/data/qmlshow/def/close.svg b/data/qmlshow/def/close.svg deleted file mode 100644 index 4ab014d..0000000 --- a/data/qmlshow/def/close.svg +++ /dev/null @@ -1,136 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/def/grid.svg b/data/qmlshow/def/grid.svg deleted file mode 100644 index a23fe7f..0000000 --- a/data/qmlshow/def/grid.svg +++ /dev/null @@ -1,187 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/def/next.svg b/data/qmlshow/def/next.svg deleted file mode 100644 index 92a943b..0000000 --- a/data/qmlshow/def/next.svg +++ /dev/null @@ -1,63 +0,0 @@ - - -]> - - - - - - - - - - - - - - diff --git a/data/qmlshow/def/pause.svg b/data/qmlshow/def/pause.svg deleted file mode 100644 index 569583e..0000000 --- a/data/qmlshow/def/pause.svg +++ /dev/null @@ -1,70 +0,0 @@ - - -]> - - - - - - - - - - - - - - - diff --git a/data/qmlshow/def/play.svg b/data/qmlshow/def/play.svg deleted file mode 100644 index 7a5fce1..0000000 --- a/data/qmlshow/def/play.svg +++ /dev/null @@ -1,73 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/def/zoom+.svg b/data/qmlshow/def/zoom+.svg deleted file mode 100644 index 395c272..0000000 --- a/data/qmlshow/def/zoom+.svg +++ /dev/null @@ -1,120 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/def/zoom-.svg b/data/qmlshow/def/zoom-.svg deleted file mode 100644 index b6106b2..0000000 --- a/data/qmlshow/def/zoom-.svg +++ /dev/null @@ -1,112 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/edit_icon.png b/data/qmlshow/edit_icon.png deleted file mode 100644 index 9220300..0000000 Binary files a/data/qmlshow/edit_icon.png and /dev/null differ diff --git a/data/qmlshow/empty_star.png b/data/qmlshow/empty_star.png deleted file mode 100644 index dec72e5..0000000 Binary files a/data/qmlshow/empty_star.png and /dev/null differ diff --git a/data/qmlshow/filled_star.png b/data/qmlshow/filled_star.png deleted file mode 100644 index ed65e41..0000000 Binary files a/data/qmlshow/filled_star.png and /dev/null differ diff --git a/data/qmlshow/flag.png b/data/qmlshow/flag.png deleted file mode 100644 index 9ea8cdf..0000000 Binary files a/data/qmlshow/flag.png and /dev/null differ diff --git a/data/qmlshow/flag2.png b/data/qmlshow/flag2.png deleted file mode 100644 index cdd4db8..0000000 Binary files a/data/qmlshow/flag2.png and /dev/null differ diff --git a/data/qmlshow/mapview.html b/data/qmlshow/mapview.html deleted file mode 100644 index 9772410..0000000 --- a/data/qmlshow/mapview.html +++ /dev/null @@ -1,5 +0,0 @@ - - - = - - diff --git a/data/qmlshow/menu.svg b/data/qmlshow/menu.svg deleted file mode 100644 index b9ced87..0000000 --- a/data/qmlshow/menu.svg +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/onpress/CMakeLists.txt b/data/qmlshow/onpress/CMa= keLists.txt deleted file mode 100644 index 51543ed..0000000 --- a/data/qmlshow/onpress/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -INSTALL(FILES back1.svg - close1.svg - grid1.svg - next1.svg - pause1.svg - play1.svg - zoom-1.svg - zoom+1.svg - DESTINATION ${DATA_INSTALL_DIR}/digikam/qmlshow/onpress - ) diff --git a/data/qmlshow/onpress/back1.svg b/data/qmlshow/onpress/back1.svg deleted file mode 100644 index 0e8a4c7..0000000 --- a/data/qmlshow/onpress/back1.svg +++ /dev/null @@ -1,63 +0,0 @@ - - -]> - - - - - - - - - - - - - - diff --git a/data/qmlshow/onpress/close1.svg b/data/qmlshow/onpress/close1.= svg deleted file mode 100644 index 89f5a41..0000000 --- a/data/qmlshow/onpress/close1.svg +++ /dev/null @@ -1,124 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/onpress/grid1.svg b/data/qmlshow/onpress/grid1.svg deleted file mode 100644 index 9f5542a..0000000 --- a/data/qmlshow/onpress/grid1.svg +++ /dev/null @@ -1,180 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/onpress/next1.svg b/data/qmlshow/onpress/next1.svg deleted file mode 100644 index 4c4c64b..0000000 --- a/data/qmlshow/onpress/next1.svg +++ /dev/null @@ -1,63 +0,0 @@ - - -]> - - - - - - - - - - - - - - diff --git a/data/qmlshow/onpress/pause1.svg b/data/qmlshow/onpress/pause1.= svg deleted file mode 100644 index 569583e..0000000 --- a/data/qmlshow/onpress/pause1.svg +++ /dev/null @@ -1,70 +0,0 @@ - - -]> - - - - - - - - - - - - - - - diff --git a/data/qmlshow/onpress/play1.svg b/data/qmlshow/onpress/play1.svg deleted file mode 100644 index 7a5fce1..0000000 --- a/data/qmlshow/onpress/play1.svg +++ /dev/null @@ -1,73 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/onpress/zoom+1.svg b/data/qmlshow/onpress/zoom+1.= svg deleted file mode 100644 index f069bde..0000000 --- a/data/qmlshow/onpress/zoom+1.svg +++ /dev/null @@ -1,128 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/onpress/zoom-1.svg b/data/qmlshow/onpress/zoom-1.= svg deleted file mode 100644 index 7cabd43..0000000 --- a/data/qmlshow/onpress/zoom-1.svg +++ /dev/null @@ -1,112 +0,0 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/qmlshow/qmlview.qml b/data/qmlshow/qmlview.qml deleted file mode 100644 index 618c4af..0000000 --- a/data/qmlshow/qmlview.qml +++ /dev/null @@ -1,802 +0,0 @@ -import QtQuick 1.0 - - -Rectangle { - - id:rect - focus: true; - color:"black" - - - signal nextClicked; - signal prevClicked; - signal play; - signal pause; - signal gridChanged (int index); - signal loadMetaData(); - - property bool bool_pp: true; - property bool editbox_opened: false; - property real source_scale: 1.0; - property int imagewidth: 0 - property int imageheight: 0 - property string text: "" - - Keys.onLeftPressed: - { rect.prevClicked(); rect.source_scale=3D1.0 } - Keys.onRightPressed: - { rect.nextClicked(); rect.source_scale=3D1.0} - Keys.onEscapePressed: - { Qt.quit() } - Keys.onSpacePressed: - { - if (play_pause.src =3D=3D "def/pause.svg") - { - play_pause.src =3D "def/play.svg"; rect.pause(); - } - else - { - play_pause.src=3D "def/pause.svg";rect.play(); - }; - } - - Image { - id: circle_image - x: 0 - y: 0 - width: parent.height / 3 - height: parent.height / 3 - visible: true - rotation: 0 - opacity: 0.7 - source: "menu.svg" - z: 5 - - states: [ - State { - name: "Enable" - PropertyChanges { target: circle_image; opacity: 1; } - }, - State { - name: "Disable" - PropertyChanges { target: circle_image; opacity: 0; } - } - ] - - transitions: [ - Transition { - from: "*"; to: "*" - PropertyAnimation { - target: circle_image - properties: "opacity"; duration: 500 ; - } - } - ] - - Image { - id: play_pause - height:parent.height/5 - width:parent.width/5 - x:5 - y:5 = - z: 12 - property string src: "def/pause.svg" - source: src - MouseArea - { - id: flip_icon - anchors.fill: parent - onClicked: { if (parent.src =3D=3D "def/pause.svg") {paren= t.src =3D "def/play.svg"; rect.pause();} - else {parent.src=3D "def/pause.svg";rect.play();}; - } - - } - } - - Image { - id: next - x: zoom_in.x - (width / 2) - y: zoom_in.height - width: parent.width / 5 - height: parent.height / 5 - rotation: 0 - z: 12 - source: "def/next.svg" - MouseArea - { - anchors.fill: parent; - onClicked: rect.nextClicked(); - onPressed: parent.source =3D "onpress/next1.svg"; - onReleased: parent.source =3D "def/next.svg"; - } - } - - Image { - id: prev - x: zoom_out.x + 4/3*zoom_out.width - y: parent.height * 3/4 - 1/2 *zoom_out.height - width: parent.width / 5 - height: parent.height / 5 - rotation: 0 - z: 12 - source: "def/back.svg" - MouseArea - { - anchors.fill:parent; - onClicked: rect.prevClicked(); - onPressed: parent.source =3D "onpress/back1.svg"; - onReleased: parent.source =3D "def/back.svg"; - } - } - - Image { - id: zoom_out - x: 0 - y: parent.height*3 / 4 - width: parent.width / 5 - height: parent.height / 5 - rotation: 0 - z: 12 - source: "def/zoom-.svg" - MouseArea - { - id:zoomout - anchors.fill: parent - onClicked: {rect.source_scale =3D rect.source_scal= e / 2;} - onPressed: parent.source =3D "onpress/zoom-1.svg"; - onReleased: parent.source =3D "def/zoom-.svg"; - } - } - - Image { - id: zoom_in - x: 3/4 * parent.width - y: 0 - width: parent.width / 5 - height: parent.height / 5 - rotation: 0 - z: 12 - source: "def/zoom+.svg" - MouseArea - { - id:zoomin - anchors.fill: parent - onClicked: {rect.source_scale =3D rect.source_scal= e * 2;} - onPressed: parent.source =3D "onpress/zoom+1.svg"; - onReleased: parent.source =3D "def/zoom+.svg"; - } - } - - /*Image { - id: map_view - x: 0 - y: parent.height*3 / 4 - width: parent.width / 5 - height: parent.height / 5 - source: "map_view.png" - - MouseArea { - id: show_map - anchors.fill: parent - onClicked: { if (openstreetmap.visible =3D=3D false) opens= treetmap.visible =3D true - else openstreetmap.visible=3Dfalse;} - } - } -*/ - - Image { - id: gridviewicon - x: next.x - 2/3*prev.width - y: next.height + 6/5*zoom_in.height - width: parent.height / 5 - height: parent.height / 5 - source: "def/grid.svg" - MouseArea { - id:show_gridview - anchors.fill: parent - onClicked: - { - if(rect2.visible=3D=3Dfalse){ - rect2.visible=3Dtrue; - grid.focus=3D true; - play_pause.src =3D "def/play.svg"; - rect.pause();} - else - { rect2.visible =3D false; - rect.focus =3D true; - } - } - - onPressed: parent.source =3D "onpress/grid1.svg"; - onReleased: parent.source =3D "def/grid.svg"; - } - } -/* }*/ - - Image{ - id:edit_icon; - source:"blue_pencil.png"; - x:gridviewicon.x-gridviewicon.width; - y:gridviewicon.y-gridviewicon.height; - z:10; - height:gridviewicon.height; - width:height; - MouseArea - { - id:open_metadata_editbox - anchors.fill:parent; - onClicked: - { - if(rect.editbox_opened=3D=3Dfalse) {rect.open_metadata_edi= tbox();rect.editbox_opened=3Dtrue;} - else {editbox.visible=3Dfalse;rect.editbox_opened=3Dfalse;= rect.focus=3Dtrue;} - } - } - } - - } - - Rectangle - { - id:editbox - x:parent.width/4 - y:parent.height*3/8 - z:10 - width: parent.width/2 - height: parent.height/4; - color: "black" - opacity: 0.7 - radius:10 - property string name: ""; - property string data_time: ""; - property int pick_label: 0; - property int color_label: 0; - property int rating: 0; - visible: false; - objectName:"editbox"; - Text - { - id:name_text; - text:"Image Name"; - color: "white"; - x:5; - y:5; - font.family : "Helvetica" - font.pixelSize: 20; - } - Rectangle - { - id:image_name_rect; - color:"white"; - x:name_text.x+name_text.width+5; - y:name_text.y; - width:parent.width-name_text.width-15; - height:image_name.height+5; - radius:5; - TextInput - { - id: image_name; - text:editbox.name; - anchors.centerIn: parent; - font.family : "Helvetica" - font.pixelSize: 20; - font.bold: true; - x: parent.x; - y: parent.y; - width:parent.width-10; - color:"black" - } - } - Text - { - id:dt_text; - text:"Date & Time"; - color:"gray" - x:name_text.x; - y:image_name_rect.y+image_name_rect.height+5; - font.family : "Helvetica" - font.pixelSize: 20; - } - Text - { - id: image_dt; - color: "white" - text:editbox.data_time; - font.family : "Helvetica" - font.pixelSize: 20; - font.bold: true; - x:image_name_rect.x; - y:dt_text.y; - width:parent.width-10; - } - Text - { - id: picklabel; -/* text: {if(editbox.pick_label=3D=3D0) return "NoPickLabel"; e= lse if(editbox.pick_label=3D=3D1) return "RejectedLabel"; else if(editbox.p= ick_label=3D=3D2) return "PendingLabel"; else if(editbox.pick_label=3D=3D3)= return "AcceptedLabel"; else return "InvalidLabel"}*/ - text: "Pick Label"; - color:"gray"; - font.family : "Helvetica" - font.pixelSize: 20; - x:5; - y:image_dt.y+30; - } - /*Rectangle - { - id:no_pick_label_rect; - x:image_name_rect.x; - y:picklabel.y; - height:picklabel.height; - width:height; - color:"gray"; - radius:5; - }*/ - Grid - { - x:image_name_rect.x; - y:picklabel.y; - height:picklabel.height; - columns:4 - rows:1 - spacing: 10 - Rectangle - { - id:no_pick_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; -/* ToolTip {id:tooltip;text:"NoPickLabel";target:no_pick_re= ct;visible:mouseArea.onEntered;} - MouseArea {id:mouseArea;anchors.fill:parent;}*/ - } - Rectangle - { - id:rejected_label_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Image - { - id:rejected_label_image; - source:"flag2.png"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:pending_label_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Image - { - id:pending_label_image; - source:"flag2.png"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:accepted_label_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Image - { - id:accepted_label_image; - source:"flag2.png"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - } - Image - { - id:flag_1; - } - Text - { - id: colorlabel; - /* text: {if(editbox.color_label=3D=3D0) return "No= ColorLabel"; else if(editbox.color_label=3D=3D1) return "RedLabel"; else if= (editbox.color_label=3D=3D2) return "OrangeLabel"; else if(editbox.color_la= bel=3D=3D3) return "YellowLabel"; else if(editbox.color_label=3D=3D4) r= eturn "GreenLabel"; else if(editbox.color_label=3D=3D5) return "BlueLabel";= else if(editbox.color_label=3D=3D6) return "MagentaLabel"; else if(editbox= .color_label=3D=3D7) return "GrayLabel"; else if(editbox.color_label=3D=3D8= ) return "BlackLabel"; else if(editbox.color_label=3D=3D9) return "WhiteLab= el"; else return "InvalidLabel";}*/ - text:"Color Label"; - color:"gray"; - font.family : "Helvetica" - font.pixelSize: 20; - x:5; - y:picklabel.y+30; - } - Grid - { - x:image_name_rect.x; - y:colorlabel.y; - height:picklabel.height; - columns:10 - rows:1 - spacing: 10 - Rectangle - { - id:no_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Image - { - id:no_color_image; - source:"cross.png"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:red_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Rectangle - { - id:red_color_image; - color:"red"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:orange_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Rectangle - { - id:orange_color_image; - color:"orange"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:yellow_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Rectangle - { - id:yellow_color_image; - color:"yellow"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:green_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Rectangle - { - id:green_color_image; - color:"green"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:blue_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Rectangle - { - id:blue_color_image; - color:"blue"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:magenta_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Rectangle - { - id:magenta_color_image; - color:"magenta"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:gray_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Rectangle - { - id:gray_color_image; - color:"gray"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:black_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Rectangle - { - id:black_color_image; - color:"black"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - Rectangle - { - id:white_color_rect; - color:"gray"; - radius:5; - height:parent.height; - width:height; - Rectangle - { - id:white_color_image; - color:"white"; - anchors.centerIn:parent; - height:2*parent.height/3; - width:height; - } - } - } - Text - { - id: rating_text; - color: "gray" -// text:editbox.rating; - text:"Rating"; - font.family : "Helvetica" - font.pixelSize: 20; - x:5; - y:colorlabel.y+30; - width:parent.width-10; - } - Grid - { - x:image_name_rect.x; - y:rating_text.y; - height:picklabel.height; - columns:5 - rows:1 - spacing: 10 - Image - { - id:rating_1; - source:"empty_star.png"; - height:parent.height; - width:height; - } - Image - { - id:rating_2; - source:"empty_star.png"; - height:parent.height; - width:height; - } - Image - { - id:rating_3; - source:"empty_star.png"; - height:parent.height; - width:height; - } - Image - { - id:rating_4; - source:"empty_star.png"; - height:parent.height; - width:height; - } - Image - { - id:rating_5; - source:"empty_star.png"; - height:parent.height; - width:height; - } - } - } - - function open_metadata_editbox() - { - editbox.visible=3Dtrue; - rect.loadMetaData(); - } - - - Image { - id: close - x: parent.width - width - y: 0 - width: parent.height/8 - height: parent.height/8 - visible: true - z: 5 - opacity: 0.5 - rotation: 0 - source: "def/close.svg" - MouseArea - { - id:quit - hoverEnabled: true - anchors.fill: parent - onClicked:{Qt.quit()} - onPressed: parent.source =3D "onpress/close1.svg"; - onReleased: parent.source =3D "def/close.svg"; - } - } - - - Flickable - { - id:flickable - anchors.fill: parent - contentWidth: (rect.width - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; - * either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ - -#include "qmlshow.moc" - -// C++ includes - -#include - -// Qt includes - -#include -#include -#include -#include -#include -#include -#include - -// KDE includes - -#include - -// Local includes - -#include "imageinfo.h" -#include "imageinfolist.h" -#include "metadatahub.h" - -namespace Digikam -{ - -class QmlShow::Private -{ -public: - - Private() - : ui(0), - imageno(0), - screen_height(0), - screen_width(0), - list(0) - { - } - - QDeclarativeView* ui; - int imageno; - int screen_height; - int screen_width; - ImageInfoList* list; - SlideShowSettings settings; -}; - -QmlShow::QmlShow(const ImageInfoList& list, const SlideShowSettings& setti= ngs) - : QMainWindow(0, Qt::FramelessWindowHint), - d(new Private) -{ - d->ui =3D new QDeclarativeView; - d->list =3D new ImageInfoList(list); - d->settings =3D settings; - QDeclarativeContext* ctxt =3D d->ui->rootContext(); - -// ctxt->setContextProperty("myModel", QVariant::fromValue(d->list)); - - QStringList nameslist; - - foreach (const ImageInfo& info, list) - { - nameslist << info.filePath(); - } - - ctxt->setContextProperty("myModel", QVariant::fromValue(nameslist)); - - // FIXME: Use KStandardDirs and install qml file properly (see data/da= tabase/dbconfig.xml as example) - QString dir(KStandardDirs::installPath("data") + QString("digikam/qmls= how/qmlview.qml")); - d->ui->setSource(QUrl::fromLocalFile(QFile::encodeName(dir).data())); - setCentralWidget(d->ui); - d->screen_height =3D qApp->desktop()->screenGeometry(-1).height(); - d->screen_width =3D qApp->desktop()->screenGeometry(-1).width(); - - setAttribute(Qt::WA_DeleteOnClose,true); - - connect(d->ui->engine(), SIGNAL(quit()), - this, SLOT(close())); - - //d->ui->setResizeMode(QDeclarativeView::SizeRootObjectToView); - - QObject* object =3D d->ui->rootObject(); - - connect(object, SIGNAL(nextClicked()), - this, SLOT(nextImage())); - - connect(object, SIGNAL(prevClicked()), - this, SLOT(prevImage())); - - connect(object, SIGNAL(play()), - this, SLOT(play())); - - connect(object, SIGNAL(pause()), - this, SLOT(pause())); - - connect(object, SIGNAL(gridChanged(int)), - this, SLOT(changePicture(int))); - - connect(object, SIGNAL(loadMetaData()), - this, SLOT(setMetaData())); - - d->imageno =3D 0; - d->ui->show(); - d->ui->setResizeMode(QDeclarativeView::SizeRootObjectToView); - showMaximized(); - - if(!list.isEmpty()) - { - changePicture(d->imageno); - } - else - { - close(); - } -} - -QmlShow::~QmlShow() -{ - delete d->ui; - delete d->list; - delete d; -} - -void QmlShow::nextImage() -{ - if (d->imageno =3D=3D (d->list->count()-1)) - { - return; - } - - d->imageno +=3D 1; - changePicture(d->imageno); -} - -void QmlShow::prevImage() -{ - if (d->imageno =3D=3D 0) - { - return; - } - - d->imageno-=3D1; - changePicture(d->imageno); -} - -void QmlShow::play() -{ - QObject* const object =3D d->ui->rootObject(); - object->setProperty("bool_pp", true); -} - -void QmlShow::pause() -{ - QObject* const object =3D d->ui->rootObject(); - object->setProperty("bool_pp", false); -} - -void QmlShow::changePicture(int index) -{ - QObject* const object =3D d->ui->rootObject(); - int image_height =3D d->list->at(index).imageCommonContainer().he= ight; - int image_width =3D d->list->at(index).imageCommonContainer().wi= dth; - - if(d->screen_height < image_height) - { - double ratio =3D (double)(d->screen_height)/(double)(image_height); - image_height =3D (image_height*ratio); - image_width =3D (image_width*ratio); - } - - if(d->screen_width < image_width) - { - double ratio =3D (double)(d->screen_width)/(double)(image_width); - image_height =3D (int)(image_height*ratio); - image_width =3D (int)(image_width*ratio); - } - - object->setProperty("source_scale", 1.0); - object->setProperty("imageheight", image_height); - object->setProperty("imagewidth", image_width); - object->setProperty("text", d->list->at(index).filePath()); - - d->imageno =3D index; - - setMetaData(); -} - -void QmlShow::setMetaData() -{ - QDeclarativeContext* const ctxt =3D d->ui->rootContext(); - QObject* const object =3D d->ui->rootObject(); - QObject* const editBox =3D 0; - MetadataHubOnTheRoad hub =3D MetadataHub(); - hub.load(d->list->at(d->imageno)); - - foreach(editBox, object->children()) - { - if (editBox->objectName().compare("editbox") =3D=3D 0) - break; - } - - editBox->setProperty("name", d->list->at(d->imageno).name()); - editBox->setProperty("data_time", d->list->at(d->imageno).dateTime()= .toString("dd.MM.yyyy")); - editBox->setProperty("pick_label", hub.pickLabel()); - editBox->setProperty("color_label", hub.colorLabel()); - editBox->setProperty("rating", hub.rating()); - QString imagedata; - - if(d->settings.printName) - { - imagedata.append(d->list->at(d->imageno).imageCommonContainer().fi= leName+"\n"); - } - - if(d->settings.printDate) - { -// imagedata.append("\n"); - imagedata.append(d->list->at(d->imageno).imageCommonContainer().cr= eationDate.toString("MMMM d yy hh:mm:ss")); - } - - if(d->settings.printApertureFocal) - { - ImageMetadataContainer photoInfo =3D d->list->at(d->imageno).image= MetadataContainer(); - QString str; - imagedata.append("\n"); - - if (!photoInfo.aperture.isEmpty()) - { - str =3D photoInfo.aperture; - } - - if (photoInfo.focalLength35.isEmpty()) - { - if (!photoInfo.focalLength.isEmpty()) - { - if (!photoInfo.aperture.isEmpty()) - { - str +=3D QString(" / "); - } - - str +=3D photoInfo.focalLength; - } - } - else - { - if (!photoInfo.aperture.isEmpty()) - { - str +=3D QString(" / "); - } - - if (!photoInfo.focalLength.isEmpty()) - { - str +=3D QString("%1 (35mm: %2)").arg(photoInfo.focalLengt= h).arg(photoInfo.focalLength35); - } - else - { - str +=3D QString("35mm: %1)").arg(photoInfo.focalLength35); - } - } - - imagedata.append(str); - } - - if(d->settings.printExpoSensitivity) - { - // TODO - } - - //printf("\n\n\n%s\n\n\n",imagedata.toAscii().constData()); - ctxt->setContextProperty("imagedata", imagedata); - //QString date=3Dd->list->at(d->imageno).imageCommonContainer().creati= onDate.toString("MMMM d yyyy"); - //ctxt->setContextProperty("imagedate", date); - -/* - QObject* const editBox =3D d->ui->findChild("editbox"); - QMessageBox* const msg =3D new QMessageBox(0); - if(editBox =3D=3D NULL) msg->setText("Screw you!"); - else msg->setText(d->list->at(d->imageno).name()); - msg->show(); -*/ -/* - QObject* const object =3D d->ui->rootObject(); - QObject* const editBox =3D d->ui->findChild("editbox"); - editBox->setProperty("name",d->list->at(d->imageno).name()); -*/ -/* - d->editBox =3D new QDeclarativeView; - d->editBox->setSource(QUrl::fromLocalFile("../core/utilities/qmlShow/q= mlview/editbox.qml")); - QObject* const object =3D d->editBox->rootObject(); - object->setProperty("name","Hello world"); - int height =3D QApplication::desktop()->height(); - int width =3D QApplication::desktop()->width(); - object->setProperty("x",width/4); - object->setProperty("y",height/4); - d->editBox->show(); -*/ -} - -} // namespace Digikam diff --git a/utilities/qmlshow/qmlshow.h b/utilities/qmlshow/qmlshow.h deleted file mode 100644 index cc04d09..0000000 --- a/utilities/qmlshow/qmlshow.h +++ /dev/null @@ -1,73 +0,0 @@ -/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - * - * This file is a part of digiKam project - * http://www.digikam.org - * - * Date : 2005-04-21 - * Description : slide show tool using preview of pictures. - * - * Copyright (C) 2005-2011 by Dhruv Patel - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software Foundation; - * either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ - -#ifndef QML_SHOW_H -#define QML_SHOW_H - -// Qt includes - -#include - -//local includes - -#include"imageinfo.h" -#include"imageinfolist.h" -#include"databaseinfocontainers.h" -#include"slideshowsettings.h" - -namespace Digikam -{ - -class ImageInfo; -class ImageInfoList; -class ImageCommonContainer; -class ImageMetadataContainer; -class VideoMetadataContainer; - -class QmlShow : public QMainWindow -{ - Q_OBJECT - -public: - - QmlShow(const ImageInfoList&, const SlideShowSettings& settings); - ~QmlShow(); - -public Q_SLOTS: - - void nextImage(); - void prevImage(); - void pause(); - void play(); - void changePicture(int); - void setMetaData(); - -private: - - class QmlShowPriv; - QmlShowPriv* const d; -}; - -} // namespace Digikam - -#endif // QML_SHOW_H