Notices


Reply
Thread Tools
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#1
Well, I haven't seen any tip calculators available for my n800, and I thought one might be useful, so I wrote one up really quick. Just put in the bill total, tip percent, and tax, and hit calculate! It also support splitting the bill between multiple people.

This is only my second python program, so there are most likely bugs here and there. Please post any bugs you find here, and I'll try to get them fixed as soon as possible. If there are any other features you'd like, also put those here.

Obligatory screenshot:


Deb file attached!

[edit] Updated to version 1.1! Screenshot above updated. Changelog:
  • Fixed splitting the bill -- you can now use the keyboard to enter the number of people.
  • Added tax inclusion. The tip will be calculated off the bill without tax (as it should), and then tax will be added.
  • Tax can be entered as a percent or as a price.

Note: for some reason, updating is funky. When updating, the application manager will not prompt for update, it will prompt for install. Don't worry. Everything works out fine.

[edit2] Updated to version 1.1.1! No visual changes. Just made sure all fields are numeric. From what I understand, this means that when using the hardware keyboard on the N810, you will NOT need to press the Fn key in order to input numbers. On the N800, you will need to press shift to see the number keys before you can input number (if you have auto-capitalize enabled). The behavior is a bit weird, but now all number fields will ONLY accept numbers.

[edit3] Up to version 1.2! This should (hopefully) fix problems with putting in numbers. n800 users will notice that only numbers and special keys show up on the keyboard now, but I am unsure how it will act for n810 users.
Attached Files
File Type: deb TipCalculator-1.2.0-1_all.deb (10.2 KB, 195 views)
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter

Last edited by TrueJournals; 2008-06-30 at 03:14. Reason: Version 1.1.1!
 

The Following 5 Users Say Thank You to TrueJournals For This Useful Post:
Posts: 674 | Thanked: 191 times | Joined on Mar 2008 @ Buenos Aires, Argentina
#2
Nice, TrueJournals. I would like to start developing small apps like this one.

By the way, I found very difficult to input values. To enter the bill amount I had to keep pressed the Fn key in my hardware keyword. I couldn't double press it.

I couldn't change the quantity of people.
 
IcelandDreams's Avatar
Posts: 228 | Thanked: 30 times | Joined on Mar 2008 @ Ontario & Iceland
#3
simple yet interesting. even handier if the restaurant offers free WiFI, had that happen recently so I did my own dinner music via the N8*.

In Ontario it is dead simple to figure a tip since the tax is also 15%. or is it now 14%..... Those other features looks interesting.
 
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#4
Originally Posted by alephito View Post
Nice, TrueJournals. I would like to start developing small apps like this one.

By the way, I found very difficult to input values. To enter the bill amount I had to keep pressed the Fn key in my hardware keyword. I couldn't double press it.

I couldn't change the quantity of people.
Thanks for the feedback. Unfortunately, I don't have a N810 to test it with, and I'm really unfamiliar with how the hardware keyboard works. From your post, I'm guessing the holding Fn while pressing certain keys will change the function of those keys (changing some keys to numbers)? And double pressing Fn will turn Fn-lock on?

It's difficult to say what a solution would be. I'm using a GTK spin control, so that might be a problem. I suppose I could change it to a standard text-entry control. Although, there might be some sort of hildonization technique that I'm just missing.

Changing the number of people can be done three ways: by entering the number into the box, by pressing the up/down buttons on the right of the box, or by pressing up and down on the d-pad while the box is active. Let me know if that works for you. Can you elaborate on how you couldn't change the number of people? Were you unable to select the box? Or once selected, were you just having keyboard trouble?
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter
 
Posts: 674 | Thanked: 191 times | Joined on Mar 2008 @ Buenos Aires, Argentina
#5
Originally Posted by TrueJournals View Post
Thanks for the feedback. Unfortunately, I don't have a N810 to test it with, and I'm really unfamiliar with how the hardware keyboard works. From your post, I'm guessing the holding Fn while pressing certain keys will change the function of those keys (changing some keys to numbers)? And double pressing Fn will turn Fn-lock on?
Yes, it is like you said. In your app, when you press Fn once, it appears the symbol that you expect when you press it twice: it is an underlined 'Fn' in the screen. But it does not behave like you would expect and you end holding Fn down and pressing the numbered keys.

Originally Posted by TrueJournals View Post
Changing the number of people can be done three ways: by entering the number into the box, by pressing the up/down buttons on the right of the box, or by pressing up and down on the d-pad while the box is active. Let me know if that works for you. Can you elaborate on how you couldn't change the number of people? Were you unable to select the box? Or once selected, were you just having keyboard trouble?
The problem is when I select the box: I cannot delete the '1', I cannot write anything over it. Always remains the '1'.

I did not notice the up/down buttons on the right of the box: they were really tinny. But the important thing is they work. The d-pad works too. Thanks.
 
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#6
Unfortunately, I'm not sure what to do about the weird behavior of the Fn key. I have a feeling it's just a problem with GTK spin controls, but I'm not really sure. Can some python/glade guru help out?

Anyway, I updated the first post with a new version -- version 1.1. It not only fixes the problem with changing the number of people (I had the control set to uneditable.. woops!), it also adds support for tax. Tax works just as it should: you can choose either percentage (if you know it in your area), or the price of tax (which most bills tell you). Enter the subtotal in the first box, then enter the tip and tax. Tip will be calculated off the total without tax, then tax will be added, and the final bill with tax will be split.
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter
 
brontide's Avatar
Posts: 868 | Thanked: 474 times | Joined on Oct 2007 @ Capital District, NY, USA
#7
Since I just spent the better part of a week banging my head on the wall here is a pointer.

http://maemo.org/api_refs/4.1/gtk+2....set-input-mode

By setting a GtkEntry to be NUMERIC only it will allow easier non-Fn key number entry. entry.set_input_mode( mask )

But your problem might be easier.

http://maemo.org/api_refs/4.1/gtk+2....on-set-numeric

gtkspinbutton.set_numeric( True )

Might also do the trick.

Of course this may or may not work under Python.
 

The Following User Says Thank You to brontide For This Useful Post:
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#8
Well, I did have the bill field set to numeric in python, but not some of the other fields. I have now set them all to numeric and updated the first post with version 1.1.1. I believe that now you DON'T need to press Fn on the n810 keyboard in order to put numbers in to these fields, but without an n810, I can't really test this. Someone with an n810, please let me know!
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter
 
Posts: 674 | Thanked: 191 times | Joined on Mar 2008 @ Buenos Aires, Argentina
#9
Well, now I have to keep Fn pressed in all fields.

By the way: if all fields are set to numeric, why the software keyword does not offer the numeric keypad? When I select any field I see the numeric keypad, but as soon as I select or delete the existing number, the keypad is gone.

I hope I was clear. Sorry, but my English is really limited.
 
Posts: 674 | Thanked: 191 times | Joined on Mar 2008 @ Buenos Aires, Argentina
#10
I can answer my last point: when I select the numbers, the shift key is pressed automatically. You have to press it to access the numeric keypad.
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:56.