Editing QtComponents/Butaca

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 29: Line 29:
-    QApplication *app = MDeclarativeCache::qApplication(argc, argv);
-    QApplication *app = MDeclarativeCache::qApplication(argc, argv);
-    QDeclarativeView *view = MDeclarativeCache::qDeclarativeView();
-    QDeclarativeView *view = MDeclarativeCache::qDeclarativeView();
-
+    QApplication app(argc, argv);
+
+    QApplication app = QApplication(argc, argv);
-
+    QDeclarativeView view;
+
+    QDeclarativeView view = QDeclarativeView();
   
   
-    QDeclarativeContext *context = view->rootContext();
-    QDeclarativeContext *context = view->rootContext();
Line 41: Line 41:
+    view.showFullScreen();
+    view.showFullScreen();
   
   
-
-    int result = app->exec();
+
    int result = app->exec();
-
+    int result = app.exec();
+
   
   
     delete controller;
     delete controller;
Line 52: Line 51:
</syntaxhighlight>
</syntaxhighlight>
-
Remove boostable deps from project files.
+
And remove boostable deps from project files.
<syntaxhighlight lang=diff>
<syntaxhighlight lang=diff>
Line 75: Line 74:
  butacascript.files = butaca
  butacascript.files = butaca
  butacascript.path = /usr/bin/
  butacascript.path = /usr/bin/
-
</syntaxhighlight>
 
-
 
-
And invoker from desktop file
 
-
 
-
<syntaxhighlight lang="diff">
 
-
diff --git a/butaca.desktop b/butaca.desktop
 
-
index 4623ef8..d0af6f4 100644
 
-
--- a/butaca.desktop
 
-
+++ b/butaca.desktop
 
-
@@ -3,6 +3,6 @@ Encoding=UTF-8
 
-
Version=1.0
 
-
Type=Application
 
-
Name=Butaca
 
-
-Exec=/usr/bin/invoker --single-instance --splash /usr/share/butaca/butaca-splash.jpg --type=d /usr/bin/butaca
 
-
+Exec=/usr/bin/butaca
 
-
Icon=/usr/share/icons/hicolor/64x64/apps/butaca.png
 
-
Categories=Network;
 
</syntaxhighlight>
</syntaxhighlight>
Line 97: Line 79:
=== ShareUI ===
=== ShareUI ===
-
Share UI is a set of libraries and executables that implements platform-wide selection of destinations to share content. See project [http://meego.gitorious.org/meego-sharing-framework/share-ui/blobs/master/README README] for details.
 
-
 
-
Right now, we are going to support for this library (By the way, it seems portable to maemo5 without LMT. Any volunteers ?). Butacas defines a ButacaController class to share user preferences with others. So, we follow a 2 step approach
 
-
 
-
==== Hide ShareUI from C++ Code ====
 
-
Easy. we Just use Q_WS_MAEMO_5 and Q_WS_SIMULATOR to get this code compilable on Maemo5 and QtSimulator.
 
-
 
-
<syntaxhighlight lang="diff">
 
-
diff --git a/src/butacacontroller.cpp b/src/butacacontroller.cpp
 
-
index edba60a..ea58198 100644
 
-
--- a/src/butacacontroller.cpp
 
-
+++ b/src/butacacontroller.cpp
 
-
@@ -4,8 +4,11 @@
 
-
#include "sortfiltermodel.h"
 
-
 
-
#include <QDeclarativeContext>
 
-
+
 
-
+#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
 
-
#include <maemo-meegotouch-interfaces/shareuiinterface.h>
 
-
-#include <MDataUri>
 
-
+# include <MDataUri>
 
-
+#endif
 
-
 
-
ButacaController::ButacaController(QDeclarativeContext *context) :
 
-
    QObject(),
 
-
@@ -36,6 +39,7 @@ ButacaController::~ButacaController()
 
-
 
-
void ButacaController::share(QString title, QString url)
 
-
{
 
-
+#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
 
-
    // See https://meego.gitorious.org/meego-sharing-framework/share-ui/blobs/master/examples/link-share/page.cpp
 
-
    // and http://forum.meego.com/showthread.php?t=3768
 
-
    MDataUri dataUri;
 
-
@@ -52,6 +56,10 @@ void ButacaController::share(QString title, QString url)
 
-
    } else {
 
-
        qCritical() << "Invalid interface";
 
-
    }
 
-
+#else
 
-
+    Q_UNUSED(title);
 
-
+    Q_UNUSED(url);
 
-
+#endif
 
-
}
 
-
 
-
void ButacaController::fetchTheaters(QString location)
 
-
</syntaxhighlight>
 
-
 
-
And disable config requirements on butaca.pro
 
-
 
-
<syntaxhighlight lang="diff">
 
-
diff --git a/butaca.pro b/butaca.pro
 
-
index a493faf..268b85a 100644
 
-
--- a/butaca.pro
 
-
+++ b/butaca.pro
 
-
@@ -55,8 +55,10 @@ OTHER_FILES += \
 
-
RESOURCES += \
 
-
    res.qrc
 
-
 
-
+!maemo5:!simulator {
 
-
CONFIG += shareuiinterface-maemo-meegotouch \
 
-
          mdatauri
 
-
+}
 
-
</syntaxhighlight>
 
-
 
-
==== Disable functionality on QML land ====
 
-
Disable share button on butaca toolbar
 
-
 
-
<syntaxhighlight lang="diff">
 
-
diff --git a/qml/ButacaToolBar.qml b/qml/ButacaToolBar.qml
 
-
index a57bbcb..a7d2ebe 100644
 
-
--- a/qml/ButacaToolBar.qml
 
-
+++ b/qml/ButacaToolBar.qml
 
-
@@ -83,7 +83,7 @@ ToolBarLayout {
 
-
            when: content !== undefined
 
-
            PropertyChanges {
 
-
                target: shareIcon
 
-
-                enabled: true
 
-
+                enabled: false
 
-
                visible: true
 
-
            }
 
-
            PropertyChanges {
 
-
</syntaxhighlight>
 
-
 
-
commit
 
== Refactor QML files ==
== Refactor QML files ==
-
As on [QtComponents/Miniature], we need to replace namespace by the fremantle one. In this case we need to go a bit further.
+
As on [QtComponents/Miniature], we need to replace namespace by the fremantle one. In this case we need to go a bit further use [[migrateTo]] for this task.
-
 
+
-
=== Update namespace ===
+
-
Use [QtComponents/migrateTo], sed or an app like regexxer. See [QtComponents/Miniature] for required changes
+
-
 
+
-
==== Hardcoded Paths ====
+
-
Butaca fetch Properties directly from UIConstants.js js library. This library is private to QtComponents, so it uses a file://point/to/uiConstants.js schemas that we should also change.
+
-
See [[QtComponents/ThemeHowto]] for a better (and non upstream portable) way of doing this.
+
=== Update hardcoded paths ===
=== Remove QtQuick 1.1 code ===
=== Remove QtQuick 1.1 code ===
-
Reached this point. Project should be runnable on QtSimulator. '''Use QtSimulator 1.1'''. If we get console.log errors, it would be produced by unsupported QtQuick 1.1 code.
 
-
<syntaxhighlight lang="bash">
+
commit.
-
PATH/TO/QTSIMULATOR 1.1/Qt/gcc/bin/qmake butaca.pro && make && ./butaca
+
-
</syntaxhighlight>
+
-
See [[QtComponents/QtSimulator]] for hints about how to get QtComponents running on it
 
-
 
-
After a trial and error process we get:
 
-
<syntaxhighlight lang="diff">
 
-
diff --git a/qml/MultipleMoviesDelegate.qml b/qml/MultipleMoviesDelegate.qml
 
-
index 03b5a05..df468de 100644
 
-
--- a/qml/MultipleMoviesDelegate.qml
 
-
+++ b/qml/MultipleMoviesDelegate.qml
 
-
@@ -107,7 +107,9 @@ Item {
 
-
                    font.weight: movieDelegate.titleWeight
 
-
                    font.pixelSize: movieDelegate.titleSize
 
-
                    color: movieDelegate.titleColor
 
-
-                    maximumLineCount: 3
 
-
+                  //{QTQUICK1.1
 
-
+                  //maximumLineCount: 3
 
-
+                  //}
 
-
                    wrapMode: Text.WordWrap
 
-
                    text: title
 
-
                }
 
-
</syntaxhighlight>
 
-
 
-
commit.
 
== Handle Close events ==
== Handle Close events ==
Line 226: Line 94:
<syntaxhighlight lang="diff">
<syntaxhighlight lang="diff">
-
diff --git a/src/main.cpp b/src/main.cpp
 
-
index 8f1c989..2fef2c3 100644
 
-
--- a/src/main.cpp
 
-
+++ b/src/main.cpp
 
-
@@ -32,6 +32,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
 
-
    ButacaController *controller = new ButacaController(context);
 
-
 
-
    view.setSource(QUrl("qrc:/qml/main.qml"));
 
-
+    QObject::connect((QObject*)view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
 
-
    view.showFullScreen();
 
-
 
-
    int result = app->exec();
 
</syntaxhighlight>
</syntaxhighlight>
Line 245: Line 101:
Some changes on how '''Butaca''' is deployed are needed to match Fremantle requirements.
Some changes on how '''Butaca''' is deployed are needed to match Fremantle requirements.
-
=== Deployment ===
+
=== Optify code ===
-
Add minimal changes to fit fremantle
+
-
==== Optify ====
+
=== Update Desktop file ===
-
Point binary to /opt and adapt paths to Fremantle
+
And finally, update desktop file. There's no applauncerd on fremantle, so remove invoker from Exec. With this action we loose splash-screen.
-
 
+
-
<syntaxhighlight lang="diff">
+
-
diff --git a/butaca.desktop b/butaca.desktop
+
-
index d0af6f4..6b552de 100644
+
-
--- a/butaca.desktop
+
-
+++ b/butaca.desktop
+
-
@@ -3,6 +3,6 @@ Encoding=UTF-8
+
-
Version=1.0
+
-
Type=Application
+
-
Name=Butaca
+
-
-Exec=/usr/bin/butaca
+
-
-Icon=/usr/share/icons/hicolor/64x64/apps/butaca.png
+
-
+Exec=/opt/bin/butaca
+
-
+Icon=butaca
+
-
Categories=Network;
+
-
diff --git a/butaca.pro b/butaca.pro
+
-
index 268b85a..a7b1fa8 100644
+
-
--- a/butaca.pro
+
-
+++ b/butaca.pro
+
-
@@ -61,15 +61,15 @@ CONFIG += shareuiinterface-maemo-meegotouch \
+
-
}
+
-
+
-
butacascript.files = butaca
+
-
-butacascript.path = /usr/bin/
+
-
+butacascript.path = /opt/bin/
+
-
+
-
desktop.files = butaca.desktop
+
-
-desktop.path = /usr/share/applications/
+
-
+desktop.path = /usr/share/applications/hildon/
+
-
+
-
icon.files = butaca.png
+
-
icon.path  = /usr/share/icons/hicolor/64x64/apps/
+
-
+
-
splash.files = butaca-splash.jpg
+
-
-splash.path = /usr/share/butaca/
+
-
+splash.path = /opt/share/butaca/
+
-
+
-
INSTALLS += butacascript desktop icon splash
+
-
</syntaxhighlight>
+
commit
commit
Line 297: Line 113:
and copy generated files into debian/patches directory.
and copy generated files into debian/patches directory.
-
Finally, modify rules file at debian directory to merge patches. At cdbs rules definition add:
+
Finally, modify rules file at debian directory to merge patches. At '''config-stamp''' rule add:
-
<syntaxhighlight lang="make">include /usr/share/cdbs/1/rules/simple-patchsys.mk
+
<syntaxhighlight lang="make">for p in debian/patches/*; do patch -p1 < $$p; done
-
</syntaxhighlight>
+
-
 
+
-
==== Adapt Packing files ====
+
-
Set debhelper from 7 to 5 and remove unused deps
+
-
 
+
-
<syntaxhighlight lang="diff">
+
-
diff --git a/debian/compat b/debian/compat
+
-
index 7f8f011..7ed6ff8 100644
+
-
--- a/debian/compat
+
-
+++ b/debian/compat
+
-
@@ -1 +1 @@
+
-
-7
+
-
+5
+
-
diff --git a/debian/control b/debian/control
+
-
index 374197b..d1711dd 100644
+
-
--- a/debian/control
+
-
+++ b/debian/control
+
-
@@ -2,9 +2,8 @@ Source: butaca
+
-
Section: user/network
+
-
Priority: extra
+
-
Maintainer: Simon Pena <spena@igalia.com>
+
-
-Build-Depends: debhelper (>= 7), applauncherd-dev, cdbs,
+
-
- libqt4-dev, maemo-meegotouch-interfaces-dev, libmdatauri-dev,
+
-
- libqtwebkit-dev
+
-
+Build-Depends: debhelper (>= 5), cdbs,
+
-
+ libqt4-dev, libqt4-webkit-dev, quilt
+
-
Standards-Version: 3.8.4
+
-
XB-Maemo-Flags: visible
+
-
XB-Homepage: https://projects.developer.nokia.com/butaca/
+
</syntaxhighlight>
</syntaxhighlight>
And thats all. You have '''Butaca''' working on Maemo5
And thats all. You have '''Butaca''' working on Maemo5

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)