yaWP (Yet Another Weather Plasmoid)

Plasma 4 Extensions

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

90
8.6
Description:

Yet Another Weather Plasmoid.
There is nothing wrong with the ones that exist, I just wanted something more colorful.

This plasmoid belongs to other people, it would not be where it is without their help. See the README.

Please help with additional themes and translations, thanks.

For the latest unstable version:
svn co https://yawp.svn.sourceforge.net/svnroot/yawp/trunk yawp

INSTALL NOTES
tar -jxf yawp*
cd yawp*
./install.sh
Last changelog:

7 years ago

0.4.5 (23 Mar 2013)
* Bugfix: Desktop mode is not reusing applet size from last session.
* Bugfix: yaWP crashes in systemtray with KDE 4.10

0.4.4 (17 Mar 2012)
* New desktop painter has been added. Yawp can be configured to use the traditional or the new one for desktop and/or for popup window.
* Panel painter has been rewritten
* Initialization stuff of yawp has been moved to init method, because yawp crashes on KDE 4.8 due to the usage of not initialized components.
* Usage of KMessageBox has been replaced within DlgAddCity, otherwise yawp crashes on KDE 4.8.5 (some earlier versions might be included as well).
Using KMessageBoxes within KConfigDialog (yawp settings dialog) still works as expected.
* Google ION has been removed, because Google does not support this service any longer.
* Updating and fixing translations
* Bugfix: yaWP did not update weatherdata periodically after hibernation - it is working now

0.4.3 (17 Apr 2012)
* Show current RealFeel temperature under current temperature (thanks to Alain Soucy)
* Non-modale city search dialog
* Implementing public slot configChanged() to behave like a standard plasmoid - yaWP can be configured from external programs (e.g.: javascript)
* changing internal handling of extender (KDE 4.8 only) - when plasmoid will be used in desktop mode extender is not used and will be destroyed, when plasmoid is moved to panel a new extender will be created
* little tweaks to horizontal panel layout, adding more spaces between icons
* Ukrainian translation updated (Thanks to Yuri Chornoivan)

0.4.2 (04 Jan 2012)
* Adapting yaWP to KDE 4.8
* ION AccuWeather is showing closer maps for cities of the United States.
* Workaround crashes in city search dialog in KDE >= 4.7.4
* Frech and Slovak trasnlation updated
* Fixes in Wunderground ION
* Fix double translation for Short day names

0.4.1 (03 Dec 2011)
* Add ability to open forecast in browser (if URL is provided by ION)
* ION wunderground is returning a sorted list of cities (airport stations are listed on top of list,
because in general terms this station type contains more weather information than the personal weather station type).
* ION Wunderground is supporting satellite maps as well
* ION accuweather is not using a config-file for satellite image mapping any longer (feature has been added in version 0.4.0
but I think this was a stupid idea). Satellite images will be hard coded mapped to location in ION.
* Translations updated (CZ, FR)
* Several little bug fixes - including geometry issues

0.4.0 (13 Nov 2011)
* Bugfix: text in animation area jumps up or down at start and at the end of animation
* applets painting methods has been extracted and rewritten, for re-use and hopefully the new painting methods are well structured
* yaWP supports externder items (in panel mode only) - extender item interacts with user like desktop mode.
In panel mode:
When user clicks on the applet (but not on the weather forecast icons) the extender pops up.
The behavior of the applet for clicking on the weather forecast icons can be configured in the config dialog on page "Panel"
option "Use interactive weather icons". When this option is checked the weather icon will toggle between day and night
(in case we have weather information for day and night) otherwise the extender will appear.
* Removes old files from cache directory $HOME/.cache/yawp on a regular base.
* The install script install.sh uses more CPU cores if available. Could be override by -j script option.
* Turkish translation (thanks to Hasan Kiran)
* Czech, Slovak and French translation updated
* Changing unit system in config dialog will force auto-update.
* AccuWeather will use a config file for satellite mapping.

0.3.6 (12 Dec 2010)
* Traverse through all locations periodically (optional)
* Page 'Settings' from config-dialog has been redesigned to gain more space
* Fixing update bug in Wunderground Ion.
* Algorithm that is doing the text layout for the details area has been simplified
* Fix API breakage in 4.5.2/4.6

