From 63e743e1f9e4536e39a77e3b485b51dadac93357 Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 21:29:51 +0100 Subject: [PATCH 01/11] Added view header. Simplified list delegate. Fixed warning. --- qml/About.qml | 2 +- qml/ChannelPlayer.qml | 2 +- qml/ChannelsDelegate.qml | 56 ++++++++++++++++++++-------------------- qml/MainPage.qml | 38 ++++++++++++++++++++++----- qml/main.qml | 2 +- 5 files changed, 62 insertions(+), 38 deletions(-) diff --git a/qml/About.qml b/qml/About.qml index 7e5fbc5..7ca0288 100644 --- a/qml/About.qml +++ b/qml/About.qml @@ -1,5 +1,5 @@ import QtQuick 1.0 -import com.meego 1.0 +import com.nokia.meego 1.0 Page { diff --git a/qml/ChannelPlayer.qml b/qml/ChannelPlayer.qml index bc8dd6c..668bf4d 100644 --- a/qml/ChannelPlayer.qml +++ b/qml/ChannelPlayer.qml @@ -1,5 +1,5 @@ import QtQuick 1.0 -import com.meego 1.0 +import com.nokia.meego 1.0 Page { diff --git a/qml/ChannelsDelegate.qml b/qml/ChannelsDelegate.qml index ca59f3c..7f1fcbb 100644 --- a/qml/ChannelsDelegate.qml +++ b/qml/ChannelsDelegate.qml @@ -1,5 +1,5 @@ import QtQuick 1.0 -import com.meego 1.0 +import com.nokia.meego 1.0 Component { @@ -20,12 +20,6 @@ Component source: "image://theme/meegotouch-list-background-pressed-center" } - Item - { - width: 10 - height: 100 - } - Image { id: thumb @@ -37,21 +31,23 @@ Component height: 90 } - Item + Image { - width: 15 - height: 100 + id: arrow + source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "") + anchors.right: parent.right; + anchors.rightMargin: 5 + anchors.verticalCenter: parent.verticalCenter } Column { - height: 98 - width: parent.width - 95 anchors.top: parent.top - anchors.right: parent.right anchors.topMargin: 5 - anchors.left: parent.left - anchors.leftMargin: 100 + anchors.right: arrow.left + anchors.rightMargin: 10 + anchors.left: thumb.right + anchors.leftMargin: 10 spacing: 2 Label @@ -59,6 +55,10 @@ Component text: channelName; font.pixelSize: 22; font.weight: Font.Bold; + maximumLineCount: 1 + elide: Text.ElideRight + anchors.left: parent.left + anchors.right: parent.right } Label @@ -66,8 +66,11 @@ Component text: channelDescription; font.pixelSize: 16; font.weight: Font.Light; - width: parent.width - thumb.width + 30 - wrapMode: "WordWrap" + maximumLineCount: 2 + elide: Text.ElideRight + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + anchors.left: parent.left + anchors.right: parent.right } Label @@ -75,15 +78,11 @@ Component text: song; font.pixelSize: 16; font.weight: Font.Bold; - width: parent.width - thumb.width + 30 - wrapMode: "WordWrap" - } - - Image - { - source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "") - anchors.right: parent.right; - anchors.verticalCenter: parent.verticalCenter //FIXME: how to center eliminating the warning at runtime? + maximumLineCount: 1 + elide: Text.ElideRight + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + anchors.left: parent.left + anchors.right: parent.right } } @@ -92,7 +91,8 @@ Component anchors.bottom: parent.bottom height: 1 color: "#e4e5e7" - width: channels.width + anchors.left: parent.left + anchors.right: parent.right } ChannelPlayer {id: channelPlayer } @@ -107,7 +107,7 @@ Component console.debug(channelName + " clicked"); console.debug(songUrlFast); - if(mainPage.currentChannel != channelName) + if (mainPage.currentChannel != channelName) { appWindow.loadChannel(songUrlFast); } diff --git a/qml/MainPage.qml b/qml/MainPage.qml index 40d02a4..014cab3 100644 --- a/qml/MainPage.qml +++ b/qml/MainPage.qml @@ -1,5 +1,5 @@ import QtQuick 1.0 -import com.meego 1.0 +import com.nokia.meego 1.0 Page { id: mainPage @@ -7,14 +7,38 @@ Page { property string currentChannel: "" - ChannelsDelegate { id: delegate } - ChannelsModel { id: model } + Image + { + id: header + height: 72 + source: "image://theme/color13-meegotouch-view-header-fixed" + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + + Text + { + text: "CuteSoma" + color: "white" + font.family: "Nokia Pure Text" + font.pixelSize: 32 + anchors.left: parent.left + anchors.leftMargin: 20 + anchors.verticalCenter: parent.verticalCenter + } + } ListView { - id: channelsView; - model: model; - delegate: delegate; - width: parent.width; height: parent.height; x: 0; cacheBuffer: 100; + id: channelsView + model: ChannelsModel {} + delegate: ChannelsDelegate {} + clip: true + anchors.top: header.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom } + + } diff --git a/qml/main.qml b/qml/main.qml index 4c19a0f..5c853b4 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -1,5 +1,5 @@ import QtQuick 1.0 -import com.meego 1.0 +import com.nokia.meego 1.0 PageStackWindow { From f2ea2bd45fdcd2e767915d306e16e961d829241e Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 21:47:58 +0100 Subject: [PATCH 02/11] Don't hold more image data than needed. --- qml/ChannelsDelegate.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qml/ChannelsDelegate.qml b/qml/ChannelsDelegate.qml index 7f1fcbb..721fb59 100644 --- a/qml/ChannelsDelegate.qml +++ b/qml/ChannelsDelegate.qml @@ -24,6 +24,8 @@ Component { id: thumb source: channelImage + sourceSize.height: 90 + sourceSize.width: 90 anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: 5 From 0d76fbd8fa38093d741d8bbd320e47ccec7218b5 Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 22:23:26 +0100 Subject: [PATCH 03/11] Changed to new recommended application layout. Should make it easier to keep it up to date with new QtCreator releases. Also directly calling the servercomm slots instead of going through signals. --- .gitignore | 2 + CuteSoma.pro | 67 ++++--- main.cpp | 30 +-- qml/{ => CuteSoma}/About.qml | 0 qml/{ => CuteSoma}/ChannelPlayer.qml | 8 +- qml/{ => CuteSoma}/ChannelsDelegate.qml | 2 +- qml/{ => CuteSoma}/ChannelsModel.qml | 0 qml/{ => CuteSoma}/MainPage.qml | 0 qml/{ => CuteSoma}/main.qml | 8 +- qmlapplicationviewer/qmlapplicationviewer.cpp | 174 ++++++++++++++++++ qmlapplicationviewer/qmlapplicationviewer.h | 46 +++++ qmlapplicationviewer/qmlapplicationviewer.pri | 148 +++++++++++++++ 12 files changed, 437 insertions(+), 48 deletions(-) create mode 100644 .gitignore rename qml/{ => CuteSoma}/About.qml (100%) rename qml/{ => CuteSoma}/ChannelPlayer.qml (98%) rename qml/{ => CuteSoma}/ChannelsDelegate.qml (98%) rename qml/{ => CuteSoma}/ChannelsModel.qml (100%) rename qml/{ => CuteSoma}/MainPage.qml (100%) rename qml/{ => CuteSoma}/main.qml (89%) create mode 100644 qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 qmlapplicationviewer/qmlapplicationviewer.pri diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..52243f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +CuteSoma.pro.user + diff --git a/CuteSoma.pro b/CuteSoma.pro index f5f3810..c099337 100644 --- a/CuteSoma.pro +++ b/CuteSoma.pro @@ -1,11 +1,12 @@ # Add more folders to ship with the application, here +folder_01.source = qml/CuteSoma +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 # Additional import path used to resolve QML modules in Creator's code model QML_IMPORT_PATH = -QT+= declarative -QT+= network -symbian:TARGET.UID3 = 0xE6ACF247 +symbian:TARGET.UID3 = 0xEEA50959 # Smart Installer package's UID # This UID is from the protected range and therefore the package will @@ -22,41 +23,53 @@ symbian:TARGET.CAPABILITY += NetworkServices CONFIG += mobility MOBILITY += multimedia +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +CONFIG += qdeclarative-boostable + +# Add dependency to Symbian components +# CONFIG += qt-components + # The .cpp file which was generated for your project. Feel free to hack it. -SOURCES += main.cpp \ +SOURCES += \ + main.cpp \ servercomm.cpp \ playlistreader.cpp +HEADERS += \ + servercomm.h \ + playlistreader.h + +RESOURCES += \ + res.qrc + +# Please do not modify the following two lines. Required for deployment. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() OTHER_FILES += \ - qml/MainPage.qml \ - qml/main.qml \ - CuteSoma.desktop \ - CuteSoma.svg \ qtc_packaging/debian_harmattan/rules \ qtc_packaging/debian_harmattan/README \ + qtc_packaging/debian_harmattan/manifest.aegis \ qtc_packaging/debian_harmattan/copyright \ qtc_packaging/debian_harmattan/control \ qtc_packaging/debian_harmattan/compat \ - qtc_packaging/debian_harmattan/changelog \ - qml/ChannelsDelegate.qml \ - qml/ChannelsModel.qml \ - qml/ChannelPlayer.qml \ - qml/About.qml - -RESOURCES += \ - res.qrc + qtc_packaging/debian_harmattan/changelog -# Please do not modify the following two lines. Required for deployment. -include(deployment.pri) -qtcAddDeployment() +contains(MEEGO_EDITION,harmattan) { + desktopfile.files = $${TARGET}.desktop + desktopfile.path = /usr/share/applications + INSTALLS += desktopfile +} -# enable booster -CONFIG += qdeclarative-boostable -QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -QMAKE_LFLAGS += -pie -rdynamic - -HEADERS += \ - servercomm.h \ - playlistreader.h +contains(MEEGO_EDITION,harmattan) { + icon.files = $${TARGET}.svg + icon.path = /usr/share/icons/hicolor/80x80/apps + INSTALLS += icon +} +#TODO: Create splash screen, then enable +#contains(MEEGO_EDITION,harmattan) { +# splash.files = splash.png +# splash.path = /opt/CuteSoma +# INSTALLS += splash +#} diff --git a/main.cpp b/main.cpp index 81c97e5..e73faad 100644 --- a/main.cpp +++ b/main.cpp @@ -1,24 +1,30 @@ #include #include +#include "qmlapplicationviewer.h" #include "servercomm.h" -int main(int argc, char *argv[]) +Q_DECL_EXPORT int main(int argc, char *argv[]) { - QApplication app(argc, argv); - QDeclarativeView view; - view.setSource(QUrl("qrc:/qml/main.qml")); + QScopedPointer app(createApplication(argc, argv)); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/CuteSoma/main.qml")); + - QObject *root = (QObject*)(view.rootObject()); ServerComm sc; - view.rootContext()->setContextProperty("serverComm", &sc); + viewer.rootContext()->setContextProperty("serverComm", &sc); + + viewer.showExpanded(); + + //QObject *root = (QObject*)(viewer.rootObject()); - QObject::connect(root, SIGNAL(play()), &sc, SLOT(play())); - QObject::connect(root, SIGNAL(pause()), &sc, SLOT(pause())); - QObject::connect(root, SIGNAL(loadChannel(QString)), &sc, SLOT(loadChannel(QString))); - QObject::connect((QObject*)view.engine(), SIGNAL(quit()), &app, SLOT(quit())); - view.showFullScreen(); +// QObject::connect(root, SIGNAL(play()), &sc, SLOT(play())); +// QObject::connect(root, SIGNAL(pause()), &sc, SLOT(pause())); +// QObject::connect(root, SIGNAL(loadChannel(QString)), &sc, SLOT(loadChannel(QString))); + //QObject::connect(viewer.engine(), SIGNAL(quit()), &app, SLOT(quit())); - return app.exec(); + return app->exec(); } diff --git a/qml/About.qml b/qml/CuteSoma/About.qml similarity index 100% rename from qml/About.qml rename to qml/CuteSoma/About.qml diff --git a/qml/ChannelPlayer.qml b/qml/CuteSoma/ChannelPlayer.qml similarity index 98% rename from qml/ChannelPlayer.qml rename to qml/CuteSoma/ChannelPlayer.qml index 668bf4d..79e3396 100644 --- a/qml/ChannelPlayer.qml +++ b/qml/CuteSoma/ChannelPlayer.qml @@ -147,7 +147,7 @@ Page imgPlayL.visible = false; imgPauseL.visible = true; - appWindow.play(); + serverComm.play(); } else { @@ -156,7 +156,7 @@ Page imgPlayL.visible = true; imgPauseL.visible = false; - appWindow.pause(); + serverComm.pause(); } } } @@ -293,7 +293,7 @@ Page imgPlayL.visible = false; imgPauseL.visible = true; - appWindow.play(); + serverComm.play(); } else { @@ -302,7 +302,7 @@ Page imgPlayL.visible = true; imgPauseL.visible = false; - appWindow.pause(); + serverComm.pause(); } } } diff --git a/qml/ChannelsDelegate.qml b/qml/CuteSoma/ChannelsDelegate.qml similarity index 98% rename from qml/ChannelsDelegate.qml rename to qml/CuteSoma/ChannelsDelegate.qml index 721fb59..6c2a94b 100644 --- a/qml/ChannelsDelegate.qml +++ b/qml/CuteSoma/ChannelsDelegate.qml @@ -111,7 +111,7 @@ Component if (mainPage.currentChannel != channelName) { - appWindow.loadChannel(songUrlFast); + serverComm.loadChannel(songUrlFast) } mainPage.currentChannel = channelName; diff --git a/qml/ChannelsModel.qml b/qml/CuteSoma/ChannelsModel.qml similarity index 100% rename from qml/ChannelsModel.qml rename to qml/CuteSoma/ChannelsModel.qml diff --git a/qml/MainPage.qml b/qml/CuteSoma/MainPage.qml similarity index 100% rename from qml/MainPage.qml rename to qml/CuteSoma/MainPage.qml diff --git a/qml/main.qml b/qml/CuteSoma/main.qml similarity index 89% rename from qml/main.qml rename to qml/CuteSoma/main.qml index 5c853b4..e6008be 100644 --- a/qml/main.qml +++ b/qml/CuteSoma/main.qml @@ -7,10 +7,10 @@ PageStackWindow initialPage: mainPage MainPage { id: mainPage } - signal play() - signal pause() - signal loadChannel(string channel) - signal updateChannelInfo(string channel) +// signal play() +// signal pause() +// signal loadChannel(string channel) +// signal updateChannelInfo(string channel) About { id: aboutPage } diff --git a/qmlapplicationviewer/qmlapplicationviewer.cpp b/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..997bbfc --- /dev/null +++ b/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,174 @@ +// checksum 0xee24 version 0x70013 +/* + This file was generated by the Qt Quick Application wizard of Qt Creator. + QmlApplicationViewer is a convenience class containing mobile device specific + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#include "qmlapplicationviewer.h" + +#include +#include +#include +#include +#include +#include + +#include // MEEGO_EDITION_HARMATTAN + +#ifdef HARMATTAN_BOOSTER +#include +#endif + +#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 + +#include + +#if !defined(NO_JSDEBUGGER) +#include +#endif +#if !defined(NO_QMLOBSERVER) +#include +#endif + +// Enable debugging before any QDeclarativeEngine is created +struct QmlJsDebuggingEnabler +{ + QmlJsDebuggingEnabler() + { + QDeclarativeDebugHelper::enableDebugging(); + } +}; + +// Execute code in constructor before first QDeclarativeEngine is instantiated +static QmlJsDebuggingEnabler enableDebuggingHelper; + +#endif // QMLJSDEBUGGER + +class QmlApplicationViewerPrivate +{ + QString mainQmlFile; + friend class QmlApplicationViewer; + static QString adjustPath(const QString &path); +}; + +QString QmlApplicationViewerPrivate::adjustPath(const QString &path) +{ +#ifdef Q_OS_UNIX +#ifdef Q_OS_MAC + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("%1/../Resources/%2") + .arg(QCoreApplication::applicationDirPath(), path); +#else + const QString pathInInstallDir = + QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path); + if (QFileInfo(pathInInstallDir).exists()) + return pathInInstallDir; +#endif +#endif + return path; +} + +QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) + : QDeclarativeView(parent) + , d(new QmlApplicationViewerPrivate()) +{ + connect(engine(), SIGNAL(quit()), SLOT(close())); + setResizeMode(QDeclarativeView::SizeRootObjectToView); + // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in +#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 +#if !defined(NO_JSDEBUGGER) + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#if !defined(NO_QMLOBSERVER) + new QmlJSDebugger::QDeclarativeViewObserver(this, this); +#endif +#endif +} + +QmlApplicationViewer::~QmlApplicationViewer() +{ + delete d; +} + +QmlApplicationViewer *QmlApplicationViewer::create() +{ + return new QmlApplicationViewer(); +} + +void QmlApplicationViewer::setMainQmlFile(const QString &file) +{ + d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file); + setSource(QUrl::fromLocalFile(d->mainQmlFile)); +} + +void QmlApplicationViewer::addImportPath(const QString &path) +{ + engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path)); +} + +void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) +{ +#if defined(Q_OS_SYMBIAN) + // If the version of Qt on the device is < 4.7.2, that attribute won't work + if (orientation != ScreenOrientationAuto) { + const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); + if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { + qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); + return; + } + } +#endif // Q_OS_SYMBIAN + + Qt::WidgetAttribute attribute; + switch (orientation) { +#if QT_VERSION < 0x040702 + // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes + case ScreenOrientationLockPortrait: + attribute = static_cast(128); + break; + case ScreenOrientationLockLandscape: + attribute = static_cast(129); + break; + default: + case ScreenOrientationAuto: + attribute = static_cast(130); + break; +#else // QT_VERSION < 0x040702 + case ScreenOrientationLockPortrait: + attribute = Qt::WA_LockPortraitOrientation; + break; + case ScreenOrientationLockLandscape: + attribute = Qt::WA_LockLandscapeOrientation; + break; + default: + case ScreenOrientationAuto: + attribute = Qt::WA_AutoOrientation; + break; +#endif // QT_VERSION < 0x040702 + }; + setAttribute(attribute, true); +} + +void QmlApplicationViewer::showExpanded() +{ +#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR) + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) + showMaximized(); +#else + show(); +#endif +} + +QApplication *createApplication(int &argc, char **argv) +{ +#ifdef HARMATTAN_BOOSTER + return MDeclarativeCache::qApplication(argc, argv); +#else + return new QApplication(argc, argv); +#endif +} diff --git a/qmlapplicationviewer/qmlapplicationviewer.h b/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..b01cc88 --- /dev/null +++ b/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,46 @@ +// checksum 0x898f version 0x70013 +/* + This file was generated by the Qt Quick Application wizard of Qt Creator. + QmlApplicationViewer is a convenience class containing mobile device specific + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#ifndef QMLAPPLICATIONVIEWER_H +#define QMLAPPLICATIONVIEWER_H + +#include + +class QmlApplicationViewer : public QDeclarativeView +{ + Q_OBJECT + +public: + enum ScreenOrientation { + ScreenOrientationLockPortrait, + ScreenOrientationLockLandscape, + ScreenOrientationAuto + }; + + explicit QmlApplicationViewer(QWidget *parent = 0); + virtual ~QmlApplicationViewer(); + + static QmlApplicationViewer *create(); + + void setMainQmlFile(const QString &file); + void addImportPath(const QString &path); + + // Note that this will only have an effect on Symbian and Fremantle. + void setOrientation(ScreenOrientation orientation); + + void showExpanded(); + +private: + class QmlApplicationViewerPrivate *d; +}; + +QApplication *createApplication(int &argc, char **argv); + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/qmlapplicationviewer/qmlapplicationviewer.pri b/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000..b6931d0 --- /dev/null +++ b/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,148 @@ +# checksum 0x5b42 version 0x70013 +# This file was generated by the Qt Quick Application wizard of Qt Creator. +# The code below adds the QmlApplicationViewer to the project and handles the +# activation of QML debugging. +# It is recommended not to modify this file, since newer versions of Qt Creator +# may offer an updated version of it. + +QT += declarative + +SOURCES += $$PWD/qmlapplicationviewer.cpp +HEADERS += $$PWD/qmlapplicationviewer.h +INCLUDEPATH += $$PWD + +# Include JS debugger library if QMLJSDEBUGGER_PATH is set +!isEmpty(QMLJSDEBUGGER_PATH) { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) +} else { + DEFINES -= QMLJSDEBUGGER +} + +contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) { + DEFINES += HARMATTAN_BOOSTER +} +# This file was generated by an application wizard of Qt Creator. +# The code below handles deployment to Symbian and Maemo, aswell as copying +# of the application data to shadow build directories on desktop. +# It is recommended not to modify this file, since newer versions of Qt Creator +# may offer an updated version of it. + +defineTest(qtcAddDeployment) { +for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + itemsources = $${item}.sources + $$itemsources = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath= $$eval($${deploymentfolder}.target) + export($$itemsources) + export($$itempath) + DEPLOYMENT += $$item +} + +MAINPROFILEPWD = $$PWD + +symbian { + isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg + isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 +} else:win32 { + copyCommand = + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) + source = $$replace(source, /, \\) + sourcePathSegments = $$split(source, \\) + target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments) + target = $$replace(target, /, \\) + target ~= s,\\\\\\.?\\\\,\\, + !isEqual(source,$$target) { + !isEmpty(copyCommand):copyCommand += && + isEqual(QMAKE_DIR_SEP, \\) { + copyCommand += $(COPY_DIR) \"$$source\" \"$$target\" + } else { + source = $$replace(source, \\\\, /) + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + target = $$replace(target, \\\\, /) + copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\" + } + } + } + !isEmpty(copyCommand) { + copyCommand = @echo Copying application data... && $$copyCommand + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + desktopfile.files = $${TARGET}.desktop + desktopfile.path = /usr/share/applications/hildon + icon.files = $${TARGET}64.png + icon.path = /usr/share/icons/hicolor/64x64/apps + } else:!isEmpty(MEEGO_VERSION_MAJOR) { + desktopfile.files = $${TARGET}_harmattan.desktop + desktopfile.path = /usr/share/applications + icon.files = $${TARGET}80.png + icon.path = /usr/share/icons/hicolor/80x80/apps + } else { # Assumed to be a Desktop Unix + copyCommand = + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) + source = $$replace(source, \\\\, /) + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + target = $$replace(target, \\\\, /) + sourcePathSegments = $$split(source, /) + targetFullPath = $$target/$$last(sourcePathSegments) + targetFullPath ~= s,/\\.?/,/, + !isEqual(source,$$targetFullPath) { + !isEmpty(copyCommand):copyCommand += && + copyCommand += $(MKDIR) \"$$target\" + copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\" + } + } + !isEmpty(copyCommand) { + copyCommand = @echo Copying application data... && $$copyCommand + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } + } + installPrefix = /opt/$${TARGET} + for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + itemfiles = $${item}.files + $$itemfiles = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + + !isEmpty(desktopfile.path) { + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + INSTALLS += icon desktopfile + } + + target.path = $${installPrefix}/bin + export(target.path) + INSTALLS += target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} From 6900d2adbec7ba96e1f0db2ceb6d244fccea887b Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 22:30:02 +0100 Subject: [PATCH 04/11] Loading images asynchronous --- qml/CuteSoma/ChannelPlayer.qml | 2 ++ qml/CuteSoma/ChannelsDelegate.qml | 1 + 2 files changed, 3 insertions(+) diff --git a/qml/CuteSoma/ChannelPlayer.qml b/qml/CuteSoma/ChannelPlayer.qml index 79e3396..1bfe423 100644 --- a/qml/CuteSoma/ChannelPlayer.qml +++ b/qml/CuteSoma/ChannelPlayer.qml @@ -50,6 +50,7 @@ Page source: channelImage width: 310 height: 310 + asynchronous: true anchors.left: parent.left anchors.leftMargin: 10 } @@ -190,6 +191,7 @@ Page source: channelImage width: 400 height: 400 + asynchronous: true anchors.top: parent.top anchors.topMargin: 10 anchors.left: parent.left diff --git a/qml/CuteSoma/ChannelsDelegate.qml b/qml/CuteSoma/ChannelsDelegate.qml index 6c2a94b..d4899be 100644 --- a/qml/CuteSoma/ChannelsDelegate.qml +++ b/qml/CuteSoma/ChannelsDelegate.qml @@ -26,6 +26,7 @@ Component source: channelImage sourceSize.height: 90 sourceSize.width: 90 + asynchronous: true anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: 5 From 5c2f3ebb9ab6ff5af62552322e7c6ff652bb534f Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 22:37:20 +0100 Subject: [PATCH 05/11] Small clean ups --- main.cpp | 14 +------------- qml/CuteSoma/main.qml | 5 ----- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/main.cpp b/main.cpp index e73faad..a977c75 100644 --- a/main.cpp +++ b/main.cpp @@ -7,24 +7,12 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) { QScopedPointer app(createApplication(argc, argv)); + ServerComm sc; QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.setMainQmlFile(QLatin1String("qml/CuteSoma/main.qml")); - - - - ServerComm sc; viewer.rootContext()->setContextProperty("serverComm", &sc); - viewer.showExpanded(); - //QObject *root = (QObject*)(viewer.rootObject()); - - -// QObject::connect(root, SIGNAL(play()), &sc, SLOT(play())); -// QObject::connect(root, SIGNAL(pause()), &sc, SLOT(pause())); -// QObject::connect(root, SIGNAL(loadChannel(QString)), &sc, SLOT(loadChannel(QString))); - //QObject::connect(viewer.engine(), SIGNAL(quit()), &app, SLOT(quit())); - return app->exec(); } diff --git a/qml/CuteSoma/main.qml b/qml/CuteSoma/main.qml index e6008be..96846cc 100644 --- a/qml/CuteSoma/main.qml +++ b/qml/CuteSoma/main.qml @@ -7,11 +7,6 @@ PageStackWindow initialPage: mainPage MainPage { id: mainPage } -// signal play() -// signal pause() -// signal loadChannel(string channel) -// signal updateChannelInfo(string channel) - About { id: aboutPage } ToolBarLayout From aca26f831d190a4c2d83f58cd344d32b8632de43 Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 22:37:38 +0100 Subject: [PATCH 06/11] SVG icon didn't work for me. Added PNG icon. --- CuteSoma.desktop | 2 +- CuteSoma.png | Bin 0 -> 7635 bytes CuteSoma.pro | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 CuteSoma.png diff --git a/CuteSoma.desktop b/CuteSoma.desktop index 0b0782d..7ea0cc1 100644 --- a/CuteSoma.desktop +++ b/CuteSoma.desktop @@ -5,7 +5,7 @@ Type=Application Terminal=false Name=CuteSoma Exec=/usr/bin/single-instance /opt/CuteSoma/bin/CuteSoma -Icon=/usr/share/icons/hicolor/scalable/apps/CuteSoma.svg +Icon=/usr/share/icons/hicolor/80x80/apps/CuteSoma.png X-Window-Icon= X-HildonDesk-ShowInToolbar=true X-Osso-Type=application/x-executable diff --git a/CuteSoma.png b/CuteSoma.png new file mode 100644 index 0000000000000000000000000000000000000000..0df0b9e7557573850b442fea4e22f59e96fad3b4 GIT binary patch literal 7635 zcmV;^9W3IBP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iyS$ z6(J#OIAp#603B0FL_t(|+Qof&kQ~*S=kI%Y)ZNvW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grT9KhV%31&xdK6!ncB9jX>1! zG%-S4XGH@Sj{WF4E2Y%%@NmO37cN|gxbvst`2Um%pBOyTa*_Z5002ovPDHLkV1j_Z BlSKdk literal 0 HcmV?d00001 diff --git a/CuteSoma.pro b/CuteSoma.pro index c099337..968d201 100644 --- a/CuteSoma.pro +++ b/CuteSoma.pro @@ -62,7 +62,7 @@ contains(MEEGO_EDITION,harmattan) { } contains(MEEGO_EDITION,harmattan) { - icon.files = $${TARGET}.svg + icon.files = $${TARGET}.png icon.path = /usr/share/icons/hicolor/80x80/apps INSTALLS += icon } From ef0f303523a5f9a70efa14e0ae5e356af4b11bac Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 22:50:00 +0100 Subject: [PATCH 07/11] Fixed compiler error. The QML files have moved and we don't need to include them in the ressources anymore. --- res.qrc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/res.qrc b/res.qrc index 58d52a6..ce2f793 100644 --- a/res.qrc +++ b/res.qrc @@ -1,11 +1,5 @@ - qml/main.qml - qml/MainPage.qml - qml/ChannelsDelegate.qml - qml/ChannelsModel.qml - qml/ChannelPlayer.qml - qml/About.qml CuteSoma_180x180.png From e01ecafbba248a1c8943f36769160849bc9c8ece Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 23:03:08 +0100 Subject: [PATCH 08/11] Set rootContext before mainQmlFile to make sure the context is there when the QML file is loaded. --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index a977c75..c837706 100644 --- a/main.cpp +++ b/main.cpp @@ -9,9 +9,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) ServerComm sc; QmlApplicationViewer viewer; + viewer.rootContext()->setContextProperty("serverComm", &sc); viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.setMainQmlFile(QLatin1String("qml/CuteSoma/main.qml")); - viewer.rootContext()->setContextProperty("serverComm", &sc); viewer.showExpanded(); return app->exec(); From f6cf522fa3cd0cd03cf0f6a6ee5c2d4f3857b1f5 Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 23:05:31 +0100 Subject: [PATCH 09/11] Remove the ChannelPlayer from ChannelsDelegate because this instantiates a new (and complex) ChannelPlayer for each ChannelsDelegate. Because of that the list was not scrolling smooth. Now it's smooth :) --- qml/CuteSoma/ChannelPlayer.qml | 27 +++++++++++++++------------ qml/CuteSoma/ChannelsDelegate.qml | 3 ++- qml/CuteSoma/main.qml | 3 +++ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/qml/CuteSoma/ChannelPlayer.qml b/qml/CuteSoma/ChannelPlayer.qml index 1bfe423..125693b 100644 --- a/qml/CuteSoma/ChannelPlayer.qml +++ b/qml/CuteSoma/ChannelPlayer.qml @@ -4,6 +4,9 @@ import com.nokia.meego 1.0 Page { id: channelPlayer + + property QtObject model: null + tools: backMenuTool Connections @@ -47,7 +50,7 @@ Page Image { id: radioImageL - source: channelImage + source: model ? model.channelImage : "" width: 310 height: 310 asynchronous: true @@ -63,7 +66,7 @@ Page Label { id: nameLabelL - text: channelName; + text: model ? model.channelName : "" font.pixelSize: 34; font.weight: Font.Bold; } @@ -71,7 +74,7 @@ Page Label { id: djLabelL - text: "Dj: " + channelDj; + text: "Dj: " + (model ? model.channelDj : "") font.pixelSize: 25; font.weight: Font.Light; anchors.top: nameLabelL.bottom @@ -81,7 +84,7 @@ Page Label { id: descriptionLabelL - text: channelDescription; + text: model ? model.channelDescription : "" font.pixelSize: 30; font.weight: Font.Light; width: channelPlayer.width - radioImageL.width - 20; @@ -93,7 +96,7 @@ Page Label { id: listenersLabelL - text: "Listeners: " + channelListeners; + text: "Listeners: " + (model ? model.channelListeners : "") font.pixelSize: 25; font.weight: Font.Light; anchors.top: descriptionLabelL.bottom @@ -103,7 +106,7 @@ Page Label { id: songLabelL - text: song; + text: model ? model.song : "" font.pixelSize: 25; font.weight: Font.Bold; anchors.top: listenersLabelL.bottom @@ -188,7 +191,7 @@ Page Image { id: radioImageP - source: channelImage + source: model ? model.channelImage : "" width: 400 height: 400 asynchronous: true @@ -208,7 +211,7 @@ Page Label { id: nameLabelP - text: channelName; + text: model ? model.channelName : "" font.pixelSize: 34; font.weight: Font.Bold; } @@ -216,7 +219,7 @@ Page Label { id: djLabelP - text: "Dj: " + channelDj; + text: "Dj: " + (model ? model.channelDj : "") font.pixelSize: 25; font.weight: Font.Light; anchors.top: nameLabelP.bottom @@ -226,7 +229,7 @@ Page Label { id: descriptionLabelP - text: channelDescription; + text: model ? model.channelDescription : "" font.pixelSize: 25; font.weight: Font.Light; width: channelPlayer.width - 20 @@ -238,7 +241,7 @@ Page Label { id: listenersLabelP - text: "Listeners: " + channelListeners; + text: "Listeners: " + (model ? model.channelListeners : "") font.pixelSize: 25; font.weight: Font.Light; anchors.top: descriptionLabelP.bottom @@ -248,7 +251,7 @@ Page Label { id: songLabelP - text: song; + text: model ? model.song : "" font.pixelSize: 25; font.weight: Font.Bold; anchors.top: listenersLabelP.bottom diff --git a/qml/CuteSoma/ChannelsDelegate.qml b/qml/CuteSoma/ChannelsDelegate.qml index d4899be..891c293 100644 --- a/qml/CuteSoma/ChannelsDelegate.qml +++ b/qml/CuteSoma/ChannelsDelegate.qml @@ -98,7 +98,7 @@ Component anchors.right: parent.right } - ChannelPlayer {id: channelPlayer } + //ChannelPlayer {id: channelPlayer } MouseArea { @@ -116,6 +116,7 @@ Component } mainPage.currentChannel = channelName; + channelPlayer.model = model pageStack.push(channelPlayer) } } diff --git a/qml/CuteSoma/main.qml b/qml/CuteSoma/main.qml index 96846cc..c22d950 100644 --- a/qml/CuteSoma/main.qml +++ b/qml/CuteSoma/main.qml @@ -5,10 +5,13 @@ PageStackWindow { id: appWindow initialPage: mainPage + MainPage { id: mainPage } About { id: aboutPage } + ChannelPlayer { id: channelPlayer } + ToolBarLayout { id: commonTools From f546292a3a0b5fdac4202af5aa3c02bc0feac783 Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 23:20:07 +0100 Subject: [PATCH 10/11] Fixed a bug I added before. Updates didn't completely work. --- qml/CuteSoma/ChannelPlayer.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qml/CuteSoma/ChannelPlayer.qml b/qml/CuteSoma/ChannelPlayer.qml index 125693b..a6efc75 100644 --- a/qml/CuteSoma/ChannelPlayer.qml +++ b/qml/CuteSoma/ChannelPlayer.qml @@ -31,7 +31,7 @@ Page onUpdateSong: { - appWindow.updateChannelInfo(channelName); + serverComm.updateChannelInfo(model.channelName); } } From 0a00d6ca98c4f7960172eff74f0b7aa1f8cab32c Mon Sep 17 00:00:00 2001 From: Cornelius Hald Date: Fri, 6 Jan 2012 23:25:06 +0100 Subject: [PATCH 11/11] Added hi-res images to ChannelPlayer. --- qml/CuteSoma/ChannelPlayer.qml | 10 ++++++++-- qml/CuteSoma/ChannelsModel.qml | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qml/CuteSoma/ChannelPlayer.qml b/qml/CuteSoma/ChannelPlayer.qml index a6efc75..e5df074 100644 --- a/qml/CuteSoma/ChannelPlayer.qml +++ b/qml/CuteSoma/ChannelPlayer.qml @@ -50,10 +50,13 @@ Page Image { id: radioImageL - source: model ? model.channelImage : "" + source: model ? model.channelImageBig : "" width: 310 height: 310 + sourceSize.width: 310 + sourceSize.height: 310 asynchronous: true + smooth: true anchors.left: parent.left anchors.leftMargin: 10 } @@ -191,10 +194,13 @@ Page Image { id: radioImageP - source: model ? model.channelImage : "" + source: model ? model.channelImageBig : "" width: 400 height: 400 + sourceSize.height: 400 + sourceSize.width: 400 asynchronous: true + smooth: true anchors.top: parent.top anchors.topMargin: 10 anchors.left: parent.left diff --git a/qml/CuteSoma/ChannelsModel.qml b/qml/CuteSoma/ChannelsModel.qml index 165e176..89422f3 100644 --- a/qml/CuteSoma/ChannelsModel.qml +++ b/qml/CuteSoma/ChannelsModel.qml @@ -7,6 +7,7 @@ XmlListModel query: "/channels/channel" XmlRole { name: "channelImage"; query: "image/string()" } + XmlRole { name: "channelImageBig"; query: "xlimage/string()" } XmlRole { name: "channelName"; query: "title/string()" } XmlRole { name: "channelDescription"; query: "description/string()" } XmlRole { name: "song"; query: "lastPlaying[1]/string()" }