Commit 6db462e0 authored by Urs Fleisch's avatar Urs Fleisch
Browse files

QML: Move qml files to common directory used for app and scripts.

parent 0b66d8c3
......@@ -166,7 +166,7 @@ set(CFG_TRANSLATIONSDIR ${CMAKE_INSTALL_PREFIX_SLASH}${WITH_TRANSLATIONSDIR})
set(CFG_QMLDIR ${CMAKE_INSTALL_PREFIX_SLASH}${WITH_QMLDIR})
file(RELATIVE_PATH CFG_PLUGINSDIR /${WITH_BINDIR} /${WITH_PLUGINSDIR})
endif (APPLE)
set(CFG_QMLSRCDIR "${kid3_SOURCE_DIR}/src/app/qml")
set(CFG_QMLSRCDIR "${kid3_SOURCE_DIR}/src/qml")
find_package(Threads)
find_package(Perl REQUIRED)
......
......@@ -62,6 +62,10 @@ add_subdirectory(core)
add_subdirectory(gui)
add_subdirectory(app)
if (WITH_QML)
add_subdirectory(qml)
endif (WITH_QML)
if (BUILD_TEST_APP)
add_subdirectory(test)
endif (BUILD_TEST_APP)
# Before starting Qt Creator, export the environment variable
# QML_IMPORT_PATH=<qt5dir>/qml:<qt5dir>/imports
# so that the editor support the QML types.
# On Linux, this can be done in ~/.xsessionrc.
set(qml_SRCS
mainqml.cpp
)
set(qml_QML_SRCS
main.qml
MainPage.qml
Collapsible.qml
ComboBox.qml
DropDownList.qml
FrameDelegate.qml
FrameEditDialog.qml
FrameSelectDialog.qml
MessageDialog.qml
ActionSelectionDelegate.qml
UiConstants.qml
FileList.qml
FileCollapsible.qml
Tag1Collapsible.qml
Tag2Collapsible.qml
PictureCollapsible.qml
FileSelectDialog.qml
RenameDirectoryPage.qml
NumberTracksDialog.qml
FilterPage.qml
BatchImportPage.qml
AbstractSettingsPage.qml
SettingsElement.qml
SettingsPage.qml
RaisableRectangle.qml
ComponentsQtQuick/ActionList.qml
ComponentsQtQuick/Action.qml
ComponentsQtQuick/ActionSelectionPopover.qml
ComponentsQtQuick/Button.qml
ComponentsQtQuick/CheckBox.qml
ComponentsQtQuick/Dialog.qml
ComponentsQtQuick/Empty.qml
ComponentsQtQuick/Label.qml
ComponentsQtQuick/MainView.qml
ComponentsQtQuick/Page.qml
ComponentsQtQuick/PageStack.qml
ComponentsQtQuick/PopupBase.qml
ComponentsQtQuick/Standard.qml
ComponentsQtQuick/TextArea.qml
ComponentsQtQuick/TextField.qml
ComponentsQtQuick/ThinDivider.qml
)
set(qml_MOC_HDRS
)
qt4_wrap_cpp(qml_GEN_MOC_SRCS ${qml_MOC_HDRS})
set(qml_SRCS ${qml_SRCS} ${qml_GEN_MOC_SRCS})
add_definitions(${QT_DEFINITIONS} ${QT_EXECUTABLE_COMPILE_FLAGS})
add_executable(kid3-qml MACOSX_BUNDLE WIN32
${qml_SRCS} ${qml_GEN_RCS} ${qml_QML_SRCS})
add_executable(kid3-qml MACOSX_BUNDLE WIN32 ${qml_SRCS})
target_link_libraries(kid3-qml kid3-gui -lstdc++)
install(TARGETS kid3-qml
BUNDLE DESTINATION .
RUNTIME DESTINATION ${WITH_BINDIR})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${WITH_QMLDIR}
FILES_MATCHING PATTERN "*.qml" PATTERN "*.js" PATTERN "*.png")
# Preprocess installed QML files for Qt 4 or Ubuntu Components.
if (NOT HAVE_QT5 OR WITH_UBUNTUCOMPONENTS)
if (NOT HAVE_QT5)
set(_qmlpp_code 4)
else (NOT HAVE_QT5)
set(_qmlpp_code U)
endif (NOT HAVE_QT5)
install(CODE "
execute_process(
COMMAND ${PERL_EXECUTABLE}
${kid3_SOURCE_DIR}/src/plugins/kid3qml/qmlpp.pl ${_qmlpp_code}
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${WITH_QMLDIR}\"
)
")
endif (NOT HAVE_QT5 OR WITH_UBUNTUCOMPONENTS)
......@@ -143,14 +143,16 @@ int main(int argc, char* argv[])
QString qmlPath(qmlDir);
Utils::prependApplicationDirPathIfRelative(qmlPath);
qmlPath += QDir::separator();
qmlPath += QLatin1String("main.qml");
qmlPath += QLatin1String("app");
qmlPath += QDir::separator();
qmlPath += QLatin1String("Main.qml");
if (QFile::exists(qmlPath)) {
mainQmlPath = qmlPath;
break;
}
}
if (mainQmlPath.isEmpty()) {
qWarning("Could not find main.qml in the following paths:\n%s",
qWarning("Could not find app/Main.qml in the following paths:\n%s",
qPrintable(qmlDirs.join(QLatin1String("\n"))));
return 1;
}
......
# Before starting Qt Creator, export the environment variable
# QML_IMPORT_PATH=<qt5dir>/qml:<qt5dir>/imports
# so that the editor supports the QML types.
# On Linux, this can be done in ~/.xsessionrc.
set(qml_SUBDIRS script)
if (BUILD_QML_APP)
set(qml_SUBDIRS ${qml_SUBDIRS} app componentsqtquick)
endif (BUILD_QML_APP)
set(qml_QML_SRCS)
foreach (_subdir ${qml_SUBDIRS})
include(${_subdir}/Sources.cmake)
set(qml_QML_SRCS ${qml_QML_SRCS} ${${_subdir}_QML_SRCS})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_subdir}
DESTINATION ${WITH_QMLDIR}
FILES_MATCHING PATTERN "*.qml" PATTERN "*.js" PATTERN "*.png")
endforeach (_subdir)
# Only used to add the QML sources to the project.
add_custom_target(qml-sources SOURCES ${qml_QML_SRCS})
# Preprocess installed QML files for Qt 4 or Ubuntu Components.
if (NOT HAVE_QT5 OR WITH_UBUNTUCOMPONENTS)
if (NOT HAVE_QT5)
set(_qmlpp_code 4)
else (NOT HAVE_QT5)
set(_qmlpp_code U)
endif (NOT HAVE_QT5)
install(CODE "
execute_process(
COMMAND ${PERL_EXECUTABLE}
${kid3_SOURCE_DIR}/src/plugins/kid3qml/qmlpp.pl ${_qmlpp_code}
WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${WITH_QMLDIR}\"
)
")
endif (NOT HAVE_QT5 OR WITH_UBUNTUCOMPONENTS)
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
import Kid3 1.0
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
Column {
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
......
......@@ -23,7 +23,7 @@
import QtQuick 2.2
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
import Kid3 1.0
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
import Kid3 1.0
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
......
/**
* \file main.qml
* \file Main.qml
* Main entry point for QML application.
*
* \b Project: Kid3
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
......
......@@ -22,7 +22,7 @@
*/
import QtQuick 2.2
import "ComponentsQtQuick" //@!Ubuntu
import "../componentsqtquick" //@!Ubuntu
//import Ubuntu.Components 1.1 //@Ubuntu
Page {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment