The Following User Says Thank You to d-iivil For This Useful Post: | ||
|
2010-07-16
, 08:35
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#2
|
|
2010-07-16
, 08:39
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#3
|
Hello,
At the moment I can't write all the code for you, but I can give you some pointers about how to do it.
- Install Nokia Qt SDK (1.0 final is the latest)
- Install the newest Qt Creator snapshot from here:
ftp://ftp.qt.nokia.com/qtcreator/snapshots/
(The version in the SDK is quite crappy)- Launch the newly installed Qt Creator
- Create a new Gui Application project
- Set the Maemo 5 Qt 4.6 as build target
- Add to it a class (or use the generated one) and copy-paste to its .ui file yours from the designer
- If you wanna run your app on your device, install the "Mad Developer" package on it, set the USB driver to "usb_ether" (Etheret - USB networking), then plug it in your PC, select "PC Suite mode" (if usb_ether is selected, that will be used), and set up USB networking on your PC.
- In Qt Creator, Tools/Options/Projects/Maemo device configurations
- Then, go to the "Projects" tab in the editor, and below the "Build steps", click on the arrow next to "Create Package", and check the "Skip packaging step" option
- This will make it WAY faster to run your app.- Here is a tutorial about how to launch a process from a Qt app:
http://wiki.forum.nokia.com/index.ph...Qt_for_Symbian
(The tutorial has Symbian in its title, but it contains non-Symbian-specific code.)- For the shell scrips, you'll have to run "sh yourscript.sh" with QProcess
- For generic C++ questions, you can search Google or ask on StackOverflow
- If you want to make a .deb package, you can use Qt Creator's option to do so (but it is quite limited at the moment), or use MADDE and type "mad dpkg-buildpackage" into the command line (in your app's root folder)
- There is a description somewhere in the Maemo Wiki about how to make it a Settings applet, but I couldn't find it now.
I know this was a very dense description, but I hope it will help!
|
2010-07-16
, 09:07
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#4
|
The Following User Says Thank You to d-iivil For This Useful Post: | ||
|
2010-07-16
, 09:08
|
|
Posts: 267 |
Thanked: 408 times |
Joined on May 2010
@ Austria
|
#5
|
The Following User Says Thank You to Nathraiben For This Useful Post: | ||
|
2010-07-16
, 09:14
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#6
|
Not sure whether I should post this, as right now I'm trying to blow the "embrace the future - develop with QT" - but coming from PHP, using Python and PyQt might indeed be the easier way to do it.
That would require to:
- Download and install Eric (if on Linux - don't know what the Win-only bunch are using)
- Err... well, that's pretty much it for preparations
- Test-run your application by SSH-ing, use folder-sharing or simply copying your scripts to the device and simply run it with "python path/to/app.py" - Python doesn't need compiling.
- For packaging, just follow the instructions on this wiki page and you're done.
Again, if you want to be future prove, go with C++ and Qt, but if you want to keep it easy (and maemo-only), Python and PyQt would do the trick without much hassle, especially when you're coming from a PHP background.
|
2010-07-16
, 09:21
|
|
Posts: 267 |
Thanked: 408 times |
Joined on May 2010
@ Austria
|
#7
|
Heh, well, got it running on the device.
Now the hardest part: how to make the buttons actually to do something :-P
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(hello()));
protected slots: void hello();
void MainWindow::hello() { //Do whatever should be done when pressing the button }
|
2010-07-16
, 09:28
|
|
Posts: 267 |
Thanked: 408 times |
Joined on May 2010
@ Austria
|
#8
|
|
2010-07-16
, 09:33
|
Posts: 353 |
Thanked: 263 times |
Joined on Dec 2009
@ Finland
|
#9
|
void MainWindow::hello() { QStringList arguments; arguments << "Enable custom transitions" << "Droid Sans" << "Black"; QProcess::execute("/path/to/my/script/script.sh", arguments); }
|
2010-07-16
, 09:37
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#10
|
If you want to run your shell script in the button handler, you need to use function int QProcess::execute ( const QString & program, const QStringList & arguments ).
In above example from Nathraiben you would call it in function hello like this:
Code:void MainWindow::hello() { QStringList arguments; arguments << "Enable custom transitions" << "Droid Sans" << "Black"; QProcess::execute("/path/to/my/script/script.sh", arguments); }
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(hello()));
void MainWindow::hello() { QStringList arguments; arguments << "Enable custom transitions" << "Droid Sans" << "Black"; QProcess::execute("/path/to/my/script/script.sh", arguments); }
The Following User Says Thank You to d-iivil For This Useful Post: | ||
I have a scenario like this:
- I've drawn a simple UI in Nokia QT Designer:
- I have a shell script wich does various file manipulations based on variables given
What I would like to do:
- convert that UI to native app which would launch my shell script with variables based on what's been chosen from drop down list's at the UI when hitting the "Apply changes" -button. In this case the command to be launched from the button would be:
/path/to/my/script/script.sh "Enable custom transitions" "Droid Sans" "Black"
I have zero knowledge on coding with anything else than PHP. I would highly appreciate if someone is intrested in helping me with the project
I think this could be done with Python(?) so I could later on easily edit the python "source" if I needed to add more options to the drop down lists?
Edit: and as bonus: this app should be launchable from N900's settings "application", not from program launcher menu.
If you're rich and you think I deserve a cold beer, you may donate one or two :-P
80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
Last edited by d-iivil; 2010-07-16 at 08:09.