maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   SImple QT Desktop Widget to display battery level and percentage in Extras-devel now (https://talk.maemo.org/showthread.php?t=38749)

krk969 2009-12-29 22:15

SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Folks, here it is a deskop widget to display the battery level as a percentage.

Its in the desktop section as batlevel.
You need t enable extras-devel repository.

One thing I havent figured out completely is how to add it to the desktop add widgets menu, currenly it will appear in add shortcut as an app but when started it will open as a desktop widget.
It seems deskop widgets need to be libraries and mine is a binary, while i figure out the technicalities related to this feel free to play with this and discuss any bugs/improvements.

This is a very simple display, I will try adding more functional/eye-candy stuff if I dont get busy with some other projects. But Id like to hear your ideas.
just to let you know Im currently working on making it look more like a battery than a progress bar :D

Three ways to start it.

1. from X terminal run the command
run_batlevel

2. from the desktop , click add a shortcut , choose batlevel, and then click on the shortcut ( the shortcut can be deleted later as the widget will appear on the desktop )


3. The usual way, go to the applications menu and run the installed app.

Last but not the least, maemo fellow members have been most helpful in helping create this app . Hope the maemo spirit lives on and grows stronger , ok enough of the emotions now :p Ill let you guys develop more on this.

cheers,

krk969 2009-12-29 22:21

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
I guess I posted this in the wrong thread nstead of applications.
Mods pls feel free to move if not appropriate, but the app is specifically for N900 so maybe its ok to be here .
Sorry I couldnt find an option to move it.:p

reycat 2009-12-29 23:04

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Just tried it, it seems to work. 8 MB, I guess it's optified, isn't it? :)

Thank you very much, I was looking forward to something like this.

OrangeBox 2009-12-29 23:06

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
8 MB for this??? To see the battery level on the desktop that I see already in the status area? Another useless widget.

krk969 2009-12-29 23:08

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by reycat (Post 445907)
Just tried it, it seems to work. 8 MB, I guess it's optified, isn't it? :)

Thank you very much, I was looking forward to something like this.

8 MB did you say ?

anyways the app itself is abt 17K only, maybe you had to download a list of other dependencies that werent on your N900.
Yes the app behaved well so far on my N900 past couple of days, doesnt use too much memory or cpu.
rest we will know soon when the others also try ;)

to know the dependencies you can run this command on your N900

apt-cache showpkg batlevel


alternatively you can also see it when you are about to download the app from the application manager, it lists the dependencies in the details tab.

cheers

pr0xyfl00d3r 2009-12-29 23:23

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Not workin for me, just get a black screen, and at top the loading icon

krk969 2009-12-29 23:29

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by pr0xyfl00d3r (Post 445931)
Not workin for me, just get a black screen, and at top the loading icon


just minimize that screen( clicking on the top left hand corner ), you will see the widget on your desktop and that window just closes on its own immediately.
not sure why that window pops up and stays though I run the app int he background.
will be working on it :).

gabbre 2009-12-29 23:38

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Nice widget!I hope there will be an improvement of the interface in future:)
Good luck for future releases!
PS sorry for my bad english:)

maxximuscool 2009-12-29 23:43

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
7.59MB wtf...

Crashdamage 2009-12-29 23:52

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by OrangeBox (Post 445909)
8 MB for this??? To see the battery level on the desktop that I see already in the status area? Another useless widget.

krk969 deserves thanks for sharing his efforts with everyone - for FREE! If you don't want/like it, don't use it. But don't ***** about it. He doesn't deserve taking your crap for his work.

maxximuscool 2009-12-29 23:54

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
not working.. Got the same Black screen and when minimize it just it just closed immediately. And it's 7.59MB for your information.

That One Guy 2009-12-30 00:02

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
And I bet if you look back at your desktop, you'll see the battery bar.

I agree, almost 8 megs does seem a little excessive. But nevertheless, thank you, Dev. At least you did something and created an app for this purpose.

krk969 2009-12-30 00:05

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by maxximuscool (Post 445970)
not working.. Got the same Black screen and when minimize it just it just closed immediately. And it's 7.59MB for your information.

guys, I think the huge size is due to the dependencies, the library this app is using qtsysteminfo is based on the new QT Mobility API Technology Preview 2, it depends on a lot of other qt libraries like libqt4-maemo5-core, libqt4-maemo5-dbus etc.
Im sure you would have seen this getting installed.

