Active Topics

 


Reply
Thread Tools
shep's Avatar
Posts: 85 | Thanked: 65 times | Joined on Jan 2010 @ Ireland
#11
OK, I have it working now...bit of a hack though.

I manually copied my icon png file to
Code:
/usr/share/icons/hicolor/64x64/apps
Restarted the N900 and not the icon is there.

I guess I need to revisit the "Makefile"!

I also created a "wwcalc.service" with the following contents:

Code:
[D-BUS Service]
Name=org.maemo.wwcalc
Exec=/usr/bin/wwcalc
Shep
 
Posts: 60 | Thanked: 23 times | Joined on Jan 2010
#12
thats great, but we need this working without a hack..
 
shep's Avatar
Posts: 85 | Thanked: 65 times | Joined on Jan 2010 @ Ireland
#13
Originally Posted by tmsha View Post
shep: i transfered it with usb and installed with dpkg -i with root access.
Agree fully.

I think I have it now . The key would seem to be the "src.pro" file.

The section that begins "INSTALLS +=" contains a list of additional files to copy to filesystem locations. i had this wrong. You should not have to manually edit the Makefile if you have this right!

OK, so here's the src.pro file with the "INSTALLS +=" section corrected. (I've tried to colour code the matching settings)

Code:
TARGET = wwcalc
TEMPLATE = app
SOURCES += qtmain.cpp \
    mainwindow.cpp 
HEADERS += mainwindow.h 
FORMS += mainwindow.ui 
PREFIX = ../debian/wwcalc/usr

unix {
BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share

DEFINES += DATADIR=\"$$DATADIR\" PKGDATADIR=\"$$PKGDATADIR\"

#MAKE INSTALL

INSTALLS += target desktop icon64 service

  target.path =$$BINDIR

  desktop.path = $$DATADIR/applications/hildon
  desktop.files += wwcalc.desktop

  icon64.path = $$DATADIR/icons/hicolor/64x64/apps
  icon64.files += wwcalc.png
  
  service.path = $$DATADIR/usr/share/dbus-1/services
  service.files += wwcalc.service

}
For the purposes of simplifying my life I moved the icon to the "src" folder.

Madde commands to compile and deploy
Code:
mad dh_make --createorig --single -e s.l@gmail.com -c gpl
mad qmake
mad dpkg-buildpackage
mad remote -r wwcalc send ../wwcalc_0.3-1_armel.deb
mad remote -r wwcalc install wwcalc_0.3-1_armel.deb 
mad remote -r wwcalc run dpkg -L wwcalc
Full source code attached.

I have not tested just copying the .deb file across and installing with dpkg -i yet.

Going to bed now.

Shep
Attached Files
File Type: zip wwcalc-0.3.zip (345.6 KB, 100 views)
 

The Following 2 Users Say Thank You to shep For This Useful Post:
Posts: 51 | Thanked: 15 times | Joined on Apr 2009 @ ChengDu, SiChuan, P.R.C
#14
maybe you should see this post at http://wiki.forum.nokia.com/index.ph...plication_menu
 

The Following 2 Users Say Thank You to funpig For This Useful Post:
too's Avatar
Posts: 122 | Thanked: 135 times | Joined on Dec 2009 @ Helsinki
#15
Originally Posted by shep View Post
I tried both and I still have the blue square

I guess it's a problem with the package still.

Shep
make sure you have files:

Code:
/usr/share/applications/hildon/<software>.desktop
/usr/share/dbus-1/services/<software>.service
/usr/share/icons/hicolor/64x64/apps/<software>.png
in order, then add to the end of debian/postinst:

Code:
gtk-update-icon-cache -f /usr/share/icons/hicolor
 

The Following User Says Thank You to too For This Useful Post:
too's Avatar
Posts: 122 | Thanked: 135 times | Joined on Dec 2009 @ Helsinki
#16
Originally Posted by shep View Post
I tried both and I still have the blue square

I guess it's a problem with the package still.

