Commit 17ac158d authored by golgoj4's avatar golgoj4

refs #1170 and some others im sure. bringing the build for android/Qt4 up to...

refs #1170 and some others im sure. bringing the build for android/Qt4 up to spec to be built with some of the android system removed.
parent 8dc877eb
......@@ -8,6 +8,8 @@ QT += network
TARGET = HueController
target.path = /tmp #development option with ssh.
INSTALLS = target
CONFIG +=sharedlib
CONFIG += console
CONFIG -= app_bundle
......
......@@ -169,6 +169,7 @@ void SkinDataModel::setActiveSkin(QString name)
delete current_style;
ui_reference->setDceResponse("Loading Skin at " + m_baseUrl.toString() + "/" + name);
qDebug() << "This is the base url::"<< m_baseUrl.toString();
QString skinURL = m_baseUrl.toString() + "/" + name+"/Style.qml";
m_entryUrl = m_baseUrl.toString()+"/"+name+"/main.qml";
......@@ -178,15 +179,17 @@ void SkinDataModel::setActiveSkin(QString name)
#if (QT5)
QQmlComponent skinData(ui_reference->qorbiterUIwin->engine(), skinURL);
#else
#elif __ANDROID__
current_style = new QDeclarativeComponent(ui_reference->qorbiterUIwin->engine(), QUrl(skinURL));
#else
current_style = new QDeclarativeComponent(ui_reference->qorbiterUIwin->engine(), skinURL);
#endif
if (current_style->isError()) {
qDebug() << current_style->errorString();
// this dir does not contain a Style.qml; ignore it
ui_reference->setDceResponse(current_style->errors().last().toString());
return;
}
else
......
......@@ -11,7 +11,7 @@ SkinLoader::SkinLoader(QUrl baseUrl, qorbiterManager *uiRef, SkinDataModel *pare
{
totalSkinsToLoad = 0;
loadercounter= 0;
#ifdef QT4
#ifdef QT4_8
current_component = new QDeclarativeComponent(ui_reference->qorbiterUIwin->rootContext()->engine(),this);
#elif QT5
current_component = new QQmlComponent(ui_reference->qorbiterUIwin->rootContext()->engine(),this);
......
......@@ -353,9 +353,6 @@ int main(int argc, char* argv[])
#endif
AbstractImageProvider modelimageprovider(&w);
orbiterWin.mainView.engine()->addImageProvider("listprovider", &modelimageprovider);
pqOrbiter.moveToThread(&dceThread);
QObject::connect(&dceThread, SIGNAL(started()), &pqOrbiter, SLOT(beginSetup()));
#ifndef QT5
......@@ -385,7 +382,7 @@ int main(int argc, char* argv[])
#endif
TimeCodeManager *timecode = new TimeCodeManager();
// orbiterWin.mainView.rootContext()->setContextProperty("logger", &localLogger);
orbiterWin.mainView.rootContext()->setContextProperty("logger", &localLogger);
orbiterWin.mainView.rootContext()->setContextProperty("dceTimecode", timecode);
orbiterWin.mainView.rootContext()->setContextProperty("dataModel", mediaModel);
orbiterWin.mainView.rootContext()->setContextProperty("mediaplaylist", storedVideoPlaylist);
......@@ -397,7 +394,7 @@ int main(int argc, char* argv[])
QObject::connect(&pqOrbiter, SIGNAL(commandResponseChanged(QString)), &localLogger, SLOT(logCommandMessage(QString)));
QObject::connect(&pqOrbiter, SIGNAL(mediaMessage(QString)), &localLogger, SLOT(logGuiMessage(QString)));
#ifdef Qt4
#ifdef QT4_8
QObject::connect(orbiterWin.mainView.engine(), SIGNAL(warnings(QList<QDeclarativeError>)), &localLogger, SLOT(logQmlErrors(QList<QDeclarativeError>)));
#elif QT5
QObject::connect(orbiterWin.mainView.engine(), SIGNAL(warnings(QList<QQmlError>)), &localLogger, SLOT(logQmlErrors(QList<QQmlError>)));
......
......@@ -55,7 +55,7 @@
orbiterWindow::orbiterWindow(int deviceid, std::string routerip, bool fullScreen, bool frameless, QObject *parent) :
QObject(parent), deviceno(deviceid)
{
#ifdef QT4
#ifdef QT4_8
if(frameless==true){
mainView.window()->setWindowFlags(Qt::FramelessWindowHint);
}
......
......@@ -67,29 +67,29 @@ bool AndroidSystem::findClassIdents()
// qDebug() << env->get(buildVersionClass, env->GetStaticFieldID(buildVersionClass,"CODENAME", "()java/lang/String;"));
}
jclass buildClass = env->FindClass("android/os/Build");
if(buildClass){
qDebug() << "getting model info";
jfieldID modelField = env->GetStaticFieldID(buildClass, "MODEL","Ljava/lang/String;");
jfieldID brandField = env->GetStaticFieldID(buildClass, "BRAND","Ljava/lang/String;");
jfieldID manufacturerField = env->GetStaticFieldID(buildClass, "MANUFACTURER","Ljava/lang/String;");
jstring modelString =(jstring)env->GetStaticObjectField(buildClass, modelField);
jstring deviceString =(jstring)env->GetStaticObjectField(buildClass, brandField);
jstring manufacturerString = (jstring) env->GetStaticObjectField(buildClass, manufacturerField);
const char* myConvertedModelString = env->GetStringUTFChars(modelString, 0);
const char* myConvertedBrandString = env->GetStringUTFChars(deviceString, 0);
const char* myConvertedManufacturerString = env->GetStringUTFChars(manufacturerString, 0);
setDeviceBrand(QString::fromAscii(myConvertedBrandString));
setDeviceManufacturer(QString::fromAscii(myConvertedManufacturerString));
setDeviceName(QString::fromAscii(myConvertedModelString));
}
// jclass buildClass = env->FindClass("android/os/Build");
// if(buildClass){
// qDebug() << "getting model info";
// jfieldID modelField = env->GetStaticFieldID(buildClass, "MODEL","Ljava/lang/String;");
// jfieldID brandField = env->GetStaticFieldID(buildClass, "BRAND","Ljava/lang/String;");
// jfieldID manufacturerField = env->GetStaticFieldID(buildClass, "MANUFACTURER","Ljava/lang/String;");
// jstring modelString =(jstring)env->GetStaticObjectField(buildClass, modelField);
// jstring deviceString =(jstring)env->GetStaticObjectField(buildClass, brandField);
// jstring manufacturerString = (jstring) env->GetStaticObjectField(buildClass, manufacturerField);
// const char* myConvertedModelString = env->GetStringUTFChars(modelString, 0);
// const char* myConvertedBrandString = env->GetStringUTFChars(deviceString, 0);
// const char* myConvertedManufacturerString = env->GetStringUTFChars(manufacturerString, 0);
// setDeviceBrand(QString::fromAscii(myConvertedBrandString));
// setDeviceManufacturer(QString::fromAscii(myConvertedManufacturerString));
// setDeviceName(QString::fromAscii(myConvertedModelString));
// }
jclass externalStorageClass = env->FindClass("android.os.Environment");
if(externalStorageClass){
qDebug() << "Found External Storage Class";
jmethodID storageMethodID = env->GetStaticMethodID(externalStorageClass, "getExternalStorageState", "()Ljava/lang/String;");
jstring jStorageState = (jstring)env->CallObjectMethod(externalStorageClass, storageMethodID);
const char* myConvertedStorageState = env->GetStringUTFChars(jStorageState, 0);
......@@ -150,13 +150,13 @@ bool AndroidSystem::getDisplayInfo()
// // jobject display = env->GetObjectArrayElement(displayArrayObj, 0);
// // jclass displayObjClass = env->FindClass("Landroid/view/Display;");
// // jmethodID displayId = env->GetMethodID(displayObjClass, "getDisplay", "()I");
// // qDebug() <<env->CallIntMethod(display, displayId);
// jobject display = env->GetObjectArrayElement(displayArrayObj, 0);
// jclass displayObjClass = env->FindClass("Landroid/view/Display;");
// jmethodID displayId = env->GetMethodID(displayObjClass, "getDisplay", "()I");
// qDebug() <<env->CallIntMethod(display, displayId);
// }
// return true;
// }
return true;
return true;
}
import QtQuick 2.0
Rectangle{
id: connectionBox
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenterOffset:10
width: scaleX(65)
height: scaleY(20)
color: "transparent"
Rectangle {
anchors.fill: connectionBox
radius: 7
anchors.horizontalCenterOffset: 1
anchors.centerIn: parent
border.width: 1
border.color: "#000000"
gradient: Gradient {
GradientStop {
position: 0
color: "transparent"
}
GradientStop {
position: 1
color: "#000000"
}
}
opacity: 0.5
}
Text {
id: connectionlabel
text: qsTr("Set Connection Details")
font.pointSize: 16
font.bold: false
anchors.top: connectionBox.top
anchors.horizontalCenter: parent.horizontalCenter
font.family: myFont.name
}
Row{
id:connectionVars
anchors.centerIn: connectionBox
anchors.verticalCenter: parent.verticalCenter
spacing: 10
Text {
text: qsTr("Host:")
font.pointSize: 12
font.family: myFont.name
anchors.verticalCenter: parent.verticalCenter
}
TextInput {
id: routerip
width: 80
color: "#030000"
text: window.router
font.pointSize: 12
font.family: myFont.name
// onTextChanged: setRouterIp(routerip.text)
anchors.verticalCenter: parent.verticalCenter
}
TextInput {
id: ext_routerip
width: 80
text: extip
font.pointSize: 12
font.family: myFont.name
// onTextChanged: setRouterIp(routerip.text)
anchors.verticalCenter: parent.verticalCenter
visible: false
}
Text {
text: qsTr("Device:")
font.pointSize: 12
font.family: myFont.name
anchors.verticalCenter: parent.verticalCenter
}
TextInput {
id: devicenumber
width: scaleX(10)
text: window.deviceno
font.family: myFont.name
font.pointSize: 12
//onTextChanged: setDeviceNo(devicenumber.text)
anchors.verticalCenter: parent.verticalCenter
}
}
Row{
id:goBox
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: connectionBox.bottom
anchors.bottomMargin: 15
spacing: scaleX(15)
Rectangle {
id: connectbutton
height: scaleY(2)
width: scaleX(10)
color:"red"
Text {
id: name
anchors.centerIn: parent
anchors.fill: parent
text: qsTr("Go!")
font.pointSize: 12
verticalAlignment: Text.AlignTop
font.bold: true
font.family: myFont.name
}
radius: 5
MouseArea{
hoverEnabled: true
onEntered: parent.color="green"
onExited: parent.color="red"
anchors.fill: parent
onClicked: window.qmlSetupLmce(devicenumber.text, routerip.text)
anchors.verticalCenter: parent.verticalCenter
}
}
Rectangle {
id: exitbutton
height: scaleY(3)
width: scaleX(6)
Text {
id: exitlabel
anchors.centerIn: parent
anchors.fill: parent
text: qsTr("Exit")
font.pixelSize: 11
font.family: myFont.name
}
radius: 4
MouseArea{
anchors.fill: parent
onClicked: manager.closeOrbiter()
anchors.verticalCenter: parent.verticalCenter
}
}
}
states: [
State {
name: "showing"
PropertyChanges {
target: connectionBox
opacity:1
scale:1
}
},
State {
name: "hidden"
PropertyChanges {
target: connectionBox
opacity:0
scale:0
}
}
]
}
import QtQuick 2.0
ListView{
id:existing_orbiters
height: scaleY(35)
width: scaleX(55)
clip: true
anchors.left: parent.right
anchors.verticalCenter: parent.verticalCenter
model:orbiterList
visible: true
spacing: scaleY(2)
opacity: 0
Behavior on opacity{
PropertyAnimation{
duration: 1500
}
}
delegate: Rectangle{
id:existing_orbiter_delegate
height: labelColumn.height
width: existing_orbiters.width
gradient: Gradient {
GradientStop {
position: 0
color: "transparent"
}
GradientStop {
position: 1
color: "#000000"
}
}
border.color: "#99CC99"
border.width: 1
Column
{
id:labelColumn
height: childrenRect.height
width: parent.width *.65
anchors.centerIn: parent
Text {
id: orbiter_label
text: qsTr("Orbiter:")+ label
font.pixelSize: 18
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.family: myFont.name
width: parent.width
color: "#99CC99"
}
Text {
id: dev_num
text:qsTr("Device:")+ device
font.pixelSize: 12
font.italic: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.family: myFont.name
width: parent.width
}
}
MouseArea {
anchors.fill: parent
onClicked: window.qmlSetupLmce(device, window.router)
}
}
states: [
State {
name: "hidden"
PropertyChanges {
target: existing_orbiters
opacity:0
}
},
State {
name: "showing"
PropertyChanges {
target: existing_orbiters
opacity:1
anchors.rightMargin: 10
}
AnchorChanges{
target: existing_orbiters
anchors.left: undefined
anchors.right: parent.right
}
}
]
}
import QtQuick 2.0
Rectangle{
id:newOrbiterButton
height: scaleY(10)
width:scaleX(55)
opacity: 0
border.color: "#99CC99"
anchors.verticalCenter: parent.verticalCenter
Component.onCompleted: state="hidden"
gradient: Gradient {
GradientStop {
position: 0
color: "transparent"
}
GradientStop {
position: 1
color: "#000000"
}
}
Behavior on opacity{
PropertyAnimation{duration: 1000}
}
Text {
id: newOrbiterLabel
text: qsTr("Create New Orbiter? \n Or choose and Existing Orbiter")
font.pointSize: 15
width: parent.width
anchors.centerIn: parent
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.family: myFont.name
font.bold: true
color:"#99CC99"
}
MouseArea{
anchors.fill: parent
onClicked:screenchange("SetupNewOrbiter.qml")
}
states: [
State {
name: "hidden"
PropertyChanges {
target: newOrbiterButton
opacity:0
}
AnchorChanges{
anchors.top: parent.bottom
anchors.right: parent.left
}
},
State {
name: "showing"
PropertyChanges {
target: newOrbiterButton
opacity:1
anchors.leftMargin: scaleX(25)
}
AnchorChanges{
target: newOrbiterButton
anchors.top: undefined
anchors.right: undefined
anchors.horizontalCenter: splashPage.horizontalCenter
anchors.verticalCenter: splashPage.verticalCenter
}
}
]
transitions: Transition {
// smoothly reanchor myRect and move into new position
AnchorAnimation{
duration: 1000
}
}
}
......@@ -2,19 +2,19 @@
import QtQuick 2.0
Rectangle {
width: manager.appWidth
height: manager.appHeight
color: "slategrey"
width: appW
height: appH
color: "transparent"
//palette?
property string orangeRed: "#993300"
property string deYork: "#99CC99"
property string midnightBlue: "#003366"
//---------
function scaleX(x){
return x/100*manager.appHeight
return x/100*appH
}
function scaleY(y){
return y/100*manager.appWidth
return y/100*appW
}
Component.onCompleted: window.showSetup()
......@@ -73,24 +73,13 @@ Rectangle {
}
}
Row{
StyledText {
Text {
id: welcome
text: qsTr("Setup A New Orbiter")
color:"white"
font.pointSize: 18
font.bold: true
}
Rectangle{
height: scaleX(14)
width: scaleX(14)
color: "blue"
StyledText{
text:"Go!"
anchors.centerIn: parent
color:"white"
}
font.family: myFont.name
}
}
......@@ -115,12 +104,13 @@ Rectangle {
radius:10
border.color:usersView.currentIndex === index ? midnightBlue : orangeRed
color: usersView.currentIndex === index ? deYork : "white"
StyledText {
Text {
text: dataTitle
font.pointSize: 12
wrapMode: StyledText.WrapAtWordBoundaryOrAnywhere
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width *.75
anchors.centerIn: parent
font.family: myFont.name
}
MouseArea{
anchors.fill: parent
......@@ -151,12 +141,13 @@ Rectangle {
radius:10
border.color:roomsView.currentIndex === index ? midnightBlue : orangeRed
color: roomsView.currentIndex === index ? deYork : "white"
StyledText {
Text {
text: dataTitle
font.pointSize: 12
wrapMode: StyledText.WrapAtWordBoundaryOrAnywhere
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width *.75
anchors.centerIn: parent
font.family: myFont.name
}
MouseArea{
anchors.fill: parent
......@@ -185,12 +176,13 @@ Rectangle {
border.color:langView.currentIndex === index ? midnightBlue : orangeRed
color: langView.currentIndex === index ? deYork : "white"
StyledText {
Text {
text: lang
font.pointSize: 12
wrapMode: StyledText.WrapAtWordBoundaryOrAnywhere
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width *.75
anchors.centerIn: parent
font.family: myFont.name
}
MouseArea{
anchors.fill: parent
......@@ -204,7 +196,7 @@ Rectangle {
}
}
StyledText {
Text {
id: logo
text: qsTr("LinuxMCE")
anchors.bottom: parent.bottom
......@@ -213,66 +205,115 @@ Rectangle {
font.bold: true
color:"white"
font.pointSize: 12
font.family: myFont.name
}
Column{
id:confirmCol
Rectangle{
id:setupButton
height: scaleY(8)
width: scaleX(14)
color: "blue"
radius: 8
anchors.bottom: parent.bottom
anchors.left: parent.left
height: parent.height *.15
width: parent.width / 3
spacing:5
StyledText {
id: selectedUser
text: qsTr("Please Select a Default User")
font.bold: true
color: deYork
font.pointSize: 14
x:0
onStyledTextChanged: {
x = -50
userSelected.restart()
}
}
ParallelAnimation{
id:userSelected
PropertyAnimation{
target: selectedUser
property:"x"
to:confirmCol.width
duration: 2500
}
anchors.horizontalCenter: parent.horizontalCenter
PropertyAnimation{
target:selectedUser
property: "opacity"
from:0
to:1
duration:1000
}
}
Text{
text:"Go!"
anchors.centerIn: parent
color:"white"
font.family: myFont.name
}
MouseArea{
anchors.fill: parent
onClicked: window.setupNewOrbiter(selectedUser, selectedRoom, 1, 1, appH, appW)
}
}
Rectangle{
id:exitButton
height: scaleY(8)
width: scaleX(14)
color: "blue"
radius: 8
anchors.bottom: parent.bottom
anchors.left: setupButton.right
anchors.leftMargin: scaleX(2)
Text{
text:"Exit!"
anchors.centerIn: parent
color:"white"
font.family: myFont.name
}
MouseArea{
anchors.fill: parent
onClicked: pageLoader.source ="SplashView.qml" //screenChange("SplashView.qml")
}
StyledText {
id: selectedRoom
text: qsTr("Please Select A Default Room")
}
}
// Column{
// id:confirmCol
// anchors.bottom: parent.bottom
// anchors.left: parent.left
// height: parent.height *.15
// width: parent.width / 3
// spacing:5
// Text {
// id: selectedUser
// text: qsTr("Please Select a Default User")
// font.bold: true
// color: deYork
// font.pixelSize: 14