maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Packaging a Qt App to Deploy With It's Icon (https://talk.maemo.org/showthread.php?t=40952)

shep 2010-01-16 23:11

Packaging a Qt App to Deploy With It's Icon
 
1 Attachment(s)
Hi All,

I hope you can help. I felt I was spamming the Technology Preview thread with dev type questions, so I have started a new thread.

Anyhoo, I've got my first Qt app working, it deploys and I can run it from X-Terminal, but I can't get it to deploy to the N900 and display as an Icon to run it directly.

Here's what I have done.

I followed DanielWilm's instructions on this page: http://talk.maemo.org/showpost.php?p...4&postcount=28 and also Too's instructions in this post http://talk.maemo.org/showpost.php?p...&postcount=117

My source code is attached.

When I compile I do the following -

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.1-1_armel.deb
mad remote -r wwcalc install wwcalc_0.1-1_armel.deb
mad remote -r wwcalc run dpkg -L wwcalc

All commands execute without errors (so far as I can see).

After that last command I get the following -

Code:

/usr
/usr/bin
/usr/bin/wwcalc
/usr/sbin
/usr/share
/usr/share/doc
/usr/share/doc/wwcalc
/usr/share/doc/wwcalc/changelog.Debian.gz
/usr/share/doc/wwcalc/copyright
/usr/share/doc/wwcalc/README.Debian
/usr/share/icons
/usr/share/icons/hicolor
/usr/share/icons/hicolor/64x64
/usr/share/icons/hicolor/64x64/apps
/usr/share/icons/hicolor/64x64/apps/wwcalc.png

But still....no icon on the N900
:confused:

I know little of nothing about MAKEFILEs and I suspect that may be my downfall.

Fingers crossed that someone can help.

Also - sorry to be a pain, but if you think you can help please don't assume I know anything :) Sorry, but idiot proof steps would be a great help!

I'd be more than happy to put together a guide for the Madde wiki FAQ once I get my head around this....

Thanks,

Shep

krk969 2010-01-17 01:37

Re: Packaging a Qt App to Deploy With It's Icon
 
Quote:

Originally Posted by shep (Post 477100)
Hi All,

After that last command I get the following -

Code:

/usr
/usr/bin
/usr/bin/wwcalc
/usr/sbin
/usr/share
/usr/share/doc
/usr/share/doc/wwcalc
/usr/share/doc/wwcalc/changelog.Debian.gz
/usr/share/doc/wwcalc/copyright
/usr/share/doc/wwcalc/README.Debian
/usr/share/icons
/usr/share/icons/hicolor
/usr/share/icons/hicolor/64x64
/usr/share/icons/hicolor/64x64/apps
/usr/share/icons/hicolor/64x64/apps/wwcalc.png

But still....no icon on the N900
:confused:
...

Shep

Havent used the MADDE env before, im old school , so still rely on debian packaging commands.
I didnt see any debian config files likes debian/rules or debian/control.
the problem seems like either nothing is getting built or they are not getting installed.
sorry for the vague answer, but can you try to make this a little more clear.

mikkov 2010-01-17 01:49

Re: Packaging a Qt App to Deploy With It's Icon
 
you are missing the .desktop file, see http://wiki.maemo.org/Desktop_file_format and http://wiki.maemo.org/Packaging_a_Qt...n_.26_position

shep 2010-01-17 11:36

Re: Packaging a Qt App to Deploy With It's Icon
 
Quote:

Originally Posted by mikkov (Post 477356)

Hi, thanks for the hint.

I did have a .desktop file though, maybe in the wrong place?

shep 2010-01-17 11:58

Re: Packaging a Qt App to Deploy With It's Icon
 
2 Attachment(s)
OK, I've gone back to basics and started from scratch.

- Created project through Madde

- Edited, tested etc. with QT Creator

- (once tested) Created clean empty top level folder "wwcalc-0.2"

- Added my "src" folder to the "wwcalc-0.2" folder

- Added a "data" folder to the project with 2 subfolders, "48x48" and "64x64", each of these has a png called "wwcalc.png" inside (see folders.jpg attached for structure)

- Inside the new top level folder created a file called "wwcalc.pro"
Code:

TEMPLATE = subdirs
SUBDIRS  = src

- Inside the "src" folder added a file called "scr.pro"
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

  target.path =$$BINDIR

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

  icon64.path = $$DATADIR/icons/hicolor/64x64/apps
  icon64.files += ../data/64x64/wwcalc.png
 
}