You will be needing all this in your N900 sooner or later to be able to have QT applications so I dont see it as an issue. Feel free to correct me QT gurus.

The app as such is only 16K. the memory footprint is negligible too.

hope ive answered the questions around the 8MB download.
can clarify more if needed, PM me.

cheers


EDIT:

the additional dependent libs are installed in
/opt/qt4-maemo5 ( QT4.6 stuff which is unlikely to exist on your N900 if you havent installed any QT apps that depend on them )
and ive configured qtsysteminfo libs to install in /usr/lib

tissot 2009-12-30 00:05

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Working great for me and something i was looking for.

bsving 2009-12-30 00:36

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Working nice for me too. Only one thing. I uninstallet it, but the widget was still there. I then manually deleted the widget from the homescreen, but is it really deleted now, I mean uninstalled? And 8 MB, it is optified (you didn't answer that question earlier)?

w00t 2009-12-30 00:39

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Guys, yet again: the application itself *is not* 8mb.

That 8mb figure includes libraries (Qt, specifically), and whether or not that is optified is certainly not in the control of an external application developer.

To the developer -
Great job. I've been wanting something like this for a while, and will test it out when I get a chance.

YoDude 2009-12-30 01:20

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by maxximuscool (Post 445955)
7.59MB wtf...

It is in the Extra-developers repository isn't it?

Wtf, I can't find your app in there. :confused:

***

Nice effort krk969. It does not stay resident after a reboot but I'm sure you know that. I'm looking forward to seeing it widgetized. Perhaps it can be incorporated in the existing status widget like the simple brightness app is. :)

Techtertainment 2009-12-30 01:23

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
good job..

i am a trainee developer on a graduate programm with a major airline company.. i been doing java and just started learning C++. was thing about doing something small like this to get me started as a developer for maemo but looks like u go there 1st.

quick question. how did you get started setting up and using QT and would it be possible to look at the souce code (hopefully with detailed comments) as a little training for me?

bsving 2009-12-30 01:23

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by w00t (Post 446025)
That 8mb figure includes libraries (Qt, specifically), and whether or not that is optified is certainly not in the control of an external application developer.

I don't think anyone is blaming anyone for anything. A yes or no from the developer will be sufficient. It is a simple question.

kabu 2009-12-30 03:09

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
so,but it couldn't like other widget autoboot,add widget fron menu

krk969 2009-12-30 08:01

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by bsving (Post 446065)
I don't think anyone is blaming anyone for anything. A yes or no from the developer will be sufficient. It is a simple question.

already answered :) ==>
http://talk.maemo.org/showpost.php?p...6&postcount=13

bsving 2009-12-30 09:07

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by krk969 (Post 446333)
already answered :)

Not a very good answer to the question in that case :) Anyway, looking through my files, I see a new qt directory in /opt. This is qt 4.6.1 as opposed to the qt 4.5 already in the /usr directory.

timoph 2009-12-30 09:45

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by bsving (Post 446367)
Not a very good answer to the question in that case :) Anyway, looking through my files, I see a new qt directory in /opt. This is qt 4.6.1 as opposed to the qt 4.5 already in the /usr directory.

Well, the widget uses Qt 4.6 and those libs install to /opt

Qt 4.5 in /usr is currently the default version of Qt and it's going to be replaced by 4.6 some time in the future.

For those complaining about the size. The widget itself is small but if you haven't installed any apps that depend on Qt 4.6, those libs are installed also. If you look at the package details in the application manager you will see that packages that are going to be installed. The libraries are only installed once so next time you install some Qt application it doesn't appear as big.

Regarding the "black screen" -issue. The blank application screen appear because the widget isn't a shared object like the other widgets are (and are supposed to be). Because the widget is a normal application binary it's started as one (just close the application window and it works). In order to fix this the widget needs to be compiled differently and it has to have some interfaces implemented in it that don't exist in the current version. This obviously needs to be studied how it's done with Qt and so on.

The widget is still a work in progress and that why it's in extras-devel and further more there's a reason why normal users should stay away from extras-devel.

Anyway nice work krk969

Fargus 2009-12-30 09:54

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by krk969 (Post 445986)
guys, I think the huge size is due to the dependencies, the library this app is using qtsysteminfo is based on the new QT Mobility API Technology Preview 2, it depends on a lot of other qt libraries like libqt4-maemo5-core, libqt4-maemo5-dbus etc.
Im sure you would have seen this getting installed.