0.3.5 (8 Oct 2010)
* Fix compilation error on KDE 4.5.2
* Patching ions to work with new weather-data-engine, thanks to Raymond Wooninck
* Fixing legal issues (The source code of the standard ions used as the base)
* Ion is checking state of pressure, instead of just coping the data
* Fix issues with sunrise/sunset
* Prefer millimeters of mecrcury to torr on KDE 4.5
* Fix KDE version check - consistently use KDE_IS_VERSION

0.3.4 (7 Jul 2010)
* Fix torr description.
* Fix problems with some ions when yawp runs under ru locale
* Fix compilation error on PCBSD (thanks vvheritagevv) for patch.
* Update translations cs, fr, sk

0.3.3 (12 Jun 2010)

* Added word-wrap for details-property.
* Added new ion for wunderground weather service
* Showing observation time (the time when weather-service-provider has been updated the weather data) on details page, when specific ion supports this feature.
Ion Google, AccuWeather and Wunderground returning observation time, as well.
* Timestamps for sunrise and sunset will be returned in the new timestamp format (when compiling with kde 4.3 and above - timestamps in the standard ions had been changed)
* Google is returning more information of location to show the right flag. User needs to entered a more specific search text to add a new city.
* Timezone management
* Fix compilation problems with gcc 4.5 (thanks to Kai Wasserbäch)
* Translations updated: fr, pl(Maciej Bulik), sk, de, cs
* Added Ukrainian translation (thanks to Yuri Chornoivan)
* Various bugfixes and small improvements

0.3.2
* Added support for KDE 4.4 (including docking in systray)
* Fix text shadow for light themes
* A new Compact panel layout
* Translations updated: cs, fr, ru
* Some small fixes

0.3.1
* Fixed bug in accuweather engine.

0.3.0
* Totally rewritten - Big thanks to udev.
* Plasma weather engines support - accuweather and google engines included
* Multicity support

Issues of 0.3.x:
* KDE 4.4 is not supported yet !
* Translation files needs update.

0.2.3
* Satellite image in tooltip can be dissabled
* Polish translation added - thanks to Maciej Bulik
* Fixed unit conversion functions to be on sync with accuweather.com - Thanks to Maciej Bulik for report.
* Russian, French and Czech translation updated.
* Licence mess cleaned.

0.2.2
* Fix for the icon sizing issue in KDE 4.2.2 and 4.2.67 - thanks to Daniel Rocher
* Solid support for network - thanks to John Stamp
* Panel tooltip redesign, show much more informations now
* Dialog sizing issue fixed
* Removed obsolete KIO workaround
* Translations updated: French, Slovak, Czech and Russian


0.2.1
* Fixed several panel sizing issues
* Custom colors support
* YaWP should be now usable with light themes (like Aya)

0.2
* Panel support
* Many bugfixes and improvements

0.1.65
* With help. Please see DEVELOPERS in README.

0.0.6
* Many attempts ....

udev

9 years ago

Yes I know...but the funny thing is, analog-, binary- and fuzzy-clock is still working :-P so I am expecting to find the extender stuff at some line. But the more interesting question is: Where does Plasma::PopupApplet knows which icon and title needs to be used for the extender item without the following lines:

621 item->setTitle(i18n("Calendar"));
622 item->setIcon("view-pim-calendar");
623 item->setWidget(d->calendarWidget);

