Reply
Thread Tools
Posts: 434 | Thanked: 325 times | Joined on Sep 2009
#1
Here is a little project of mine which I did for two reasons. I wanted to learn C++/Qt and I needed a countdown timer. Initially I had no intentions to release this app, but now that it's almost ready, I thought someone else mind find it useful too.

Basically it is a simple countdown timer with 1 second precision that can countdown all the way from 60 minutes (60 minutes and 59 seconds to be precise ). It has 4 customisable buttons for preset times in addition to the normal + and - dials.

I still have some issues and I would appreciate any help.

1. SOLVED Sound doesn't work. EDIT: Using Phonon instead of QSound now.


2. SOLVED EDIT: This issue is only present when doing a run with MADDE. Once the app is properly installed there is no issue.
I can't access the /home/user/MyDocs/.sounds directory with native dialog. With the following setting it works, but that dialog is not very finger friendly:
Code:
QFileDialog::DontUseNativeDialog
3. SOLVED I still have not figured out how to make a Debian package which includes a shortcut to the app.

4. SOLVED How to optify this app.

5. DONE Thanks to Juxxxer! And finally, could someone please make an icon for this app. I absolutely stink with anything that requires even only very basic drawing skills.

Countdwon Timer is now available in Extras-Devel.

Here are the source files.
Attached Images
 

Last edited by Sasler; 2010-01-13 at 18:53. Reason: Updated to the latest status
 

The Following User Says Thank You to Sasler For This Useful Post:
Posts: 434 | Thanked: 325 times | Joined on Sep 2009
#2
OK, here is some more info about the sound problem:

I'm using QSound:lay(fileName). This works fine in Windows, but I get no sound in N900.

I'm also trying to test Phonon::MediaObject, but I don't seem to have the necessary libraries on my 64 bit Windows 7 for it to work.
 
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#3
Hi,

Originally Posted by Sasler View Post
2. I can't access the /home/user/MyDocs/.sounds directory with native dialog. With the following setting it works, but that dialog is not very finger friendly:

Code:
QFileDialog::DontUseNativeDialog
There should be a directory called "Audio clips" in the file dialog, which is actually the MyDocs/.sounds directory.

Originally Posted by Sasler View Post
3. I still have not figured out how to make a Debian package which includes a shortcut to the app.
You have to create a desktop-file and place it correctly. Have a look here how to do it. On the same page you will find a Qt packaging guide as well.

Originally Posted by Sasler View Post
4. How to optify this app.
Haven't tried it yet, but in general you could try to add a debian/optify file and put "auto" there. No guarantee that this will work

Originally Posted by Sasler View Post
5. And finally, could someone please make an icon for this app. I absolutely stink with anything that requires even only very basic drawing skills.
Same problem here

Daniel
 

The Following User Says Thank You to danielwilms For This Useful Post:
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#4
Originally Posted by danielwilms View Post
Hi,



There should be a directory called "Audio clips" in the file dialog, which is actually the MyDocs/.sounds directory.



You have to create a desktop-file and place it correctly. Have a look here how to do it. On the same page you will find a Qt packaging guide as well.



Haven't tried it yet, but in general you could try to add a debian/optify file and put "auto" there. No guarantee that this will work



Same problem here

Daniel
if the auto in the debian/optify file doesnt work, just make sure your libs and binaries are installed in the /opt
thats what Ive done at the moment for a QT app I created.
Read about this debian/optify in the maemo mailing list as Daniel has mentioned, need to try it out.

cheers
 

The Following User Says Thank You to krk969 For This Useful Post:
Posts: 434 | Thanked: 325 times | Joined on Sep 2009
#5
Originally Posted by danielwilms View Post
You have to create a desktop-file and place it correctly. Have a look here how to do it. On the same page you will find a Qt packaging guide as well.
OK, the this seems a bit too complicated for my limited brain capacity.

This is what I did now (with no success so far):