You will be needing all this in your N900 sooner or later to be able to have QT applications so I dont see it as an issue. Feel free to correct me QT gurus.

The app as such is only 16K. the memory footprint is negligible too.

hope ive answered the questions around the 8MB download.
can clarify more if needed, PM me.

cheers

Well to be honest this still seems smaller than the Python payload that a lot of people use without any issues.

jcompagner 2009-12-30 10:15

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
i think there are now a few more widgets that appear as applications, egg timer, FM RDS Notify widget and so on.
They all have the same behavior, so i guess a wiki page needs to be clear what exactly must be done to create/compile a widget...

krk969 2009-12-30 10:28

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by timoph (Post 446383)
Well, the widget uses Qt 4.6 and those libs install to /opt

Qt 4.5 in /usr is currently the default version of Qt and it's going to be replaced by 4.6 some time in the future.

For those complaining about the size. The widget itself is small but if you haven't installed any apps that depend on Qt 4.6, those libs are installed also. If you look at the package details in the application manager you will see that packages that are going to be installed. The libraries are only installed once so next time you install some Qt application it doesn't appear as big.

Regarding the "black screen" -issue. The blank application screen appear because the widget isn't a shared object like the other widgets are (and are supposed to be). Because the widget is a normal application binary it's started as one (just close the application window and it works). In order to fix this the widget needs to be compiled differently and it has to have some interfaces implemented in it that don't exist in the current version. This obviously needs to be studied how it's done with Qt and so on.

The widget is still a work in progress and that why it's in extras-devel and further more there's a reason why normal users should stay away from extras-devel.

Anyway nice work krk969

I presume most desktop widgets out there that appear in the desktop add widget menu are gtk based.
so one way is to figure out how its done in gtk and make a dummy gtk to call my code ( compiled as a lib )

I havent found a way yet to make a QT widget appear in the desktop widget menu.
will most certainly work on it as I think its something we all cannot do without :)
if anybody has any info please share.

for those that didnt know you can get the source of my code using
apt-get source batlevel

ceefour 2009-12-30 11:13

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by krk969 (Post 445986)
guys, I think the huge size is due to the dependencies, the library this app is using qtsysteminfo is based on the new QT Mobility API Technology Preview 2, it depends on a lot of other qt libraries like libqt4-maemo5-core, libqt4-maemo5-dbus etc.

Congrats krk969 for getting your Maemo + Qt Mobility widget done!

Some questions for you krk969:
  1. Will the second installed Qt widget use another 8 MB, or just marginal memory usage? (since Qt library is already loaded)
  2. A bunch of OOT questions: What's your personal opinion regarding Maemo vs Symbian? Should Nokia kill Symbian and boost Maemo, or the other way around? Is Maemo in the same ground as iPhone, Android, WebOS... or is it superior/inferior? (I'm definitely expecting subjective answers here)

krk969 2009-12-30 11:56

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by ceefour (Post 446452)
Congrats krk969 for getting your Maemo + Qt Mobility widget done!

Some questions for you krk969:
  1. Will the second installed Qt widget use another 8 MB, or just marginal memory usage? (since Qt library is already loaded)
  2. A bunch of OOT questions: What's your personal opinion regarding Maemo vs Symbian? Should Nokia kill Symbian and boost Maemo, or the other way around? Is Maemo in the same ground as iPhone, Android, WebOS... or is it superior/inferior? (I'm definitely expecting subjective answers here)

Once the dependent QT libs are installed , any other app that might need them wont be carrying this payload, so you can expect the next app to be much smalller if it doesnt have any dependencies other than the ones installed.
normal unix/linux stuff nothing different for maemo.

about my opinion on your OOT questions I have PM'ed you , else it will hijack the thread ;)

funpig 2009-12-30 12:41

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by Techtertainment (Post 446064)
good job..
quick question. how did you get started setting up and using QT and would it be possible to look at the souce code (hopefully with detailed comments) as a little training for me?

i think if you install Qt SDK, you could found so many example with source code. as this thread http://qt.nokia.com/developer/gettin...d#qt-tutorials, you could get start for learn QT.

from http://qt.gitorious.org/, you could see all of source code for QT.

please enjoy QT!!!

bsving 2009-12-30 12:51

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by krk969 (Post 446499)
about my opinion on your OOT questions I have PM'ed you , else it will hijack the thread ;)

I think this would be interresting for lots of people. Could you perhaps make a new thread about that?

humble 2009-12-30 14:00

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
(My Beta testing):cool:

1 issue when battery is fully charged the widget displays 96%.(not sure what it maybe... maybe my device or your code but i havent seen anyone else complain about it yet)

BTW I just restarted and the widget displays 90%:(

Any who thank you for your time and your work.(I like the app it just needs some love)

krk969 2009-12-30 14:29

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by humble (Post 446648)
(My Beta testing):cool:

1 issue when battery is fully charged the widget displays 96%.(not sure what it maybe... maybe my device or your code but i havent seen anyone else complain about it yet)

BTW I just restarted and the widget displays 90%:(

Any who thank you for your time and your work.(I like the app it just needs some love)

Ive already reported this issue in my earlier thread
==> check it out here

Ive also seen many threads discussing this, some of them are
here , here , and here

think its something to do with the libhal implementation, but I cant be sure about it.
Was waiting for more inputs from other users, but I guess Ill go ahead and raise a bug in bugzilla if it doesnt exist there already.

cheers

tissot 2009-12-30 14:42

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by humble (Post 446648)
(My Beta testing):cool:

1 issue when battery is fully charged the widget displays 96%.(not sure what it maybe... maybe my device or your code but i havent seen anyone else complain about it yet)

BTW I just restarted and the widget displays 90%:(

Any who thank you for your time and your work.(I like the app it just needs some love)

I have these same problems. I'm not sure if it's the app or now when i'm seeing it in numbers, but my battery life seems to have gotten lot worse than before.

krk969 2009-12-30 15:00

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by tissot (Post 446691)
I have these same problems. I'm not sure if it's the app or now when i'm seeing it in numbers, but my battery life seems to have gotten lot worse than before.

hopefully just the numbers :p ( and regarding the numbers being skewed, chk my previous post )
anyways my n900 lasts more or less the same amount of time without the widget for me.
last nite at 1145pm battery was at 14% and when i woke up at 7.30am it was 5% had the widget running.( emails on, wifi, bluetooth gps all on )

Anyways, the widget doesnt poll to get the battery info, its using a signal mechanism to where it recieves a signal when the battery level changes then it updates it on screen.

Im hopeful the qtmobility api's have taken into consideration the effect on battery, if not we will learn soon and do something abt it :)

humble 2009-12-30 15:19

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Sry..:o (i found out about this app in this thread)
Next time will do more research.

rrdbala 2009-12-30 15:26

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Hi All,

One quick question. I want to try this app, i did not see this app was not listed in the app manager in My N900. How do i install this on my phone?

Please excuse if it is a very sill question, i am very new to this env. :-)

krk969 2009-12-30 15:50

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by rrdbala (Post 446728)
Hi All,

One quick question. I want to try this app, i did not see this app was not listed in the app manager in My N900. How do i install this on my phone?

Please excuse if it is a very sill question, i am very new to this env. :-)

try enabling the extras-devel repository in your application manager -> refresh -> search for batlevel

you can start ==> here

joppu 2009-12-30 16:11

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Seems to be working fine for me. When you get the custom graphics working, just give me the required specs (resolution and such) and I'll work out the graphics as planned.

rkm 2009-12-30 16:30

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by krk969 (Post 446414)
I havent found a way yet to make a QT widget appear in the desktop widget menu.

I think you need to create a .desktop file in /usr/share/applications/hildon-home to get the widget to show up in the menu.

You can copy-paste one from the existing ones, but the file format is also documented somewhere in SDK docs.

krk969 2009-12-30 16:46

Re: SImple QT Desktop Widget to display battery level and percentage in Extras-devel now
 
Quote:

Originally Posted by rkm (Post 446799)
I think you need to create a .desktop file in /usr/share/applications/hildon-home to get the widget to show up in the menu.

You can copy-paste one from the existing ones, but the file format is also documented somewhere in SDK docs.

thanks.
if you have installed the app, you must have noticed the .desktop being installed in /usr/share/applications/hildon/ ( as per the maemo developer guide )
Ive even tried /usr/share/applications/hildon-home, doesnt work.


All times are GMT. The time now is 06:26.

vBulletin® Version 3.8.8