I am about to doubt the source code of plasma-clock :-( but I do not have time to recompile plasma-clock to check if the source-code for plasma-clock is working...

Report

udev

9 years ago

I finally found the main bug...I was disabling PopupApplet::timerEvent

I adapted yaWP to KDE 4.8 and committed revision 520 that solves this problem.

Report

mkyral

9 years ago

Great. I'll release a new version evening.

Report

mkyral

9 years ago

And backtrace - hope it will help. If you need more, tell me what to do.

(gdb) bt
#0 0x00007f8bfa2fd393 in __cxxabiv1::__si_class_type_info::__do_dyncast(long, __cxxabiv1::__class_type_info::__sub_kind, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info const*, void const*, __cxxabiv1::__class_type_info::__dyncast_result&) const () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6
#1 0x00007f8bfa2fb1d2 in __dynamic_cast () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6
#2 0x00007f8bfe08cffb in Plasma::ToolTipManager::eventFilter (this=0xf74fc0, watched=0x16e6270, event=0x7fffcb4edbf0) at /var/tmp/portage/kde-base/kdelibs-4.7.95/work/kdelibs-4.7.95/plasma/tooltipmanager.cpp:450
#3 0x00007f8bfb548216 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#4 0x00007f8bfa70ecd1 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#5 0x00007f8bfa71387a in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#6 0x00007f8bfc2380b2 in KApplication::notify (this=0xefdee0, receiver=0x16e6270, event=0x7fffcb4edbf0) at /var/tmp/portage/kde-base/kdelibs-4.7.95/work/kdelibs-4.7.95/kdeui/kernel/kapplication.cpp:311
#7 0x00007f8bfb54809b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#8 0x00007f8bfb57589e in QTimerInfoList::activateTimers() () from /usr/lib64/qt4/libQtCore.so.4
#9 0x00007f8bfb572918 in idleTimerSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib64/qt4/libQtCore.so.4
#10 0x00007f8bf2471072 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#11 0x00007f8bf2471868 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#12 0x00007f8bf2471a41 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#13 0x00007f8bfb572fef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#14 0x00007f8bfa7b43fe in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtGui.so.4
#15 0x00007f8bfb547442 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#16 0x00007f8bfb547684 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#17 0x00007f8bfb54bb0b in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#18 0x00007f8bfe804302 in kdemain (argc=1, argv=0x7fffcb4ee2c8) at /var/tmp/portage/kde-base/plasma-workspace-4.7.95/work/plasma-workspace-4.7.95/plasma/desktop/shell/main.cpp:120
#19 0x00007f8bfe45022d in __libc_start_main () from /lib64/libc.so.6
#20 0x00000000004007a9 in _start ()
(gdb)

Report

udev

9 years ago

I have updated to KDE 4.7.95 (kind of - I still have some 4.7.4 libs, because they do not exists for version 4.7.95)...however KDE seems to run pretty stable...Now I have the same problem opening the extender for yaWP, but extender works for binary and analog-clock. I have using the source code of this applet as example as I implemented the extender item.

source code can be found here:
plasma-clock is the base applet:
https://projects.kde.org/projects/kde/kde-workspace/repository/revisions/master/show/libs/plasmaclock
and binary clock is the derived class, which can be found here:
https://projects.kde.org/projects/kde/kdeplasma-addons/repository/revisions/master/show/applets/binary-clock

Unfortunately, I do not find the extender stuff in the new plasma- and binary clock anymore...We might have to wait for 4.8 final release to see whether it is working or not...especial when you said it was working in beta 2

Report

mkyral

9 years ago

It looks like that extender was removed in analog-clock:

https://projects.kde.org/projects/kde/kde-workspace/repository/diff/libs/plasmaclock?rev=dd083ff455ee2bceb47d4c2bce7cffb5db494d48&rev_to=15662dc9ab5a118b5194b7da09951555ebb5e5fc

Report

mkyral

9 years ago

So problems workarounded, I'm on 4.8 RC1 now (with QT 4.7.4) and I can confirm it. Strace shows this:

poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}, {fd=15, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=13, events=POLLIN}, {fd=21, events=POLLIN}, {fd=20, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}, {fd=29, events=POLLIN}, {fd=28, events=POLLIN}, {fd=31, events=POLLIN}], 17, 0) = 0 (Timeout)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}, {fd=15, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=13, events=POLLIN}, {fd=21, events=POLLIN}, {fd=20, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}, {fd=29, events=POLLIN}, {fd=28, events=POLLIN}, {fd=31, events=POLLIN}], 17, 0) = 0 (Timeout)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}, {fd=15, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=13, events=POLLIN}, {fd=21, events=POLLIN}, {fd=20, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}, {fd=29, events=POLLIN}, {fd=28, events=POLLIN}, {fd=31, events=POLLIN}], 17, 0) = 0 (Timeout)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}, {fd=15, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=13, events=POLLIN}, {fd=21, events=POLLIN}, {fd=20, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}, {fd=29, events=POLLIN}, {fd=28, events=POLLIN}, {fd=31, events=POLLIN}], 17, 0) = 0 (Timeout)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}, {fd=15, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=13, events=POLLIN}, {fd=21, events=POLLIN}, {fd=20, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}, {fd=29, events=POLLIN}, {fd=28, events=POLLIN}, {fd=31, events=POLLIN}], 17, 0) = 0 (Timeout)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}, {fd=15, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=13, events=POLLIN}, {fd=21, events=POLLIN}, {fd=20, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}, {fd=29, events=POLLIN}, {fd=28, events=POLLIN}, {fd=31, events=POLLIN}], 17, 0) = 0 (Timeout)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}, {fd=15, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=13, events=POLLIN}, {fd=21, events=POLLIN}, {fd=20, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}, {fd=29, events=POLLIN}, {fd=28, events=POLLIN}, {fd=31, events=POLLIN}], 17, 0) = 0 (Timeout)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}, {fd=15, events=POLLIN}, {fd=17, events=POLLIN}, {fd=22, events=POLLIN}, {fd=13, events=POLLIN}, {fd=21, events=POLLIN}, {fd=20, events=POLLIN}, {fd=24, events=POLLIN}, {fd=25, events=POLLIN}, {fd=29, events=POLLIN}, {fd=28, events=POLLIN}, {fd=31, events=POLLIN}], 17, 0) = 0 (Timeout)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)
read(7, 0x15146b4, 4096) = -1 EAGAIN (Resource temporarily unavailable)


