Reply
Thread Tools
flotron's Avatar
Posts: 418 | Thanked: 506 times | Joined on Jan 2012 @ Argentina
#1
I have the script that creates the deb file, and i want to know if someone knows how to execute the script from QML to the folder to be packaged. For example: The ui with a button "package" and a window that user select the folder to be packaged

The script is attached.

How to package with the script only (Themes packaging example):

1- Must have installed binutils on n9 (apt-get install binutils)
2- Must have the folder structure of your theme like: /themename/usr/share/themes/themename/meegotouch/etc...
3- inside the first structure (/themename) must be another folder called "DEBIAN", so it will be /themename/DEBIAN
4- Inside DEBIAN must be file called "control" with this inside:
Package: themename
Name: themename
Version: 0.1
Architecture: armel
Description: themename
Maintainer: you <you@hotmail.com>
Author: you <you@hotmail.com>
Section: user/Utilities+
5- Copy folder structure to /home/user and "make-deb.sh" script file to /home/user/Mydocs
6- From phone terminal write this: sh /home/user/MyDocs/make-deb.sh /home/user/themename
Attached Files
File Type: zip make-deb.zip (774 Bytes, 230 views)

Last edited by flotron; 2013-01-28 at 20:10.
 

The Following User Says Thank You to flotron For This Useful Post:
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#2
You can execute scripts from QML via QProcess. To do this, you first have to write a wrapper class for QProcess and using the Q_PROPERTY macro to make properties available to QML. You can then either create an instance of this class from the C++ side and make it available via QDeclarativeContext::setContextProperty(), or register it as a QML type to allow instances of the class to be created in QML.

I have already written a QProcess wrapper class called QDeclarativeProcess for my Qt Components Hildon package. The source code is here: https://github.com/marx1an/qt-compon...components/src (qdeclarativesettings.h and qdeclarativesettings.cpp). If you include these two files in your project, you can use the QProcess API via QML as follows:

In your main.cpp file:

Code:
#include "qdeclarativesettings.h"
#include <qdeclarative.h> // you might not need this depending on your existing #includes

qmlRegisterType<QDeclarativeProcess>("com.components.processes", 1, 0, "Process");

qmlRegisterUncreatableType<QDeclarativeProcessEnums>("com.components.processes", 1, 0, "Processes");
The "com.components.processes" can be replaced with whatever import URI you prefer.

In QML:

Code:
import com.components.processes 1.0

Process {
    id: process

    command: // command to launch the script.
}

Button {
    id: button

    text: "Launch script"
    onClicked: process.start()
}
You can see a more detailed example of how it's used from QML here: https://github.com/marx1an/qt-compon...rocessPage.qml
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub

Last edited by marxian; 2013-01-28 at 20:50.
 

The Following 3 Users Say Thank You to marxian For This Useful Post:
Reply

Tags
debian, package, qml components, qt creator, theme

Thread Tools

 
Forum Jump


All times are GMT. The time now is 04:00.