Shep
Make sure that files

Code:
/usr/share/applications/hildon/<sw>.desktop
/usr/share/dbus-1/services/<sw>.service
/usr/share/icons/hicolor/64x64/apps/<sw>.png
are in order, then add to the end of debian/postinst

Code:
gtk-update-icon-cache -f /usr/share/icons/hicolor
 

The Following 2 Users Say Thank You to too For This Useful Post:
shep's Avatar
Posts: 85 | Thanked: 65 times | Joined on Jan 2010 @ Ireland
#17
Originally Posted by funpig View Post
maybe you should see this post at http://wiki.forum.nokia.com/index.ph...plication_menu
thanks funpig, good article. I really should have called my thread "Packaging a Qt App toDeploy with it's Icon using Madde" as that's what I wanted to achieve.

Luckily I've managed now.

I'll write it all up in a step by step manner later.

Thanks for the help everyone!

Shep.
 
Posts: 60 | Thanked: 23 times | Joined on Jan 2010
#18
Hi shep, i just followed your steps with wwcalc and i can say that it now installs correctly! Icon works! Great work.
I am still confused about how to make the "qthello" example (http://wiki.maemo.org/MADDE/Qt_Example) installable with an icon, do you think you are able to provide simple steps on how to make that example work with an icon ?

One more thing.. The application is not uninstallable in app manager.. how to uninstall it?
(nothing against your app, I just want to know this )

Last edited by tmsha; 2010-01-18 at 14:20.
 
shep's Avatar
Posts: 85 | Thanked: 65 times | Joined on Jan 2010 @ Ireland
#19
OK, Here is (hopefully) a step by step guide how to take a (simple) Qt app and package and deploye it with Icon using Madde.

The project I have is simple, 1 window called mainwindow.

Steps:

1. Create project through Madde

2. Edit and test with QT Creator

3. Once ready to deploy create a clean empty top level folder "<projectname>-0.x" where x is your revision number e.g. "c:\Madde\0.5\home\shep\wwcalc-0.1"...In the OS
Note: the following 3 steps apply each time you go to build.
3.1 ensure there is no "debian" folder at the same level as "src"
3.2 ensure there is no folder structure called "<projectname>-0.x-orig" left over from a failed compile
3.3 remove old compiles from the Madde\home\user (e.g. C:\Madde\0.5\home\Shep) folder.
4. Copy the "src" folder from the tested Qt project into the "<projectname-0.x" folder

5. Create (or obtain) an application Icon. This should be a 64x64 png. Call it <projectname>.png and place it in the "src" folder.

6. Again inside the "src" folder create a new file called "<projectname>.desktop"
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.x
Type=Application
Name=<Long Descriptive Project Name>
Exec=/usr/bin/<projectname>
Icon=<projectname>
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
7. Again inside the "src" folder create a new file called "<projectname>.service" which looks like this
Code:
[D-BUS Service]
Name=org.maemo.<projectname>
Exec=/usr/bin/<projectname>
8. Inside the "src" folder added a file called "src.pro". Getting this right is the key to getting the Makefile correct and hence the install working. At the end of this file there is a section called "INSTALLS += "...for every file you want installed in a location you need an entry here. I've colour coded the 4 installs below for clarity.
Code:
TARGET = wwcalc
TEMPLATE = app
SOURCES += qtmain.cpp \
    mainwindow.cpp 
HEADERS += mainwindow.h 
FORMS += mainwindow.ui 
PREFIX = ../debian/wwcalc/usr

unix {
BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share

DEFINES += DATADIR=\"$$DATADIR\" PKGDATADIR=\"$$PKGDATADIR\"

#MAKE INSTALL

INSTALLS += target desktop icon64 service

  target.path =$$BINDIR

  desktop.path = $$DATADIR/applications/hildon
  desktop.files += wwcalc.desktop

  icon64.path = $$DATADIR/icons/hicolor/64x64/apps
  icon64.files += wwcalc.png
  
  service.path = $$DATADIR/usr/share/dbus-1/services
  service.files += wwcalc.service

}
9. Up one level and inside the new top level folder (i.e. "c:\Madde\0.5\home\<YOU!>\<projectname>-0.x" ) created a file called "<projectname>.pro" with the following exact contents
Code:
TEMPLATE = subdirs
SUBDIRS  = src

10. In Madde make sure the runtime is up and connectible (described here) and then execute
Code:
mad dh_make --createorig --single -e foo.bar@gmail.com -c gpl
mad qmake
mad dpkg-buildpackage
mad remote -r org.maemo.wwcalc send ../wwcalc_0.2-1_armel.deb
mad remote -r org.maemo.wwcalc install wwcalc_0.2-1_armel.deb
mad remote -r org.maemo.wwcalc run dpkg -L wwcalc
Anything else? Yes!

2 things.
Firstly, the icon cache is not automatically updated yet.

(According to Too) The following command needs to be added to the end of debian/postinst
Code:
gtk-update-icon-cache -f /usr/share/icons/hicolor
Secondly, there is no option to uninstall the app. I have no idea how to uninstall an application installed this way. it does not appear in the app manager. Any hints appreciated.
I hope this helps/works!

Many thanks to many users who helped me understand this structure especially too, Salser (sorry Salser I'm still using your lovely timer png file, I'll go and make my own one now!) and danielwilms.

Shep
Attached Images
 
Attached Files
File Type: zip wwcalc-0.3.zip (345.6 KB, 89 views)
 

The Following User Says Thank You to shep For This Useful Post:
Posts: 60 | Thanked: 23 times | Joined on Jan 2010
#20
Okay, I will type the steps i take:

1. Open MADDE terminal

2. Execute: mad pscreate -t qt_simple qth

3. Renamed folder qth to qth-0.1

4. Deleted folders debian and uis

5. Placed a 64x64 image named qth.png in src folder

6. Created a file named qth.desktop in src with this content:
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Name=qth
Exec=/usr/bin/qth
Icon=qth
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
7. Created qth.service in src with this content:
Code:
[D-BUS Service]
Name=org.maemo.qth
Exec=/usr/bin/qth
8. Created src.pro in src with this content:
Code:
TARGET = qth
TEMPLATE = app
SOURCES += qtmain.cpp 
HEADERS +=  
FORMS += 
PREFIX = ../debian/qth/usr

unix {
BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share

DEFINES += DATADIR=\"$$DATADIR\" PKGDATADIR=\"$$PKGDATADIR\"

#MAKE INSTALL

INSTALLS += target desktop icon64 service

  target.path =$$BINDIR

  desktop.path = $$DATADIR/applications/hildon
  desktop.files += qth.desktop

  icon64.path = $$DATADIR/icons/hicolor/64x64/apps
  icon64.files += qth.png
  
  service.path = $$DATADIR/usr/share/dbus-1/services
  service.files += qth.service

}
8. Then created a file named qth.pro in the qth-0.1 folder with this content:
Code:
TEMPLATE = subdirs
SUBDIRS  = src
9. Deleted the file named qtprog.pro

10. Then i used these commands:
Code:
cd qth-0.1
mad dh_make --createorig --single -e foo.bar@gmail.com -c gpl
mad qmake
mad dpkg-buildpackage
11. Transfered qth_0.1-1_armel.deb to the N900 (MyDocs)

12. Open Terminal (N900)

13. Executed: sudo gainroot

14. Executed: cd MyDocs

15. Executed: dpkg -i qth_0.1-1_armel.deb

Shortcut to application is in the app selection menu! (Blue icon)

16. restarted N900

Shortcut now has icon in app selection menu!

Now.. how to uninstall with app manager ? is it possible?
Thanks a lot shep!

Last edited by tmsha; 2010-01-18 at 19:02.
 

The Following User Says Thank You to tmsha For This Useful Post:
Reply


 
Forum Jump


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