It worked in Beta2.

Report

also512

9 years ago

I do like very much yaWP. It's my prefered plasma for weather forecast.

I live in a cold country and having the RealFeel temperature beside the real temperature would be a very nice feature !

Thanks

Report

chepioq

9 years ago

The RealFeel Temperature is already in yawp, at page two of info...

Report

also512

9 years ago

I think now that the 'chill factor' would be more appropriate for what I wish !

Accuweather also have 'RealFeel' for the actual temperature, but I cannot get it from their site.

I am now (slowly) working to put the 'ChillFactor' directly under the '0x0B' QChar of the actual temperature.

The display: small font, in red.

Report

udev

9 years ago

When you open AccuWeather-Web-Page through popup-menu from yaWP, then you will see an entry "RealFeel"-temperature :-P

Report

also512

9 years ago

Sure I know that !
but I cannot get the value of 'RealFeel', for the actual temperature,from the yawp code.

Report

udev

9 years ago

In this case, I misunderstood you.
Current real feel temperature, wind gust and wind chill will be passed from AccuWeatherIon to applet and applet will save this values now (in revision r518).

I changed the algorithm in r517 to receive better satellite maps for US as well. Hope this modification does not make the applet instable.

I would like you to send us your changes (you made to the applet) to consider to add your changes to yawp.

Report

udev

9 years ago

Looks good...but on my computer the real feel temperature is being shown a little bit too small.

Therefore I tweaked the alignment of current and real feel temperature and printing real feel temperature as large as high/low temperature (in trunk 535).

Report

chepioq

9 years ago

Thank Marian I test your last trunk revision and that work fine for me.
And if I don't see the real feel temp in my previous post, it's because my background is blue, exactly the same color of fonts...

Report

mkyral

9 years ago

Hi,
looks good, I commited.

I've made only one change - the Red and Blue colours was replaced by the standard YaWP used colours. The blue colour does not look good on blue theme backgroud ;-) Hope it is not problem for you.

Thanks for the patch
Marián

Report

chepioq

9 years ago

Ok, I test with your city and that work...
And this evening, for my city in france (aubagne) that also work...

Report

also512

9 years ago

Hi,

may be it is because when the realfeel and the actual temperature are the same, the realfeel temp. is not showed.


http://pix.toile-libre.org/upload/original/1326375591.png

Report

also512

9 years ago

Hi,

may be it is because when the realfeel and the actual temperature are the same, the realfeel temp. is not showed.


http://pix.toile-libre.org/upload/original/1326375591.png

Report

also512

9 years ago

Hi,

may be it is because when the realfeel and the actual temperature are the same, the realfeel temp. is not showed.


http://pix.toile-libre.org/upload/original/1326375591.png

Report

also512

9 years ago

Hi,

may be it is because when the realfeel and the actual temperature are the same, the realfeel temp. is not showed.


http://pix.toile-libre.org/upload/original/1326375591.png

Report

chepioq

9 years ago

Hi...
with this code, no real feel is displaying...

Report

also512

9 years ago

Hi Chepioq,

the temp (and RealFeel) should be centered with this code:

