On Monday 25 August 2008, Tobias Koenig wrote: > SVN commit 852244 by tokoe: > > Listen to Solid for network status changes and reload comic > if network becomes available. > > > M +1 -1 CMakeLists.txt > M +13 -1 comic.cpp > M +2 -0 comic.h > > > --- trunk/KDE/kdeplasma-addons/applets/comic/CMakeLists.txt #852243:852244 > @@ -5,7 +5,7 @@ > configwidget.cpp) > > kde4_add_plugin(plasma_applet_comic ${comic_SRCS}) > -target_link_libraries(plasma_applet_comic ${KDE4_KDEUI_LIBS} > ${PLASMA_LIBS} ${KDE4_KIO_LIBS}) +target_link_libraries(plasma_applet_comic > ${KDE4_KDEUI_LIBS} ${PLASMA_LIBS} ${KDE4_SOLID_LIBS} ${KDE4_KIO_LIBS}) > > install(TARGETS plasma_applet_comic DESTINATION ${PLUGIN_INSTALL_DIR}) > install(FILES plasma-comic-default.desktop DESTINATION > ${SERVICES_INSTALL_DIR}) --- > trunk/KDE/kdeplasma-addons/applets/comic/comic.cpp #852243:852244 @@ -48,7 > +48,13 @@ > { > loadConfig(); > > - updateComic(); > + Solid::Networking::Status status = Solid::Networking::status(); > + if ( status == Solid::Networking::Connected || status == > Solid::Networking::Unknown ) + updateComic(); > + > + connect( Solid::Networking::notifier(), SIGNAL( statusChanged( > Solid::Networking::Status ) ), + this, SLOT( > networkStatusChanged( Solid::Networking::Status ) ) ); + > updateButtons(); > } > > @@ -98,6 +104,12 @@ > updateComic(); > } > > +void ComicApplet::networkStatusChanged( Solid::Networking::Status status ) > +{ > + if ( status == Solid::Networking::Connected ) > + updateComic(); > +} > + > void ComicApplet::loadConfig() > { > KConfigGroup cg = config(); > --- trunk/KDE/kdeplasma-addons/applets/comic/comic.h #852243:852244 > @@ -27,6 +27,7 @@ > > #include <plasma/applet.h> > #include <plasma/dataengine.h> > +#include <solid/networking.h> > > class ConfigWidget; > > @@ -49,6 +50,7 @@ > void slotNextDay(); > void slotPreviousDay(); > void applyConfig(); > + void networkStatusChanged( Solid::Networking::Status );
this should be something we offer with plasma so that applets don't have to do what Tobias just did; for Tobias it's a no-brainer quicky but for many widget writers it won't be. it's like the power convseration thing ... something to consider in another Applet design iteration down the road. -- 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
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