Commit da985c12 authored by Mike Sheldon's avatar Mike Sheldon

Initial commit of MeeGo client

parent d39bbabb
#############################################################################
# Makefile for building: librefm
# Generated by qmake (2.01a) (Qt 4.7.4) on: Fri Jul 1 01:50:42 2011
# Project: librefm.pro
# Template: subdirs
# Command: /usr/bin/qmake -o Makefile librefm.pro
#############################################################################
first: make_default
MAKEFILE = Makefile
QMAKE = /usr/bin/qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = $(COPY)
COPY_DIR = $(COPY) -r
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
SUBTARGETS = \
sub-src
src/$(MAKEFILE):
@$(CHK_DIR_EXISTS) src/ || $(MKDIR) src/
cd src/ && $(QMAKE) /home/mike/scratchbox/src/Libre.fm/librefm-0.1/src/src.pro -o $(MAKEFILE)
sub-src-qmake_all: FORCE
@$(CHK_DIR_EXISTS) src/ || $(MKDIR) src/
cd src/ && $(QMAKE) /home/mike/scratchbox/src/Libre.fm/librefm-0.1/src/src.pro -o $(MAKEFILE)
sub-src: src/$(MAKEFILE) FORCE
cd src/ && $(MAKE) -f $(MAKEFILE)
sub-src-make_default: src/$(MAKEFILE) FORCE
cd src/ && $(MAKE) -f $(MAKEFILE)
sub-src-make_first: src/$(MAKEFILE) FORCE
cd src/ && $(MAKE) -f $(MAKEFILE) first
sub-src-all: src/$(MAKEFILE) FORCE
cd src/ && $(MAKE) -f $(MAKEFILE) all
sub-src-clean: src/$(MAKEFILE) FORCE
cd src/ && $(MAKE) -f $(MAKEFILE) clean
sub-src-distclean: src/$(MAKEFILE) FORCE
cd src/ && $(MAKE) -f $(MAKEFILE) distclean
sub-src-install_subtargets: src/$(MAKEFILE) FORCE
cd src/ && $(MAKE) -f $(MAKEFILE) install
sub-src-uninstall_subtargets: src/$(MAKEFILE) FORCE
cd src/ && $(MAKE) -f $(MAKEFILE) uninstall
Makefile: librefm.pro /targets/HARMATTAN_X86/usr/share/qt4/mkspecs/linux-g++-maemo/qmake.conf /targets/HARMATTAN_X86/usr/share/qt4/mkspecs/common/g++.conf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/common/unix.conf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/common/linux.conf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/qconfig.pri \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/qt_config.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/default_pre.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/debug.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/default_post.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/warn_on.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/qt.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/moc.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/resources.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/uic.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/yacc.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/lex.prf \
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf
$(QMAKE) -o Makefile librefm.pro
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/common/g++.conf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/common/unix.conf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/common/linux.conf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/qconfig.pri:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/qt_functions.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/qt_config.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/default_pre.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/debug.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/default_post.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/warn_on.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/qt.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/unix/thread.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/moc.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/resources.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/uic.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/yacc.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/lex.prf:
/targets/HARMATTAN_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf:
qmake: qmake_all FORCE
@$(QMAKE) -o Makefile librefm.pro
qmake_all: sub-src-qmake_all FORCE
make_default: sub-src-make_default FORCE
make_first: sub-src-make_first FORCE
all: sub-src-all FORCE
clean: sub-src-clean FORCE
distclean: sub-src-distclean FORCE
-$(DEL_FILE) Makefile
install_subtargets: sub-src-install_subtargets FORCE
uninstall_subtargets: sub-src-uninstall_subtargets FORCE
sub-src-check: src/$(MAKEFILE)
cd src/ && $(MAKE) check
check: sub-src-check
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
install: install_subtargets FORCE
uninstall: uninstall_subtargets FORCE
FORCE:
This diff is collapsed.
readme for librefm
<possible notes regarding this package - if none, delete this file>
librefm for Debian
-------------------------
<possible notes regarding this package - if none, delete this file>
-- Michael Sheldon <elleo@gnu.org> Thu, 30 Jun 2011 12:28:25 +0100
librefm (0.1-1) unstable; urgency=low
* Initial release
-- Michael Sheldon <elleo@gnu.org> Thu, 30 Jun 2011 12:28:25 +0100
Source: librefm
Section: user/Other
Priority: extra
Maintainer: Michael Sheldon <elleo@gnu.org>
Build-Depends: debhelper (>= 7), dpatch
Standards-Version: 3.8.4
Homepage: http://libre.fm
Package: librefm
Architecture: any
Depends: qt-components, ${shlibs:Depends}, ${misc:Depends}
Description: Stream music from Libre.fm and discover new artists
Listen to free music released under creative commons licenses from
Libre.fm. You can legally download, remix and share any music you
hear from this service. By indicating which tracks you love you
can quickly start receiving recommendations based on your unique
tastes.
This package was debianized by:
Michael Sheldon <elleo@gnu.org> on Thu, 30 Jun 2011 12:28:25 +0100
It was downloaded from:
<url://example.com or remove>
Upstream Author(s):
Michael Sheldon <elleo@gnu.org>
Copyright:
Copyright (C) 2011 Michael Sheldon
License:
<specify license>
The Debian packaging is:
Copyright C) 2011, Michael Sheldon <elleo@gnu.org>
<specify license of debianized version or remove>
librefm_0.1-1_i386.deb user/Other extra
dh_prep
dh_installdirs
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
shlibs:Depends=libc6 (>= 2.0), libc6 (>= 2.3.6-6~), libgcc1 (>= 1:4.1.1), libqt4-declarative (>= 4.7.4~git20110516), libqt4-network (>= 4.7.4~git20110516), libqt4-xml (>= 4.7.4~git20110516), libqtcore4 (>= 4.7.4~git20110516), libqtgui4 (>= 4.7.4~git20110516), libstdc++6 (>= 4.1.1)
misc:Depends=
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
qmake -recursive
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
$(MAKE)
#docbook-to-man debian/myprogram.sgml > myprogram.1
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Add here commands to install the package into debian/myprogram.
$(MAKE) INSTALL_ROOT=$(CURDIR)/debian/librefm install
# Build architecture-independent files here.
binary-indep: install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
# dh_install
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
QMAKEVERSION = $$[QMAKE_VERSION]
ISQT4 = $$find(QMAKEVERSION, ^[2-9])
isEmpty( ISQT4 ) {
error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4");
}
TEMPLATE = subdirs
SUBDIRS = src
This diff is collapsed.
import QtQuick 1.1
import com.nokia.meego 1.0
Page {
id: aboutPage
anchors.margins: rootWin.pageMargin
tools: commonTools
Image {
source: "librefm-logo.png"
anchors.horizontalCenter: parent.horizontalCenter
z: -1
}
Column {
spacing: 10
anchors.verticalCenterOffset: 30
anchors.centerIn: parent
Label {
text: "Libre.fm MeeGo Client Version 0.1"
font.pixelSize: 34
}
Label {
text: "Released under the GPL, version 3.0 or later."
}
Label {
text: "Mike Sheldon <elleo@gnu.org>"
}
}
}
import QtQuick 1.1
import com.nokia.meego 1.0
Page {
id: loginPage
property int buttonWidth: 300
anchors.margins: rootWin.pageMargin
Connections {
target: serverComm
onLoginFailed: {
msg_logging_in.close();
msg_login_failed.open();
}
onLoginSuccessful: {
msg_logging_in.close();
rootWin.openFile("MenuPage.qml");
}
}
Image {
id: imgLibre
source: "librefm-logo.png"
anchors.horizontalCenter: parent.horizontalCenter
z: -1
}
Column {
spacing: 10
anchors.centerIn: parent
anchors.verticalCenterOffset: 15
TextField {
id: txt_username
placeholderText: "Username"
width: parent.width
}
TextField {
id: txt_password
placeholderText: "Password"
echoMode: TextInput.PasswordEchoOnEdit
width: parent.width
}
Row {
spacing: 10
Button {
text: "Login"
onClicked: {
msg_logging_in.open()
rootWin.login(txt_username.text, txt_password.text)
}
}
Button {
text: "Quit"
onClicked: Qt.quit()
}
}
}
QueryDialog {
id: msg_logging_in
titleText: "Logging in..."
rejectButtonText: "Cancel"
}
QueryDialog {
id: msg_login_failed
titleText: "Login failed"
message: "Invalid username or password"
acceptButtonText: "Okay"
}
}
This diff is collapsed.
import QtQuick 1.1
import com.nokia.meego 1.0
Page {
id: menuPage
property int buttonWidth: 300
anchors.margins: rootWin.pageMargin
Image {
id: towerImg
anchors.centerIn: parent
source: "librefm-tower.png"
z: -1
}
Grid {
rows: screen.orientation == Screen.Landscape || screen.orientation == Screen.LandscapeInverted ? 2 : 1
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 40
anchors.horizontalCenter: parent.horizontalCenter
spacing: 200
Column {
id: col_recent
spacing: 10
Label {
id: lbl_recent
text: "Recent Stations"
font.weight: Font.Bold
width: buttonWidth
}
ListModel {
id: pagesModel
ListElement {
station: "librefm://user/Elleo/loved"
title: "Elleo's Loved Station"
}
ListElement {
station: "librefm://user/Elleo/mix"
title: "Elleo's Mix Station"
}
ListElement {
station: "librefm://artist/Ani+DiFranco/similarartists"
title: "Ani DiFranco"
}
ListElement {
station: "librefm://globaltags/folk"
title: "Folk Tagged"
}
ListElement {
station: "librefm://community/loved"
title: "Community Favourites"
}
}
ListView {
id: listView
height: 300
anchors.top: lbl_recent.bottom
model: pagesModel
delegate: Item {
id: listItem
height: 44
width: buttonWidth
BorderImage {
id: background
anchors.fill: parent
visible: mouseArea.pressed
source: "image://theme/meegotouch-list-background-pressed-center"
}
Row {
anchors.fill: parent
Column {
anchors.verticalCenter: parent.verticalCenter
Label {
id: mainText
text: model.title
font.pixelSize: 22
}
}
}
Image {
source: "image://theme/icon-m-common-drilldown-arrow" + (theme.inverted ? "-inverse" : "")
anchors.right: parent.right;
anchors.verticalCenter: parent.verticalCenter
}
MouseArea {
id: mouseArea
anchors.fill: background
onClicked: {
rootWin.openFile("StationPage.qml")
rootWin.launchStation(station)
}
}
}
}
ScrollDecorator {
flickableItem: listView
}
}
Column {
id: col_buttons
spacing: 20
Button {
text: "New Station"
}
Button {
text: "Preferences"
}
Button {
text: "About"
onClicked: rootWin.openFile("About.qml")
}
Button {
text: "Quit"
onClicked: Qt.quit()
}
}
}
}
import QtQuick 1.1
import com.nokia.meego 1.0
Page {
id: stationPage
tools: commonTools
ButtonRow {
anchors.horizontalCenter: parent.horizontalCenter
exclusive: false
Button {
id: btnBan
Image {
anchors.centerIn: parent
anchors.verticalCenterOffset: -1
source: "ban.png"
}
}
Button {
id: btnTag
Image {
anchors.centerIn: parent
source: "image://theme/icon-m-toolbar-tag" + (theme.inverted ? "-inverse" : "")
}
}
Button {
id: btnPrevious
Image {
anchors.centerIn: parent
source: "image://theme/icon-m-toolbar-mediacontrol-previous" + (theme.inverted ? "-inverse" : "")
}
}
Button {
id: btnPlay
property bool playing: false;
Image {
id: imgPlay
anchors.centerIn: parent
visible: false
source: "image://theme/icon-m-toolbar-mediacontrol-play" + (theme.inverted ? "-inverse" : "")
}
Image {
id: imgPause
anchors.centerIn: parent
source: "image://theme/icon-m-toolbar-mediacontrol-pause" + (theme.inverted ? "-inverse" : "")
}
onClicked: {
if (imgPlay.visible) {
imgPlay.visible = false
imgPause.visible = true
} else {
imgPlay.visible = true
imgPause.visible = false
}
}
}
Button {
id: btnNext
Image {
anchors.centerIn: parent
source: "image://theme/icon-m-toolbar-mediacontrol-next" + (theme.inverted ? "-inverse" : "")
}
}
Button {
id: btnSave
Image {
anchors.centerIn: parent
source: "image://theme/icon-m-common-save-as" + (theme.inverted ? "-inverse" : "")
scale: 0.8
}
}
Button {
id: btnLove
Image {
anchors.centerIn: parent
anchors.verticalCenterOffset: -1
source: "love.png"
}
}
}
}
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Name=Libre.fm
GenericName=Libre.fm
Comment=Streams free music from Libre.fm
Exec=/usr/bin/single-instance /usr/bin/librefm
Terminal=false
Type=Application
Icon=/usr/share/icons/hicolor/scalable/apps/librefm.svg
import QtQuick 1.1
import com.nokia.meego 1.0
PageStackWindow {
id: rootWin
property int pageMargin: 16
initialPage: LoginPage { }
signal login(string username, string password)
signal launchStation(string station)
function openFile(file) {
var component = Qt.createComponent(file)
if (component.status == Component.Ready)
pageStack.push(component);
else
console.log("Error loading component:", component.errorString());
}
ToolBarLayout {
id: commonTools
visible: false
ToolIcon { iconId: "toolbar-back"; onClicked: { pageStack.pop(); } }
}
}
#include <QApplication>
#include <QDeclarativeContext>
#include <QDeclarativeView>
#include "servercomm.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QDeclarativeView view;
view.setSource(QUrl::fromLocalFile("src/librefm.qml"));
//view.setSource(QUrl::fromLocalFile(DATADIR "/librefm/librefm.qml"));
QObject *root = (QObject*)(view.rootObject());
ServerComm sc;
view.rootContext()->setContextProperty("serverComm", &sc);
QObject::connect(root, SIGNAL(login(QString, QString)), &sc, SLOT(login(QString, QString)));
QObject::connect(root, SIGNAL(launchStation(QString, QString)), &sc, SLOT(launchStation(QString, QString)));
QObject::connect((QObject*)view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
view.showFullScreen();
return app.exec();
}