//TEST // paint current temperature
if (weather->currentTemperature() < SHRT_MAX)
{
painter->save();

font.setPixelSize(40.0f * dScale);
font.setBold(false);
painter->setFont(font);

QRect temperatureRect(
qRound(contentsRect.left() + 170.0f * dScale),
contentsRect.top(),
qRound(100.0f * dScale),
qRound( 45.0f * dScale) );

QString currentTemp = QString::number( weather->currentTemperature() ) + QChar(0xB0);
QRect currentTempBoundingRect = painter->fontMetrics().boundingRect(temperatureRect, Qt::AlignCenter, currentTemp );
QRect degreRect = painter->fontMetrics().boundingRect(QChar(0xB0));
short degreWidth = QFontMetrics(font).width(QChar(0xB0));
short degreHauteur = degreRect.height();

drawText( painter, temperatureRect, Qt::AlignCenter, currentTemp );

if ( weather->currentRealFeelTemperature() < SHRT_MAX ) {

if ( weather->currentRealFeelTemperature() != weather->currentTemperature() ) {

QString realFeelTemp = QString::number( weather->currentRealFeelTemperature() ) + QChar(0xB0) ;
QRect realFeelRect(
currentTempBoundingRect.right() - degreWidth - qRound( font.letterSpacing() ),
qRound(currentTempBoundingRect.top() + degreRect.height() * 2 ),
contentsRect.bottomRight().x() - currentTempBoundingRect.bottomRight().x() + degreWidth,
qRound( (currentTempBoundingRect.bottomRight().y() - degreHauteur) /2.0) );

QColor colorRealFeel = weather->currentRealFeelTemperature() > weather->currentTemperature() ? Qt::red : Qt::blue;

font.setPixelSize(11.0f * dScale);
painter->setFont(font);
painter->setPen(colorRealFeel);
painter->drawText( realFeelRect, Qt::AlignCenter, realFeelTemp );

painter->restore();
}
}
}
//TEST****

Report

chepioq

9 years ago

Hi also512
I test your code, see my screenshot : http://pix.toile-libre.org/upload/original/1324752383.png

That work for me, butI think that the temp (and RealFeel) would be centered, in my screenshot the 5° is near moon's image, and I think it's better if it's slightly further to the right...

Report

also512

9 years ago

Modifications (slight) to the applet:

only in "../trunk/applet/painter/desktoppainter.cpp": replace line 281 to 296 with the following:


//TEST // paint current temperature
QRect temperatureRect;
if (weather->currentTemperature() < SHRT_MAX)
{
font.setPixelSize(40.0f * dScale);
font.setBold(false);
painter->setFont(font);

temperatureRect.setRect(
qRound(contentsRect.left() + 170.0f * dScale),
contentsRect.top(),
qRound(100.0f * dScale),
qRound( 45.0f * dScale) );

QString currentTemp = QString::number( weather->currentTemperature() );
QRect currentTempBoundingRect = painter->fontMetrics().boundingRect(temperatureRect, Qt::AlignLeft, currentTemp );
currentTemp.append( QChar(0xB0) );
painter->drawText( temperatureRect, Qt::AlignLeft, currentTemp );

if ( weather->currentRealFeelTemperature() < SHRT_MAX && weather->currentRealFeelTemperature() != weather->currentTemperature()) {

painter->save();

painter->setPen( QPen( Qt::red, 12, Qt::SolidLine, Qt::RoundCap ));

painter->setOpacity( 1.0 );

font.setPixelSize(10.0f * dScale);
font.setBold(false);
painter->setFont(font);

QString chillTemp = "(" + QString::number( weather->currentRealFeelTemperature()) + QChar(0xB0) + ")";
QRect chillRect(
currentTempBoundingRect.right(),
qRound(currentTempBoundingRect.top() + currentTempBoundingRect.height() / 2.0),
qRound( (contentsRect.width() - currentTempBoundingRect.width()) ),
qRound( (currentTempBoundingRect.height() / 3 ) ) );
painter->drawText( chillRect, Qt::AlignLeft | Qt::AlignVCenter, chillTemp );

painter->restore();
}
}
//TEST****

Report

7 years ago

0.4.5 (23 Mar 2013)
* Bugfix: Desktop mode is not reusing applet size from last session.
* Bugfix: yaWP crashes in systemtray with KDE 4.10