- Inside "src" folder created another file called "wwcalc.desktop"
Code:

[Desktop Entry]
Encoding=UTF-8
Version=0.2
Type=Application
Name=WW Calc
Exec=/usr/bin/wwcalc
Icon=wwcalc
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable

- In the OS ensure there is no "debian" folder at the same level as "src" and ensure there is no folder structure called "wwcalc-0.2-orig" left over from a failed compile

- In madde execute
Code:

mad dh_make --createorig --single -e foo.bar@gmail.com -c gpl

mad qmake

- I then edited the "Makefile" in the "src" folder - I don't know if this is right??? I added this just before the "install:" section
Code:

...
install_icon64: first FORCE
        @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/share/icons/hicolor/64x64/apps/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/share/icons/hicolor/64x64/apps/
        -$(INSTALL_FILE) c:\MADDE\0.5\home\Stephen\wwcalc-0.2\data\64x64\wwcalc.png $(INSTALL_ROOT)/usr/local/share/icons/hicolor/64x64/apps/


uninstall_icon64:  FORCE
        -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/local/share/icons/hicolor/64x64/apps/c:/MADDE/0.5/home/Stephen/wwcalc-0.2/data/64x64/wwcalc.png
        -$(DEL_DIR) $(INSTALL_ROOT)/usr/local/share/icons/hicolor/64x64/apps/
...

- Again in Madde
Code:

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

So...the result....partial success - I have a WWCalc app icon showing, but it's a bare blue box.

Any ideas what's wrong with the setup now?

Thanks,

Shep

krk969 2010-01-17 12:15

Re: Packaging a Qt App to Deploy With It's Icon
 
Quote:

Originally Posted by shep (Post 477885)

Any ideas what's wrong with the setup now?

Thanks,

Shep

this is a known issue
please refer the wiki here

basically you need to run this I think

gtk-update-icon-cache /usr/share/icons/hicolor
check the wiki as the info might be updated

or alternatively try restarting your device and the icons might appear, had worked like that for me, but the wiki has info to make it work right first time.

tmsha 2010-01-17 13:49

Re: Packaging a Qt App to Deploy With It's Icon
 
I just followd your example and i get no icon at all, not even a blue one.
What i did was the following:

Downloaded your source, extracted it.
Executed these commands:
mad dh_make --createorig --single -e foo.bar@gmail.com -c gpl

mad qmake

mad dpkg-buildpackage

Then transfered the file to device and installed it..

No icon at all..
And no way to uninstall it..

Can some please please please make a tutorial on how to create an icon for this example:

http://wiki.maemo.org/MADDE/Qt_Example

I bet that will help many, if someone can tell me the exact steps to take here i can make a wiki on how to do it. No problem.

Please, someone must know this.

shep 2010-01-17 16:12

Re: Packaging a Qt App to Deploy With It's Icon
 
Quote:

Originally Posted by tmsha (Post 478058)
...

Then transfered the file to device and installed it..

No icon at all..
And no way to uninstall it..

How did you transfer & install it?

I have no option to uninstall either, which surprised me when the (blank) icon finally installed.

The is a mad command to remove a target, I wonder does that to an uninstall??? anyhow I guess you can always "sudo gainroot" and remove the folders.

Quote:

Originally Posted by tmsha (Post 478058)
Can some please please please make a tutorial on how to create an icon for this example:

http://wiki.maemo.org/MADDE/Qt_Example

I bet that will help many, if someone can tell me the exact steps to take here i can make a wiki on how to do it. No problem.

Please, someone must know this.

Agreed, that's why I listed my steps so explicitly...I figure I'm a fair way towards getting a simple package over with icon.

Shep

shep 2010-01-17 16:18

Re: Packaging a Qt App to Deploy With It's Icon
 
Quote:

Originally Posted by krk969 (Post 477905)
this is a known issue
please refer the wiki here

basically you need to run this I think

gtk-update-icon-cache /usr/share/icons/hicolor
check the wiki as the info might be updated

or alternatively try restarting your device and the icons might appear, had worked like that for me, but the wiki has info to make it work right first time.

I tried both and I still have the blue square :(

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

Shep

tmsha 2010-01-17 16:58

Re: Packaging a Qt App to Deploy With It's Icon
 
shep: i transfered it with usb and installed with dpkg -i with root access.


All times are GMT. The time now is 09:05.

vBulletin® Version 3.8.8