|
|
|
@ -56,6 +56,7 @@
|
|
|
|
|
#include <tqlabel.h>
|
|
|
|
|
#include <tqapplication.h>
|
|
|
|
|
#include <tqdialog.h>
|
|
|
|
|
#include <tqfile.h>
|
|
|
|
|
|
|
|
|
|
#include "devicetraycomponent.h"
|
|
|
|
|
#include "tdenetman-tray.h"
|
|
|
|
@ -857,22 +858,24 @@ void Tray::updateTrayIcon(TDENetworkConnectionStatus::TDENetworkConnectionStatus
|
|
|
|
|
|| (current_vpn_state & TDENetworkGlobalManagerFlags::VPNConfiguringProtocols)
|
|
|
|
|
|| (current_vpn_state & TDENetworkGlobalManagerFlags::VPNVerifyingProtocols)) {
|
|
|
|
|
int frame = -1;
|
|
|
|
|
if (movie())
|
|
|
|
|
if (movie()) {
|
|
|
|
|
frame = movie()->frameNumber();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// set the movie
|
|
|
|
|
if ((current_vpn_state & TDENetworkGlobalManagerFlags::VPNEstablishingLink)
|
|
|
|
|
|| (current_vpn_state & TDENetworkGlobalManagerFlags::VPNNeedAuthorization)) {
|
|
|
|
|
setMovie(TQMovie(KGlobal::iconLoader()->moviePath("nm_stage02_connecting_vpn", KIcon::Panel)));
|
|
|
|
|
setMovie(TQMovie(m_movieCache["nm_stage02_connecting_vpn"]));
|
|
|
|
|
}
|
|
|
|
|
if ((current_vpn_state & TDENetworkGlobalManagerFlags::VPNConfiguringProtocols)
|
|
|
|
|
|| (current_vpn_state & TDENetworkGlobalManagerFlags::VPNVerifyingProtocols)) {
|
|
|
|
|
setMovie(TQMovie(KGlobal::iconLoader()->moviePath("nm_stage03_connecting_vpn", KIcon::Panel)));
|
|
|
|
|
setMovie(TQMovie(m_movieCache["nm_stage03_connecting_vpn"]));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// start at the same frame as the movie before
|
|
|
|
|
if (frame > 0)
|
|
|
|
|
if (frame > 0) {
|
|
|
|
|
movie()->step(frame);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// start the animation
|
|
|
|
|
movie()->unpause();
|
|
|
|
@ -985,6 +988,21 @@ TQMovie Tray::movieForName(TQString moviePath)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQByteArray Tray::movieFileData(TQString movieName) {
|
|
|
|
|
TQByteArray ret;
|
|
|
|
|
TQString fileName = KGlobal::iconLoader()->moviePath(movieName, KIcon::Panel, width());
|
|
|
|
|
if (fileName != "") {
|
|
|
|
|
TQFile file(fileName);
|
|
|
|
|
if (file.exists()) {
|
|
|
|
|
if (file.open(IO_ReadOnly)) {
|
|
|
|
|
ret = file.readAll();
|
|
|
|
|
file.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Tray::updateGraphicsCache() {
|
|
|
|
|
m_pixmapCache["tdenetworkmanager"] = pixmapForName("tdenetworkmanager");
|
|
|
|
|
m_pixmapCache["tdenetworkmanager_disabled"] = pixmapForName("tdenetworkmanager_disabled");
|
|
|
|
@ -997,12 +1015,15 @@ void Tray::updateGraphicsCache() {
|
|
|
|
|
m_pixmapCache["nm_signal_75"] = pixmapForName("nm_signal_75");
|
|
|
|
|
m_pixmapCache["nm_signal_100"] = pixmapForName("nm_signal_100");
|
|
|
|
|
|
|
|
|
|
// FIXME
|
|
|
|
|
// TQMovie objects are explicitly shared
|
|
|
|
|
// A cache cannot be implemented until these objects support deep copy!
|
|
|
|
|
// m_movieCache["nm_stage01_connecting"] = movieForName("nm_stage01_connecting");
|
|
|
|
|
// m_movieCache["nm_stage02_connecting"] = movieForName("nm_stage02_connecting");
|
|
|
|
|
// m_movieCache["nm_stage03_connecting"] = movieForName("nm_stage03_connecting");
|
|
|
|
|
m_movieCache["nm_stage01_connecting"] = movieFileData("nm_stage01_connecting");
|
|
|
|
|
m_movieCache["nm_stage02_connecting"] = movieFileData("nm_stage02_connecting");
|
|
|
|
|
m_movieCache["nm_stage03_connecting"] = movieFileData("nm_stage03_connecting");
|
|
|
|
|
m_movieCache["nm_stage02_connecting_vpn"] = movieFileData("nm_stage02_connecting_vpn");
|
|
|
|
|
m_movieCache["nm_stage03_connecting_vpn"] = movieFileData("nm_stage03_connecting_vpn");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Tray::resizeEvent(TQResizeEvent *) {
|
|
|
|
|
updateGraphicsCache();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Tray::Tray() : KSystemTray()
|
|
|
|
|