0.4.4 (17 Mar 2012)
* New desktop painter has been added. Yawp can be configured to use the traditional or the new one for desktop and/or for popup window.
* Panel painter has been rewritten
* Initialization stuff of yawp has been moved to init method, because yawp crashes on KDE 4.8 due to the usage of not initialized components.
* Usage of KMessageBox has been replaced within DlgAddCity, otherwise yawp crashes on KDE 4.8.5 (some earlier versions might be included as well).
Using KMessageBoxes within KConfigDialog (yawp settings dialog) still works as expected.
* Google ION has been removed, because Google does not support this service any longer.
* Updating and fixing translations
* Bugfix: yaWP did not update weatherdata periodically after hibernation - it is working now

0.4.3 (17 Apr 2012)
* Show current RealFeel temperature under current temperature (thanks to Alain Soucy)
* Non-modale city search dialog
* Implementing public slot configChanged() to behave like a standard plasmoid - yaWP can be configured from external programs (e.g.: javascript)
* changing internal handling of extender (KDE 4.8 only) - when plasmoid will be used in desktop mode extender is not used and will be destroyed, when plasmoid is moved to panel a new extender will be created
* little tweaks to horizontal panel layout, adding more spaces between icons
* Ukrainian translation updated (Thanks to Yuri Chornoivan)

0.4.2 (04 Jan 2012)
* Adapting yaWP to KDE 4.8
* ION AccuWeather is showing closer maps for cities of the United States.
* Workaround crashes in city search dialog in KDE >= 4.7.4
* Frech and Slovak trasnlation updated
* Fixes in Wunderground ION
* Fix double translation for Short day names

0.4.1 (03 Dec 2011)
* Add ability to open forecast in browser (if URL is provided by ION)
* ION wunderground is returning a sorted list of cities (airport stations are listed on top of list,
because in general terms this station type contains more weather information than the personal weather station type).
* ION Wunderground is supporting satellite maps as well
* ION accuweather is not using a config-file for satellite image mapping any longer (feature has been added in version 0.4.0
but I think this was a stupid idea). Satellite images will be hard coded mapped to location in ION.
* Translations updated (CZ, FR)
* Several little bug fixes - including geometry issues

0.4.0 (13 Nov 2011)
* Bugfix: text in animation area jumps up or down at start and at the end of animation
* applets painting methods has been extracted and rewritten, for re-use and hopefully the new painting methods are well structured
* yaWP supports externder items (in panel mode only) - extender item interacts with user like desktop mode.
In panel mode:
When user clicks on the applet (but not on the weather forecast icons) the extender pops up.
The behavior of the applet for clicking on the weather forecast icons can be configured in the config dialog on page "Panel"
option "Use interactive weather icons". When this option is checked the weather icon will toggle between day and night
(in case we have weather information for day and night) otherwise the extender will appear.
* Removes old files from cache directory $HOME/.cache/yawp on a regular base.
* The install script install.sh uses more CPU cores if available. Could be override by -j script option.
* Turkish translation (thanks to Hasan Kiran)
* Czech, Slovak and French translation updated
* Changing unit system in config dialog will force auto-update.
* AccuWeather will use a config file for satellite mapping.

0.3.6 (12 Dec 2010)
* Traverse through all locations periodically (optional)
* Page 'Settings' from config-dialog has been redesigned to gain more space
* Fixing update bug in Wunderground Ion.
* Algorithm that is doing the text layout for the details area has been simplified
* Fix API breakage in 4.5.2/4.6

0.3.5 (8 Oct 2010)
* Fix compilation error on KDE 4.5.2
* Patching ions to work with new weather-data-engine, thanks to Raymond Wooninck
* Fixing legal issues (The source code of the standard ions used as the base)
* Ion is checking state of pressure, instead of just coping the data
* Fix issues with sunrise/sunset
* Prefer millimeters of mecrcury to torr on KDE 4.5
* Fix KDE version check - consistently use KDE_IS_VERSION

0.3.4 (7 Jul 2010)
* Fix torr description.
* Fix problems with some ions when yawp runs under ru locale
* Fix compilation error on PCBSD (thanks vvheritagevv) for patch.
* Update translations cs, fr, sk

0.3.3 (12 Jun 2010)

