On Wednesday 03 September 2008 06:24:16 Aaron J. Seigo wrote: > On Tuesday 02 September 2008, Rafał Miłecki 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 = KGlobal::locale()->formatTime(m_time, > > m_showSeconds); - tipData.subText = m_date.toString(); > > tipData.image = m_toolTipIcon; > > + > > + QString mainText = m_prettyTimezone + " "; > > + mainText += KGlobal::locale()->formatTime(m_time, m_showSeconds) + > > "<br>"; + mainText += KGlobal::locale()->formatDate(m_date); > > + tipData.mainText = mainText; > > + > > + QString subText; > > + foreach(QString tz, getSelectedTimezones()) { > > + if (tz==currentTimezone()) { > > + continue; > > + } > > + Plasma::DataEngine::Data data = dataEngine("time")->query(tz); > > + subText += "<br><b>" + data["Timezone > > City"].toString().replace("_", " ")+"</b> "; + subText += > > KGlobal::locale()->formatTime(data["Time"].toTime(), m_showSeconds) + ", > > "; + subText += > > KGlobal::locale()->formatDate(data["Date"].toDate()); + } > > + tipData.subText = subText; > > + > > Plasma::ToolTipManager::self()->setToolTipContent(this,tipData); > > } > > this code probably belongs in libplasmaclock so the other clocks can easily > get to it. in fact, i'd suggest having a virtual QString > ClockApplet::toolTipContent() that clocks can override and implement this > feature in ClockApplet itself; that way all clocks can have custom tooltip > content *and* have all timezones shown.
We talked about that yesterday and agreed that Rafael should commit the code already to give it some early testing and then look into moving it into libplasmaclock. -- sebas http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel