diff --git a/blackberry-qnx/bb10/.cproject b/blackberry-qnx/bb10/.cproject
index 39b4c35d4b..e6ecda9067 100644
--- a/blackberry-qnx/bb10/.cproject
+++ b/blackberry-qnx/bb10/.cproject
@@ -126,47 +126,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/blackberry-qnx/bb10/RetroArch-Cascades.pro b/blackberry-qnx/bb10/RetroArch-Cascades.pro
index 414a4f47ad..e147755860 100644
--- a/blackberry-qnx/bb10/RetroArch-Cascades.pro
+++ b/blackberry-qnx/bb10/RetroArch-Cascades.pro
@@ -2,6 +2,7 @@ APP_NAME = RetroArch-Cascades
CONFIG += qt warn_on cascades10
-LIBS += -lscreen
+LIBS += -lscreen
+LIBS += -lbbcascadespickers
include(config.pri)
diff --git a/blackberry-qnx/bb10/assets/images/file.png b/blackberry-qnx/bb10/assets/images/file.png
new file mode 100644
index 0000000000..cd10d50581
Binary files /dev/null and b/blackberry-qnx/bb10/assets/images/file.png differ
diff --git a/blackberry-qnx/bb10/assets/images/icon.png b/blackberry-qnx/bb10/assets/images/icon.png
new file mode 100644
index 0000000000..a113106a99
Binary files /dev/null and b/blackberry-qnx/bb10/assets/images/icon.png differ
diff --git a/blackberry-qnx/bb10/assets/images/open.png b/blackberry-qnx/bb10/assets/images/open.png
new file mode 100644
index 0000000000..931936bf79
Binary files /dev/null and b/blackberry-qnx/bb10/assets/images/open.png differ
diff --git a/blackberry-qnx/bb10/assets/mainPage.qml b/blackberry-qnx/bb10/assets/mainPage.qml
index 1405ae4dde..66c9824cf7 100644
--- a/blackberry-qnx/bb10/assets/mainPage.qml
+++ b/blackberry-qnx/bb10/assets/mainPage.qml
@@ -1,25 +1,109 @@
-/* Copyright (c) 2012 Research In Motion Limited.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
import bb.cascades 1.0
+import bb.cascades.pickers 1.0
TabbedPane {
Tab {
Page {
- Container {
-
+ actions: [
+ ActionItem {
+ title: "Play"
+ ActionBar.placement: ActionBarPlacement.OnBar
+ imageSource: "asset:///images/open.png"
+ onTriggered: {
+ if(RetroArch.rom == "" || RetroArch.core == ""){
+ //Do something to focus on select rom box
+ } else {
+ OrientationSupport.supportedDisplayOrientation =
+ SupportedDisplayOrientation.DisplayLandscape;
+ }
+ }
+ }
+ ]
+
+ titleBar: TitleBar {
+ id: titleBar
+ title: "RetroArch"
}
+
+ Container {
+ horizontalAlignment: HorizontalAlignment.Fill
+ verticalAlignment: VerticalAlignment.Fill
+ rightPadding: 20
+ leftPadding: 20
+
+ layout: DockLayout {}
+
+ Container {
+ preferredWidth: 680
+ horizontalAlignment: HorizontalAlignment.Center
+ verticalAlignment: VerticalAlignment.Center
+
+ ImageView
+ {
+ horizontalAlignment: HorizontalAlignment.Center
+ imageSource: "asset:///images/icon.png"
+ preferredWidth: 200
+ preferredHeight: 200
+ }
+
+ DropDown
+ {
+ id: _core
+ objectName: "dropdown_core"
+ horizontalAlignment: HorizontalAlignment.Center
+ title: "Core Selection"
+ }
+
+ Container {
+ horizontalAlignment: HorizontalAlignment.Center
+ preferredWidth: 680
+
+ layout: StackLayout {
+ orientation: LayoutOrientation.LeftToRight
+ }
+
+ DropDown
+ {
+ id: romName
+ verticalAlignment: VerticalAlignment.Center
+ horizontalAlignment: HorizontalAlignment.Center
+ preferredWidth: 600
+ enabled: false
+ //hintText: "Select a ROM"
+ title: if(picker.selectedFile)
+ picker.selectedFile
+ else
+ "Rom Selection"
+ }
+
+ ImageButton {
+ horizontalAlignment: HorizontalAlignment.Right
+ defaultImageSource: "asset:///images/file.png"
+ onClicked: {
+ picker.open();
+ }
+ }
+ }
+ }
+ }
+ attachedObjects: [
+ FilePicker {
+ id: picker
+
+ property string selectedFile
+
+ title: "Rom Selector"
+ filter: []
+ type: FileType.Other
+ directories: ["/accounts/1000/shared/documents/roms"]
+
+ onFileSelected: {
+ RetroArch.rom = selectedFiles[0];
+ selectedFile = RetroArch.rom.substr(RetroArch.rom.lastIndexOf('/')+1);
+ picker.directories = [RetroArch.rom.substr(0, RetroArch.rom.lastIndexOf('/'))];
+ }
+ }
+ ]
}
}
Tab {
diff --git a/blackberry-qnx/bb10/bar-descriptor.xml b/blackberry-qnx/bb10/bar-descriptor.xml
index cef7222445..dda123717e 100644
--- a/blackberry-qnx/bb10/bar-descriptor.xml
+++ b/blackberry-qnx/bb10/bar-descriptor.xml
@@ -9,7 +9,7 @@
- com.example.helloforeignwindow
+ com.example.RetroArch
@@ -30,8 +30,7 @@
- landscape
- false
+ true
none
false
@@ -68,7 +67,7 @@
- bright
+ dark
run_native
diff --git a/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp b/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp
index 086b9aca7b..0a2559644e 100644
--- a/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp
+++ b/blackberry-qnx/bb10/src/RetroArch-Cascades.cpp
@@ -19,6 +19,7 @@
#include
#include
#include
+#include
#include
@@ -26,6 +27,9 @@ using namespace bb::cascades;
RetroArch::RetroArch()
{
+ qmlRegisterType("bb.cascades.pickers", 1, 0, "FilePicker");
+ qmlRegisterUncreatableType("bb.cascades.pickers", 1, 0, "FileType", "");
+
// Create a QML document and load the main UI QML file, using build patterns.
QmlDocument *qml = QmlDocument::create("asset:///mainPage.qml");
@@ -58,6 +62,29 @@ RetroArch::~RetroArch()
void RetroArch::run()
{
while (true) {
-
+ sleep(1);
}
}
+
+/*
+ * Properties
+ */
+
+QString RetroArch::getRom()
+{
+ return rom;
+}
+
+void RetroArch::setRom(QString rom)
+{
+ this->rom = rom;
+}
+
+QString RetroArch::getCore()
+{
+ return core;
+}
+void RetroArch::setCore(QString core)
+{
+ this->core = core;
+}
diff --git a/blackberry-qnx/bb10/src/RetroArch-Cascades.h b/blackberry-qnx/bb10/src/RetroArch-Cascades.h
index 6030771ad8..4d1efe74b9 100644
--- a/blackberry-qnx/bb10/src/RetroArch-Cascades.h
+++ b/blackberry-qnx/bb10/src/RetroArch-Cascades.h
@@ -1,19 +1,5 @@
-/* Copyright (c) 2012 Research In Motion Limited.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef _HELLOFOREIGNWINDOW_H_
-#define _HELLOFOREIGNWINDOW_H_
+#ifndef _RETROARCHCASCADES_H_
+#define _RETROARCHCASCADES_H_
#include
#include
@@ -33,10 +19,17 @@ class RetroArch: public QThread
{
Q_OBJECT
+ Q_PROPERTY(QString rom READ getRom WRITE setRom NOTIFY romChanged)
+ Q_PROPERTY(QString core READ getCore WRITE setCore NOTIFY coreChanged)
+
public:
RetroArch();
~ RetroArch();
+signals:
+ void romChanged(QString);
+ void coreChanged(QString);
+
private:
/**
* This QThread-run function runs the custom window rendering in a separate thread to avoid lag
@@ -44,6 +37,14 @@ private:
*/
void run();
+ QString rom;
+ QString getRom();
+ void setRom(QString rom);
+
+ QString core;
+ QString getCore();
+ void setCore(QString core);
+
};
-#endif // ifndef _HELLOFOREIGNWINDOW_H_
+#endif