* Added word-wrap for details-property.
* Added new ion for wunderground weather service
* Showing observation time (the time when weather-service-provider has been updated the weather data) on details page, when specific ion supports this feature.
Ion Google, AccuWeather and Wunderground returning observation time, as well.
* Timestamps for sunrise and sunset will be returned in the new timestamp format (when compiling with kde 4.3 and above - timestamps in the standard ions had been changed)
* Google is returning more information of location to show the right flag. User needs to entered a more specific search text to add a new city.
* Timezone management
* Fix compilation problems with gcc 4.5 (thanks to Kai Wasserbäch)
* Translations updated: fr, pl(Maciej Bulik), sk, de, cs
* Added Ukrainian translation (thanks to Yuri Chornoivan)
* Various bugfixes and small improvements

0.3.2
* Added support for KDE 4.4 (including docking in systray)
* Fix text shadow for light themes
* A new Compact panel layout
* Translations updated: cs, fr, ru
* Some small fixes

0.3.1
* Fixed bug in accuweather engine.

0.3.0
* Totally rewritten - Big thanks to udev.
* Plasma weather engines support - accuweather and google engines included
* Multicity support

Issues of 0.3.x:
* KDE 4.4 is not supported yet !
* Translation files needs update.

0.2.3
* Satellite image in tooltip can be dissabled
* Polish translation added - thanks to Maciej Bulik
* Fixed unit conversion functions to be on sync with accuweather.com - Thanks to Maciej Bulik for report.
* Russian, French and Czech translation updated.
* Licence mess cleaned.

0.2.2
* Fix for the icon sizing issue in KDE 4.2.2 and 4.2.67 - thanks to Daniel Rocher
* Solid support for network - thanks to John Stamp
* Panel tooltip redesign, show much more informations now
* Dialog sizing issue fixed
* Removed obsolete KIO workaround
* Translations updated: French, Slovak, Czech and Russian


0.2.1
* Fixed several panel sizing issues
* Custom colors support
* YaWP should be now usable with light themes (like Aya)

0.2
* Panel support
* Many bugfixes and improvements

0.1.65
* With help. Please see DEVELOPERS in README.

0.0.6
* Many attempts ....

