--===============2092271299== Content-Type: multipart/signed; boundary="nextPart3334139.OXxPjVrX0G"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart3334139.OXxPjVrX0G Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 02 September 2008, Rafa=C5=82 Mi=C5=82ecki wrote: > SVN commit 856465 by rmilecki: > > Let's make tooltip display time and date of every selected timezone. cool ... > M +18 -2 digital-clock/clock.cpp > M +5 -0 libplasmaclock/clockapplet.cpp > M +1 -0 libplasmaclock/clockapplet.h > > > --- trunk/KDE/kdebase/workspace/plasma/applets/digital-clock/clock.cpp > #856464:856465 @@ -135,9 +135,25 @@ > void Clock::updateToolTipContent() > { > Plasma::ToolTipManager::ToolTipContent tipData; > - tipData.mainText =3D KGlobal::locale()->formatTime(m_time, > m_showSeconds); - tipData.subText =3D m_date.toString(); > tipData.image =3D m_toolTipIcon; > + > + QString mainText =3D m_prettyTimezone + " "; > + mainText +=3D KGlobal::locale()->formatTime(m_time, m_showSeconds) + > "
"; + mainText +=3D KGlobal::locale()->formatDate(m_date); > + tipData.mainText =3D mainText; > + > + QString subText; > + foreach(QString tz, getSelectedTimezones()) { > + if (tz=3D=3DcurrentTimezone()) { > + continue; > + } > + Plasma::DataEngine::Data data =3D dataEngine("time")->query(tz); > + subText +=3D "
" + data["Timezone > City"].toString().replace("_", " ")+" "; + subText +=3D > KGlobal::locale()->formatTime(data["Time"].toTime(), m_showSeconds) + ", = "; > + subText +=3D KGlobal::locale()->formatDate(data["Date"].toDate()= ); + > } > + tipData.subText =3D subText; > + > Plasma::ToolTipManager::self()->setToolTipContent(this,tipData); > } this code probably belongs in libplasmaclock so the other clocks can easily= =20 get to it. in fact, i'd suggest having a virtual QString=20 ClockApplet::toolTipContent() that clocks can override and implement this=20 feature in ClockApplet itself; that way all clocks can have custom tooltip= =20 content *and* have all timezones shown. also, though it's a lesser issue, please take care with whitespace ...=20 "foreach(" should be "foreach (" and there should always be spaces around=20 operators such as + ... > --- > trunk/KDE/kdebase/workspace/plasma/applets/libplasmaclock/clockapplet.cpp > #856464:856465 @@ -295,6 +295,11 @@ > return d->timezone; > } > > +QStringList ClockApplet::getSelectedTimezones() const > +{ > + return d->selectedTimezones; > +} > + this sould just be selectedTimezones, without the "get" prefix =2D-=20 Aaron J. Seigo humru othro a kohnu se GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43 KDE core developer sponsored by Trolltech --nextPart3334139.OXxPjVrX0G Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEABECAAYFAki+EXYACgkQ1rcusafx20MNsQCeLkv236lkp5NUyUCoP1JoXHU4 ixwAnRTDrTJOSyhlHfRANzT421YzRBks =/LBT -----END PGP SIGNATURE----- --nextPart3334139.OXxPjVrX0G-- --===============2092271299== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel --===============2092271299==--