When charging shows Wh in battery, time to charge and % capacity. When discharging estimated time to empty, current watts drawn and % capacty. Can take a minute for the next sample but a useful none the less. Thanks for the nice example to get started with Qt libraries!
if( wattUsage > 0 && d->timeToEmpty() > 0 )
{
wattString = QDateTime::fromTime_t(d->timeToEmpty()).toString("h:mm") + " h:m\n" + QString::number( wattUsage , 'd' , 1 ) + "w" + QString::number( d->percentage() , 'i' , 0 ) + "%";
}
else
{
wattString = QString::number( d->energy() , 'd' , 2 ) + " Wh\n" + QString::number(d->timeToFull()/60 , 'i', 0 ) + "m " + QString::number( d->percentage() , 'i' , 0 ) + "%";
}
When charging shows Wh in battery, time to charge and % capacity. When discharging estimated time to empty, current watts drawn and % capacty. Can take a minute for the next sample but a useful none the less. Thanks for the nice example to get started with Qt libraries!
if( wattUsage > 0 && d->timeToEmpty() > 0 )
{
wattString = QDateTime::fromTime_t(d->timeToEmpty()).toString("h:mm") + " h:m\n" + QString::number( wattUsage , 'd' , 1 ) + "w" + QString::number( d->percentage() , 'i' , 0 ) + "%";
}
else
{
wattString = QString::number( d->energy() , 'd' , 2 ) + " Wh\n" + QString::number(d->timeToFull()/60 , 'i', 0 ) + "m " + QString::number( d->percentage() , 'i' , 0 ) + "%";
}
It could be a really useful and nice plasmoid, if I only could run it :)
My plasma desktop crashes whenever I try to load it, and plasmoidviewer segfaults as well.
I built it with the cmake flags you suggest. KDE version is 4.7.1 on Arch Linux.
Besides, I agree with bitcrazy for the need of a more consistent way to add translations and edit config options. It could ease yours and other people's, willing to contribute, work.
Translation into english at least would be nice and the possibility to configure whether leading texts or not.
I've translated it in the source for now.
Nice plasmoid nevertheless.
monk
I could write an how-to to edit text into user's language but for adding a language choise I should add a config window...
It's easier to modify it in the source, they're two words ;)
That's right, but may you can spread the sourcw code with english texts for those not able or feared of editing the code. Config options would be fine for font size and background f.e.
m0nk
Thanks!
I tried it, like you wrote, but it somehow doesn't work. I thougth, that i may misunderstood something.
I'll try it today again.
I use Gentoo.
Bye!
Try this:
- For each user: cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=release ../
OR
- For your user: cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` -DCMAKE_BUILD_TYPE=release ../
Let me know if this will work
Ratings & Comments
13 Comments
When charging shows Wh in battery, time to charge and % capacity. When discharging estimated time to empty, current watts drawn and % capacty. Can take a minute for the next sample but a useful none the less. Thanks for the nice example to get started with Qt libraries! if( wattUsage > 0 && d->timeToEmpty() > 0 ) { wattString = QDateTime::fromTime_t(d->timeToEmpty()).toString("h:mm") + " h:m\n" + QString::number( wattUsage , 'd' , 1 ) + "w" + QString::number( d->percentage() , 'i' , 0 ) + "%"; } else { wattString = QString::number( d->energy() , 'd' , 2 ) + " Wh\n" + QString::number(d->timeToFull()/60 , 'i', 0 ) + "m " + QString::number( d->percentage() , 'i' , 0 ) + "%"; }
When charging shows Wh in battery, time to charge and % capacity. When discharging estimated time to empty, current watts drawn and % capacty. Can take a minute for the next sample but a useful none the less. Thanks for the nice example to get started with Qt libraries! if( wattUsage > 0 && d->timeToEmpty() > 0 ) { wattString = QDateTime::fromTime_t(d->timeToEmpty()).toString("h:mm") + " h:m\n" + QString::number( wattUsage , 'd' , 1 ) + "w" + QString::number( d->percentage() , 'i' , 0 ) + "%"; } else { wattString = QString::number( d->energy() , 'd' , 2 ) + " Wh\n" + QString::number(d->timeToFull()/60 , 'i', 0 ) + "m " + QString::number( d->percentage() , 'i' , 0 ) + "%"; }
A minimal version of display for Plasma panel use. if( wattUsage > 0 && d->timeToEmpty() > 0 ) { wattString = QDateTime::fromTime_t(d->timeToEmpty()).toString("h:ss") + " H\n" + QString::number( wattUsage , 'd' , 2 ) + "W"; } else { wattString = "AC:" + QString::number( d->percentage() , 'i' , 0 ) + "%\n" + QString::number( wattUsage , 'd' , 2 ) + "W"; }
Small correction to h:mm wattString = QDateTime::fromTime_t(d->timeToEmpty()).toString("h:mm") + "H\n" + QString::number( wattUsage , 'd' , 2 ) + "W";
It could be a really useful and nice plasmoid, if I only could run it :) My plasma desktop crashes whenever I try to load it, and plasmoidviewer segfaults as well. I built it with the cmake flags you suggest. KDE version is 4.7.1 on Arch Linux. Besides, I agree with bitcrazy for the need of a more consistent way to add translations and edit config options. It could ease yours and other people's, willing to contribute, work.
Translation into english at least would be nice and the possibility to configure whether leading texts or not. I've translated it in the source for now. Nice plasmoid nevertheless. monk
I could write an how-to to edit text into user's language but for adding a language choise I should add a config window... It's easier to modify it in the source, they're two words ;)
That's right, but may you can spread the sourcw code with english texts for those not able or feared of editing the code. Config options would be fine for font size and background f.e. m0nk
Hi! I would like to try the app, but i don't understand the building instructions. cd /where/your/applet/is/installed
I mean the directory where you extract the package. After this, just compile it following istructions :) What distro do you use?
Thanks! I tried it, like you wrote, but it somehow doesn't work. I thougth, that i may misunderstood something. I'll try it today again. I use Gentoo. Bye!
Try this: - For each user: cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=release ../ OR - For your user: cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --localprefix` -DCMAKE_BUILD_TYPE=release ../ Let me know if this will work
It works fine now! Thank you!