mirror of https://github.com/cutefishos/calamares
Load QML modules in a central place + dummy QML slideshow.
parent
14ddba70ef
commit
9622888d1d
@ -1,13 +1,63 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Calamares 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.0;
|
||||
import slideshow 1.0;
|
||||
import calamares.slideshow 1.0;
|
||||
|
||||
Presentation
|
||||
{
|
||||
id: presentation
|
||||
width: 1280
|
||||
height: 720
|
||||
|
||||
Timer {
|
||||
interval: 5000
|
||||
running: false
|
||||
repeat: true
|
||||
onTriggered: presentation.goToNextSlide()
|
||||
}
|
||||
|
||||
Slide {
|
||||
centeredText: "Calamares is really nice"
|
||||
|
||||
Image {
|
||||
id: background
|
||||
source: "squid.png"
|
||||
width: 200; height: 200
|
||||
fillMode: Image.PreserveAspectFit
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
Text {
|
||||
anchors.horizontalCenter: background.horizontalCenter
|
||||
anchors.top: background.bottom
|
||||
text: "This is a customizable QML slideshow.<br/>"+
|
||||
"Distributions should provide their own slideshow and list it in <br/>"+
|
||||
"their custom branding.desc file.<br/>"+
|
||||
"To create a Calamares presentation in QML, import calamares.slideshow,<br/>"+
|
||||
"define a Presentation element with as many Slide elements as needed."
|
||||
wrapMode: Text.WordWrap
|
||||
width: root.width
|
||||
horizontalAlignment: Text.Center
|
||||
}
|
||||
}
|
||||
|
||||
Slide {
|
||||
centeredText: "This is a second Slide element."
|
||||
}
|
||||
|
||||
Slide {
|
||||
centeredText: "This is a third Slide element."
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
set( QML_FILES
|
||||
qmldir
|
||||
Presentation.qml
|
||||
Slide.qml
|
||||
)
|
||||
|
||||
set( SLIDESHOW_DIR share/calamares/slideshow )
|
||||
|
||||
foreach( QML_FILE ${QML_FILES} )
|
||||
configure_file( ${QML_FILE} ${QML_FILE} COPYONLY )
|
||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${QML_FILE}
|
||||
DESTINATION ${SLIDESHOW_DIR} )
|
||||
endforeach()
|
||||
|
||||
@ -0,0 +1 @@
|
||||
add_subdirectory( calamares )
|
||||
@ -0,0 +1,27 @@
|
||||
file( GLOB SUBDIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" )
|
||||
|
||||
# Iterate over all the subdirectories which have a qmldir file, copy them over to the build dir,
|
||||
# and install them into share/calamares/qml/calamares
|
||||
foreach( SUBDIRECTORY ${SUBDIRECTORIES} )
|
||||
if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}"
|
||||
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/qmldir" )
|
||||
|
||||
set( QML_DIR share/calamares/qml )
|
||||
set( QML_MODULE_DESTINATION ${QML_DIR}/calamares/${SUBDIRECTORY} )
|
||||
|
||||
# We glob all the files inside the subdirectory, and we make sure they are
|
||||
# synced with the bindir structure and installed.
|
||||
file( GLOB QML_MODULE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY} "${SUBDIRECTORY}/*" )
|
||||
foreach( QML_MODULE_FILE ${QML_MODULE_FILES} )
|
||||
if( NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${QML_MODULE_FILE} )
|
||||
configure_file( ${SUBDIRECTORY}/${QML_MODULE_FILE} ${SUBDIRECTORY}/${QML_MODULE_FILE} COPYONLY )
|
||||
|
||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${QML_MODULE_FILE}
|
||||
DESTINATION ${QML_MODULE_DESTINATION} )
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
message( "-- ${BoldYellow}Configured QML module: ${BoldRed}calamares.${SUBDIRECTORY}${ColorReset}" )
|
||||
|
||||
endif()
|
||||
endforeach()
|
||||
@ -1,4 +1,4 @@
|
||||
module slideshow
|
||||
module calamares.slideshow
|
||||
Presentation 1.0 Presentation.qml
|
||||
Slide 1.0 Slide.qml
|
||||
|
||||
Loading…
Reference in New Issue