12345678910
148
product-maker slsimic Aug 23 2015 9 excellent
product-maker K4M1K4Z3 Apr 20 2015 9 excellent
product-maker ArthurTaborda Nov 25 2014 9 excellent
product-maker UnderTheGun May 01 2014 9 excellent
product-maker geoaraujo Nov 06 2013 9 excellent
product-maker narya May 08 2013 9 excellent
product-maker mgroeneweg Apr 25 2013 9 excellent
product-maker unikum111 Apr 21 2013 9 excellent
product-maker AcaciaCo Mar 26 2013 3 bad
product-maker redhatlinux10 Mar 16 2013 9 excellent
product-maker dmeyer Oct 14 2012 9 excellent
product-maker skynet1248 Oct 03 2012 9 excellent
product-maker msx Jul 10 2012 9 excellent
product-maker unIverse Jun 30 2012 9 excellent
product-maker step-2 Jun 18 2012 9 excellent
product-maker anon135 Jun 14 2012 9 excellent
product-maker RAIDENSUB Jun 12 2012 9 excellent
product-maker swiftscythe Apr 15 2012 9 excellent
product-maker JanusDC Mar 26 2012 9 excellent
product-maker kazuspara Feb 28 2012 9 excellent
product-maker maroony Feb 11 2012 9 excellent
product-maker anizio Jan 16 2012 9 excellent
product-maker nowardev Jan 07 2012 9 excellent
product-maker jmattsc Dec 30 2011 9 excellent
product-maker darthroe Dec 19 2011 9 excellent
product-maker SvenArcher Dec 04 2011 9 excellent
product-maker gericom Dec 03 2011 9 excellent
product-maker nikore90 Nov 29 2011 9 excellent
product-maker Pyruzan Nov 28 2011 9 excellent
product-maker pedrolopex5 Nov 26 2011 9 excellent
product-maker Seniazi Nov 24 2011 9 excellent
product-maker pejakm Nov 18 2011 9 excellent
product-maker SeaJey Nov 14 2011 9 excellent
product-maker itsjustarumour2 Nov 13 2011 9 excellent
product-maker dreamsoul Nov 13 2011 9 excellent
product-maker zuargo Sep 17 2011 9 excellent
product-maker ailie Aug 28 2011 9 excellent
product-maker kanone70mm Jul 17 2011 9 excellent
product-maker trebol-a Mar 29 2011 9 excellent
product-maker flanello Feb 27 2011 9 excellent
product-maker mywereld Jan 01 2011 9 excellent
product-maker warlockrf Dec 19 2010 9 excellent
product-maker TommyCZ Dec 14 2010 9 excellent
product-maker LinusTalk Dec 13 2010 9 excellent
product-maker Doofb43r Oct 09 2010 9 excellent
product-maker svah4cky0 Oct 09 2010 9 excellent
product-maker nucleas Oct 08 2010 9 excellent
product-maker Musikolo Oct 08 2010 9 excellent
product-maker zeekec Oct 07 2010 9 excellent
Be the first to comment
Walternate
Apr 01 2016
K4M1K4Z3
Apr 20 2015
ArthurTaborda
Nov 25 2014
DmitryMisharov
May 31 2014
UnderTheGun
May 01 2014
Chuck56
Feb 05 2014
blue-dxca93
May 08 2013
parcox
Feb 20 2013
n-k
Jan 06 2013
unIverse
Jun 30 2012
miawallace
Jun 24 2012
anon135
Jun 14 2012
swiftscythe
Apr 15 2012
kazuspara
Feb 28 2012
maroony
Feb 11 2012
gericom
Dec 03 2011
HATRED
Dec 03 2011
Pyruzan
Nov 28 2011
despot77
Nov 25 2011
SeaJey
Nov 14 2011
marcotangaro
Oct 15 2011
zuargo
Sep 17 2011
tomsdale
Jul 05 2011
jaffermaniar
Apr 23 2011
m00nraker
Mar 22 2011
cruzki
Feb 14 2011
TommyCZ
Dec 14 2010
LinusTalk
Dec 13 2010
physlord
Dec 04 2010
zeekec
Oct 07 2010
fcwells
Sep 14 2010
karoshiboy
Aug 17 2010
eikel
Jul 29 2010
juank202
Jul 07 2010
ladykatlyn
Jul 07 2010
vvheritagevv
Jun 25 2010
soee
Jun 12 2010
adrian7
Apr 29 2010
lciani
Feb 21 2010
Siminin
Feb 01 2010
marlin
Jan 08 2010
KAnton
Jan 02 2010
ze0
Dec 07 2009
nucleas
Dec 04 2009
hteles
Dec 03 2009
pedrolopex5
Nov 30 2009
Xenos
Sep 23 2009
S3Indiana
Aug 10 2009
EinfachToll
Jul 28 2009
c2h5oh
Jun 28 2009
borisdigital
Jun 19 2009
DjNeophyte
May 31 2009
footcow
May 20 2009
dubis
May 15 2009
Gerardo
Apr 29 2009
freemandigger
Apr 23 2009
universe777
Apr 18 2009
onlinelli
Apr 02 2009
Refused
Apr 01 2009
arvidjaar
Mar 30 2009
Montblanc
Mar 27 2009
dvs999
Mar 24 2009
dglent
Mar 19 2009
enzuru
Mar 14 2009
glad
Mar 09 2009
cbg
Mar 07 2009
cfraz89
Mar 06 2009
montoya
Mar 05 2009
kapat
Mar 02 2009
cesorensen
Mar 01 2009
kejpi
Mar 01 2009
intelliboy
Feb 27 2009
pepedopolous
Feb 22 2009
TeeAhr1
Feb 09 2009
goona
Feb 08 2009
mikala
Feb 03 2009
ruans
Jan 29 2009
xadras
Jan 29 2009
devsk
Jan 26 2009
meloman
Jan 25 2009
hash87
Jan 22 2009
scsi
Jan 21 2009
mkyral
Jan 21 2009
ezeaguerre
Jan 21 2009
faldo
Jan 19 2009
painkiller101
Jan 16 2009
watho
Jan 15 2009
buschmann23
Jan 12 2009
jwistead
Jan 07 2009
Emdek
Dec 23 2008
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.4.5
updated Mar 23 2013
added Nov 29 2008
downloads 24h
0
mediaviews 24h 0
pageviews 24h 9