I created the CountdownTimer.desktop file in the /src directory (I also tried without the Icon line, since I don't have any icons yet):
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Name=Countdown Timer
Exec=/usr/bin/timer
Icon=myapp
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
This is how my pro looks:
Code:
TARGET = timer
HEADERS += src/form.h \
    src/settings.h
SOURCES += qtmain.cpp \
    src/form.cpp \
    src/settings.cpp
FORMS += src/form.ui \
    src/settings.ui

# LEXS#
LEXSOURCES += 

# YACCS#
YACCSOURCES += 
INCLUDEPATH += 
LIBS += 
DEFINES += 

# All generated files goes same directory
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
DESTDIR = build
TEMPLATE = app
DEPENDPATH += 
VPATH += src \
    uis
CONFIG -= 
CONFIG += debug
QT = core \
    gui
MY_BIN_PATH = /usr/bin/

# Default installation overwritten because qmake and debian both
# uses DESTDIR in different purposes
install.commands = -$(INSTALL_PROGRAM) \
    $(TARGET) \
    \"$(DESTDIR)\"$$MY_BIN_PATH$(QMAKE_TARGET)
install.depends = $(TARGET)
desktop.path = $$DATADIR/applications/hildon
  desktop.files += $${TARGET}.desktop

iconxpm.path = $$DATADIR/pixmap
  iconxpm.files += ../data/maemo/$${TARGET}.xpm

  icon26.path = $$DATADIR/icons/hicolor/26x26/apps
  icon26.files += ../data/26x26/$${TARGET}.png

  icon40.path = $$DATADIR/icons/hicolor/40x40/apps
  icon40.files += ../data/40x40/$${TARGET}.png

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

# Targets for debian source and binary package creation
debian-src.commands = dpkg-buildpackage \
    -S \
    -r \
    -us \
    -uc \
    -d
debian-bin.commands = dpkg-buildpackage \
    -b \
    -r \
    -uc \
    -d
debian-all.depends = debian-src \
    debian-bin

# Clean all but Makefile
compiler_clean.commands = -$(DEL_FILE) \
    $(TARGET)
QMAKE_EXTRA_TARGETS += debian-all \
    debian-src \
    debian-bin \
    install \
    compiler_clean
RESOURCES =
I use the following command in MADDE to make the package:
Code:
mad dpkg-buildpackage
I can install it, but it won't create the shortcut. Writing timer in the terminal runs the app just fine. I included the package here if someone wants to test it out.
Attached Files
File Type: deb timer_0.1_armel.deb (262.1 KB, 203 views)
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#6
Originally Posted by Sasler View Post
OK, the this seems a bit too complicated for my limited brain capacity.

This is what I did now (with no success so far):

I created the CountdownTimer.desktop file in the /src directory (I also tried without the Icon line, since I don't have any icons yet):
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Name=Countdown Timer
Exec=/usr/bin/timer
Icon=myapp
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
This is how my pro looks:
Code:
TARGET = timer
HEADERS += src/form.h \
    src/settings.h
SOURCES += qtmain.cpp \
    src/form.cpp \
    src/settings.cpp
FORMS += src/form.ui \
    src/settings.ui

# LEXS#
LEXSOURCES += 

# YACCS#
YACCSOURCES += 
INCLUDEPATH += 
LIBS += 
DEFINES += 

# All generated files goes same directory
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
DESTDIR = build
TEMPLATE = app
DEPENDPATH += 
VPATH += src \
    uis
CONFIG -= 
CONFIG += debug
QT = core \
    gui
MY_BIN_PATH = /usr/bin/

# Default installation overwritten because qmake and debian both
# uses DESTDIR in different purposes
install.commands = -$(INSTALL_PROGRAM) \
    $(TARGET) \
    \"$(DESTDIR)\"$$MY_BIN_PATH$(QMAKE_TARGET)
install.depends = $(TARGET)
desktop.path = $$DATADIR/applications/hildon
  desktop.files += $${TARGET}.desktop

iconxpm.path = $$DATADIR/pixmap
  iconxpm.files += ../data/maemo/$${TARGET}.xpm

  icon26.path = $$DATADIR/icons/hicolor/26x26/apps
  icon26.files += ../data/26x26/$${TARGET}.png

  icon40.path = $$DATADIR/icons/hicolor/40x40/apps
  icon40.files += ../data/40x40/$${TARGET}.png

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

# Targets for debian source and binary package creation
debian-src.commands = dpkg-buildpackage \
    -S \
    -r \
    -us \
    -uc \
    -d
debian-bin.commands = dpkg-buildpackage \
    -b \
    -r \
    -uc \
    -d
debian-all.depends = debian-src \
    debian-bin

# Clean all but Makefile
compiler_clean.commands = -$(DEL_FILE) \
    $(TARGET)
QMAKE_EXTRA_TARGETS += debian-all \
    debian-src \
    debian-bin \
    install \
    compiler_clean
RESOURCES =
I use the following command in MADDE to make the package:
Code:
mad dpkg-buildpackage
I can install it, but it won't create the shortcut. Writing timer in the terminal runs the app just fine. I included the package here if someone wants to test it out.
did you copy the .desktop file to /usr/share/applications/hildon/ ?
thats where it should be.
And, Ive still not managed to add this as a widget, but I can add it as a shortcut to app on the home desktop.
 

The Following User Says Thank You to krk969 For This Useful Post:
Posts: 434 | Thanked: 325 times | Joined on Sep 2009
#7
Originally Posted by krk969 View Post
did you copy the .desktop file to /usr/share/applications/hildon/ ?
thats where it should be.
And, Ive still not managed to add this as a widget, but I can add it as a shortcut to app on the home desktop.
No I did not. What I want is to create a .deb package which would automatically install the shortcut. Isn't this possible?
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#8
Originally Posted by Sasler View Post
No I did not. What I want is to create a .deb package which would automatically install the shortcut. Isn't this possible?
yes its possible
this can be configured in the .pro file.

something like

desktop.files = <<your .desktop file>
desktop.path = /usr/share/applications/hildon
INSTALLS += desktop

EDIT::

oops I read between the lines.
No the shortcut wont appear automatically after installing your app using dpkg.
You need to manually create a shortcut from the home screen.
This is the info I have with my limited knowledge.

Last edited by krk969; 2010-01-04 at 12:47. Reason: misread :-)
 

The Following User Says Thank You to krk969 For This Useful Post:
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#9
Originally Posted by Sasler View Post
No I did not. What I want is to create a .deb package which would automatically install the shortcut. Isn't this possible?
I have once created a small Qt application. Look at the sources. There, in the "src" directory you will find the src.pro and the desktop file. In this example it works

Daniel
 

The Following 2 Users Say Thank You to danielwilms For This Useful Post:
Posts: 31 | Thanked: 18 times | Joined on Oct 2009 @ Helsinki
#10
Hi, do you know any information about the logo size (in pixels). I could be interested to do something

Edit: Or are those svg pics? Should I look Hildon documentation or QT documentation about what kind of format etc this logo needs to be? Are there any examples around?

Jux

Last edited by juxxxer; 2010-01-04 at 13:12. Reason: After googling...
 

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


 
Forum Jump


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