|
|
@ -37,7 +37,7 @@ class WirelessDialog;
|
|
|
|
#include <tqstyle.h>
|
|
|
|
#include <tqstyle.h>
|
|
|
|
#include <tqtimer.h>
|
|
|
|
#include <tqtimer.h>
|
|
|
|
|
|
|
|
|
|
|
|
// KDE includes
|
|
|
|
// TDE includes
|
|
|
|
#include <dcopclient.h>
|
|
|
|
#include <dcopclient.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kdialogbase.h>
|
|
|
|
#include <kdialogbase.h>
|
|
|
@ -52,15 +52,14 @@ class WirelessDialog;
|
|
|
|
#include <kconfig.h>
|
|
|
|
#include <kconfig.h>
|
|
|
|
#include <kmessagebox.h>
|
|
|
|
#include <kmessagebox.h>
|
|
|
|
#include <kglobalsettings.h>
|
|
|
|
#include <kglobalsettings.h>
|
|
|
|
|
|
|
|
#include <tdehardwaredevices.h>
|
|
|
|
|
|
|
|
#include <tdenetworkconnections.h>
|
|
|
|
|
|
|
|
|
|
|
|
// KNM includes
|
|
|
|
// KNM includes
|
|
|
|
#include "knetworkmanager-device_tray.h"
|
|
|
|
#include "knetworkmanager-device_tray.h"
|
|
|
|
#include "knetworkmanager-device.h"
|
|
|
|
|
|
|
|
#include "knetworkmanager-menu_subhead.h"
|
|
|
|
#include "knetworkmanager-menu_subhead.h"
|
|
|
|
#include "knetworkmanager-connection_settings_dialog.h"
|
|
|
|
#include "knetworkmanager-connection_settings_dialog.h"
|
|
|
|
#include "knetworkmanager-connection_setting_info.h"
|
|
|
|
#include "knetworkmanager-connection_setting_info.h"
|
|
|
|
#include "knetworkmanager-nm_proxy.h"
|
|
|
|
|
|
|
|
#include "knetworkmanager-connection.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using namespace ConnectionSettings;
|
|
|
|
using namespace ConnectionSettings;
|
|
|
|
|
|
|
|
|
|
|
@ -71,38 +70,84 @@ class DeviceTrayPrivate
|
|
|
|
DeviceTrayPrivate()
|
|
|
|
DeviceTrayPrivate()
|
|
|
|
: dev(NULL)
|
|
|
|
: dev(NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tooltips[NM_DEVICE_STATE_UNKNOWN] = i18n("Unknown");
|
|
|
|
tooltips[TDENetworkConnectionStatus::Invalid] = i18n("Unknown");
|
|
|
|
tooltips[NM_DEVICE_STATE_UNAVAILABLE] = i18n("Down");
|
|
|
|
tooltips[TDENetworkConnectionStatus::LinkUnavailable] = i18n("Down");
|
|
|
|
tooltips[NM_DEVICE_STATE_UNMANAGED] = i18n("Unmanaged");
|
|
|
|
tooltips[TDENetworkConnectionStatus::UnManaged] = i18n("Unmanaged");
|
|
|
|
tooltips[NM_DEVICE_STATE_DISCONNECTED] = i18n("Disconnected");
|
|
|
|
tooltips[TDENetworkConnectionStatus::Disconnected] = i18n("Disconnected");
|
|
|
|
tooltips[NM_DEVICE_STATE_PREPARE] = i18n("Preparing");
|
|
|
|
tooltips[TDENetworkConnectionStatus::EstablishingLink] = i18n("Preparing");
|
|
|
|
tooltips[NM_DEVICE_STATE_CONFIG] = i18n("Configuration");
|
|
|
|
tooltips[TDENetworkConnectionStatus::ConfiguringProtocols] = i18n("Configuration");
|
|
|
|
tooltips[NM_DEVICE_STATE_NEED_AUTH] = i18n("Awaiting authentication");
|
|
|
|
tooltips[TDENetworkConnectionStatus::NeedAuthorization] = i18n("Awaiting authentication");
|
|
|
|
tooltips[NM_DEVICE_STATE_IP_CONFIG] = i18n("IP configuration");
|
|
|
|
tooltips[TDENetworkConnectionStatus::VerifyingProtocols] = i18n("IP configuration");
|
|
|
|
tooltips[NM_DEVICE_STATE_ACTIVATED] = i18n("Activated");
|
|
|
|
tooltips[TDENetworkConnectionStatus::Connected] = i18n("Activated");
|
|
|
|
tooltips[NM_DEVICE_STATE_FAILED] = i18n("Failed");
|
|
|
|
tooltips[TDENetworkConnectionStatus::Failed] = i18n("Failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
~DeviceTrayPrivate() {}
|
|
|
|
~DeviceTrayPrivate() {}
|
|
|
|
|
|
|
|
|
|
|
|
Device* dev;
|
|
|
|
TDENetworkDevice* dev;
|
|
|
|
TQMap<NMDeviceState, TQMovie> movies;
|
|
|
|
TQMap<TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQMovie> movies;
|
|
|
|
TQMap<NMDeviceState, TQPixmap> pixmaps;
|
|
|
|
TQMap<TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQPixmap> pixmaps;
|
|
|
|
TQMap<NMDeviceState, TQString> tooltips;
|
|
|
|
TQMap<TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString> tooltips;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQPixmap pixmapForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state);
|
|
|
|
|
|
|
|
TQMovie movieForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state);
|
|
|
|
|
|
|
|
TQString tooltipForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Device* DeviceTray::getDevice() const
|
|
|
|
TQPixmap DeviceTrayPrivate::pixmapForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) {
|
|
|
|
|
|
|
|
TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)0x80000000;
|
|
|
|
|
|
|
|
while (flag > 0) {
|
|
|
|
|
|
|
|
if (state & flag) {
|
|
|
|
|
|
|
|
if (pixmaps.contains(flag)) {
|
|
|
|
|
|
|
|
return pixmaps[flag];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)(flag >> 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return TQPixmap();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQMovie DeviceTrayPrivate::movieForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) {
|
|
|
|
|
|
|
|
TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)0x80000000;
|
|
|
|
|
|
|
|
while (flag > 0) {
|
|
|
|
|
|
|
|
if (state & flag) {
|
|
|
|
|
|
|
|
if (movies.contains(flag)) {
|
|
|
|
|
|
|
|
return movies[flag];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)(flag >> 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return TQMovie();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString DeviceTrayPrivate::tooltipForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) {
|
|
|
|
|
|
|
|
TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)0x80000000;
|
|
|
|
|
|
|
|
while (flag > 0) {
|
|
|
|
|
|
|
|
if (state & flag) {
|
|
|
|
|
|
|
|
if (tooltips.contains(flag)) {
|
|
|
|
|
|
|
|
return tooltips[flag];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)(flag >> 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return TQString::null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TDENetworkDevice* DeviceTray::getDevice() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return d->dev;
|
|
|
|
return d->dev;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString DeviceTray::getTooltipText()
|
|
|
|
TQString DeviceTray::getTooltipText()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NMDeviceState state = d->dev->getState();
|
|
|
|
|
|
|
|
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = d->dev->connectionManager();
|
|
|
|
|
|
|
|
TDENetworkConnectionStatus::TDENetworkConnectionStatus state = deviceConnMan->deviceInformation().statusFlags;
|
|
|
|
TQString tooltip = TQString();
|
|
|
|
TQString tooltip = TQString();
|
|
|
|
|
|
|
|
|
|
|
|
if (!d->tooltips[state].isEmpty())
|
|
|
|
if (!d->tooltipForConnState(state).isEmpty()) {
|
|
|
|
tooltip += i18n("State: %1").arg(d->tooltips[state]);
|
|
|
|
tooltip += i18n("State: %1").arg(d->tooltipForConnState(state));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return tooltip;
|
|
|
|
return tooltip;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -113,8 +158,9 @@ void DeviceTray::enterEvent (TQEvent* /*e*/)
|
|
|
|
TQToolTip::remove (this);
|
|
|
|
TQToolTip::remove (this);
|
|
|
|
TQString tooltip = getTooltipText();
|
|
|
|
TQString tooltip = getTooltipText();
|
|
|
|
|
|
|
|
|
|
|
|
if (!tooltip.isEmpty())
|
|
|
|
if (!tooltip.isEmpty()) {
|
|
|
|
TQToolTip::add (this, tooltip);
|
|
|
|
TQToolTip::add (this, tooltip);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -183,8 +229,9 @@ void DeviceTray::contextMenuAboutToShow (KPopupMenu* menu)
|
|
|
|
// quit
|
|
|
|
// quit
|
|
|
|
menu->insertSeparator ();
|
|
|
|
menu->insertSeparator ();
|
|
|
|
KAction* quitAction = actionCollection ()->action (KStdAction::name (KStdAction::Quit));
|
|
|
|
KAction* quitAction = actionCollection ()->action (KStdAction::name (KStdAction::Quit));
|
|
|
|
if (quitAction)
|
|
|
|
if (quitAction) {
|
|
|
|
quitAction->plug (menu);
|
|
|
|
quitAction->plug (menu);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceTray::resizeEvent ( TQResizeEvent * )
|
|
|
|
void DeviceTray::resizeEvent ( TQResizeEvent * )
|
|
|
@ -194,26 +241,26 @@ void DeviceTray::resizeEvent ( TQResizeEvent * )
|
|
|
|
updateTrayIcon(m_currentIconState);
|
|
|
|
updateTrayIcon(m_currentIconState);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceTray::setPixmapForState(NMDeviceState state, TQMovie movie)
|
|
|
|
void DeviceTray::setPixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state, TQMovie movie)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->movies[state] = movie;
|
|
|
|
d->movies[state] = movie;
|
|
|
|
slotUpdateDeviceState();
|
|
|
|
slotUpdateDeviceState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceTray::setPixmapForState(NMDeviceState state, TQPixmap pixmap)
|
|
|
|
void DeviceTray::setPixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state, TQPixmap pixmap)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->pixmaps[state] = pixmap;
|
|
|
|
d->pixmaps[state] = pixmap;
|
|
|
|
slotUpdateDeviceState();
|
|
|
|
slotUpdateDeviceState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceTray::updateTrayIcon(NMDeviceState state)
|
|
|
|
void DeviceTray::updateTrayIcon(TDENetworkConnectionStatus::TDENetworkConnectionStatus state)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// stop the old movie to avoid unnecessary wakups
|
|
|
|
// stop the old movie to avoid unnecessary wakups
|
|
|
|
if (movie())
|
|
|
|
if (movie()) {
|
|
|
|
movie()->pause();
|
|
|
|
movie()->pause();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (d->movies.find(state) != d->movies.end() && !d->movies[state].isNull())
|
|
|
|
if (!d->movieForConnState(state).isNull()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
if (m_currentIconState != state) {
|
|
|
|
if (m_currentIconState != state) {
|
|
|
|
// Clear the icon pixmap as the movie may be a different size
|
|
|
|
// Clear the icon pixmap as the movie may be a different size
|
|
|
|
TQPixmap nullPixmap;
|
|
|
|
TQPixmap nullPixmap;
|
|
|
@ -222,11 +269,12 @@ void DeviceTray::updateTrayIcon(NMDeviceState state)
|
|
|
|
|
|
|
|
|
|
|
|
// animation desired
|
|
|
|
// animation desired
|
|
|
|
int frame = -1;
|
|
|
|
int frame = -1;
|
|
|
|
if (movie())
|
|
|
|
if (movie()) {
|
|
|
|
frame = movie()->frameNumber();
|
|
|
|
frame = movie()->frameNumber();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// set the movie
|
|
|
|
// set the movie
|
|
|
|
setMovie(d->movies[state]);
|
|
|
|
setMovie(d->movieForConnState(state));
|
|
|
|
|
|
|
|
|
|
|
|
// start at the same frame as the movie before
|
|
|
|
// start at the same frame as the movie before
|
|
|
|
if (frame > 0)
|
|
|
|
if (frame > 0)
|
|
|
@ -235,42 +283,36 @@ void DeviceTray::updateTrayIcon(NMDeviceState state)
|
|
|
|
// start the animation
|
|
|
|
// start the animation
|
|
|
|
movie()->unpause();
|
|
|
|
movie()->unpause();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (d->pixmaps.find(state) != d->pixmaps.end() && !d->pixmaps[state].isNull())
|
|
|
|
else if (!d->pixmapForConnState(state).isNull()) {
|
|
|
|
setPixmap(d->pixmaps[state]);
|
|
|
|
setPixmap(d->pixmapForConnState(state));
|
|
|
|
else
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
setPixmap(loadSizedIcon("KNetworkManager", width()));
|
|
|
|
setPixmap(loadSizedIcon("KNetworkManager", width()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_currentIconState = state;
|
|
|
|
m_currentIconState = state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceTray::updateActions(NMDeviceState state)
|
|
|
|
void DeviceTray::updateActions(TDENetworkConnectionStatus::TDENetworkConnectionStatus state)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// allow device deactivation only when device is activated
|
|
|
|
// allow device deactivation only when device is activated
|
|
|
|
KAction* deactivate = actionCollection()->action("deactivate_device");
|
|
|
|
KAction* deactivate = actionCollection()->action("deactivate_device");
|
|
|
|
if (deactivate)
|
|
|
|
if (deactivate)
|
|
|
|
deactivate->setEnabled( (state == NM_DEVICE_STATE_ACTIVATED ||
|
|
|
|
deactivate->setEnabled( (state & TDENetworkConnectionStatus::Connected ||
|
|
|
|
state == NM_DEVICE_STATE_IP_CONFIG ||
|
|
|
|
state & TDENetworkConnectionStatus::VerifyingProtocols ||
|
|
|
|
state == NM_DEVICE_STATE_PREPARE ||
|
|
|
|
state & TDENetworkConnectionStatus::EstablishingLink ||
|
|
|
|
state == NM_DEVICE_STATE_CONFIG ||
|
|
|
|
state & TDENetworkConnectionStatus::ConfiguringProtocols ||
|
|
|
|
state == NM_DEVICE_STATE_NEED_AUTH) );
|
|
|
|
state & TDENetworkConnectionStatus::NeedAuthorization) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceTray::updateActiveConnection(NMDeviceState state)
|
|
|
|
void DeviceTray::updateActiveConnection(TDENetworkConnectionStatus::TDENetworkConnectionStatus state)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (state != NM_DEVICE_STATE_ACTIVATED)
|
|
|
|
if (!(state & TDENetworkConnectionStatus::Connected)) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
NMProxy* nm = NMProxy::getInstance();
|
|
|
|
|
|
|
|
Connection* active_conn = nm->getActiveConnection(d->dev);
|
|
|
|
|
|
|
|
if (active_conn)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Info* info = dynamic_cast<Info*>(active_conn->getSetting(NM_SETTING_CONNECTION_SETTING_NAME));
|
|
|
|
|
|
|
|
if (info)
|
|
|
|
|
|
|
|
info->setTimestamp(TQDateTime::currentDateTime());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceTray::slotUpdateDeviceState(NMDeviceState state)
|
|
|
|
void DeviceTray::slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
updateTrayIcon(state);
|
|
|
|
updateTrayIcon(state);
|
|
|
|
updateActions(state);
|
|
|
|
updateActions(state);
|
|
|
@ -279,42 +321,43 @@ void DeviceTray::slotUpdateDeviceState(NMDeviceState state)
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceTray::slotUpdateDeviceState()
|
|
|
|
void DeviceTray::slotUpdateDeviceState()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
slotUpdateDeviceState(d->dev->getState());
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = d->dev->connectionManager();
|
|
|
|
|
|
|
|
slotUpdateDeviceState(deviceConnMan->deviceInformation().statusFlags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeviceTray::loadIcons() {
|
|
|
|
void DeviceTray::loadIcons() {
|
|
|
|
d->pixmaps[NM_DEVICE_STATE_UNKNOWN] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
d->pixmaps[TDENetworkConnectionStatus::Invalid] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
d->pixmaps[NM_DEVICE_STATE_UNMANAGED] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
d->pixmaps[TDENetworkConnectionStatus::UnManaged] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
d->pixmaps[NM_DEVICE_STATE_UNAVAILABLE] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
d->pixmaps[TDENetworkConnectionStatus::LinkUnavailable] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
d->pixmaps[NM_DEVICE_STATE_DISCONNECTED] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
d->pixmaps[TDENetworkConnectionStatus::Disconnected] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
|
|
|
|
|
|
|
|
d->movies[NM_DEVICE_STATE_PREPARE] = TQMovie( KGlobal::iconLoader()->moviePath("nm_stage01_connecting", KIcon::Panel));
|
|
|
|
d->movies[TDENetworkConnectionStatus::EstablishingLink] = TQMovie( KGlobal::iconLoader()->moviePath("nm_stage01_connecting", KIcon::Panel));
|
|
|
|
d->movies[NM_DEVICE_STATE_PREPARE].pause();
|
|
|
|
d->movies[TDENetworkConnectionStatus::EstablishingLink].pause();
|
|
|
|
|
|
|
|
|
|
|
|
d->movies[NM_DEVICE_STATE_CONFIG] = TQMovie( KGlobal::iconLoader()->moviePath("nm_stage02_connecting", KIcon::Panel));
|
|
|
|
d->movies[TDENetworkConnectionStatus::ConfiguringProtocols] = TQMovie( KGlobal::iconLoader()->moviePath("nm_stage02_connecting", KIcon::Panel));
|
|
|
|
d->movies[NM_DEVICE_STATE_CONFIG].pause();
|
|
|
|
d->movies[TDENetworkConnectionStatus::ConfiguringProtocols].pause();
|
|
|
|
|
|
|
|
|
|
|
|
d->movies[NM_DEVICE_STATE_IP_CONFIG] = TQMovie( KGlobal::iconLoader()->moviePath("nm_stage03_connecting", KIcon::Panel));
|
|
|
|
d->movies[TDENetworkConnectionStatus::VerifyingProtocols] = TQMovie( KGlobal::iconLoader()->moviePath("nm_stage03_connecting", KIcon::Panel));
|
|
|
|
d->movies[NM_DEVICE_STATE_IP_CONFIG].pause();
|
|
|
|
d->movies[TDENetworkConnectionStatus::VerifyingProtocols].pause();
|
|
|
|
|
|
|
|
|
|
|
|
d->movies[NM_DEVICE_STATE_NEED_AUTH] = d->movies[NM_DEVICE_STATE_CONFIG];
|
|
|
|
d->movies[TDENetworkConnectionStatus::NeedAuthorization] = d->movies[TDENetworkConnectionStatus::ConfiguringProtocols];
|
|
|
|
d->movies[NM_DEVICE_STATE_NEED_AUTH].pause();
|
|
|
|
d->movies[TDENetworkConnectionStatus::NeedAuthorization].pause();
|
|
|
|
|
|
|
|
|
|
|
|
d->pixmaps[NM_DEVICE_STATE_ACTIVATED] = loadSizedIcon("ok", width());
|
|
|
|
d->pixmaps[TDENetworkConnectionStatus::Connected] = loadSizedIcon("ok", width());
|
|
|
|
|
|
|
|
|
|
|
|
d->pixmaps[NM_DEVICE_STATE_FAILED] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
d->pixmaps[TDENetworkConnectionStatus::Failed] = loadSizedIcon("nm_no_connection", width());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DeviceTray::DeviceTray (Device* dev) : KSystemTray ()
|
|
|
|
DeviceTray::DeviceTray (TDENetworkDevice* dev) : KSystemTray ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d = new DeviceTrayPrivate();
|
|
|
|
d = new DeviceTrayPrivate();
|
|
|
|
d->dev = dev;
|
|
|
|
d->dev = dev;
|
|
|
|
|
|
|
|
|
|
|
|
m_currentIconState = NM_DEVICE_STATE_UNKNOWN;
|
|
|
|
m_currentIconState = TDENetworkConnectionStatus::Invalid;
|
|
|
|
loadIcons();
|
|
|
|
loadIcons();
|
|
|
|
|
|
|
|
|
|
|
|
// get notified when the device state changes
|
|
|
|
// get notified when the device state changes
|
|
|
|
connect(dev, TQT_SIGNAL(StateChanged(NMDeviceState)), this, TQT_SLOT(slotUpdateDeviceState(NMDeviceState)));
|
|
|
|
connect(dev, TQT_SIGNAL(StateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus)), this, TQT_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus)));
|
|
|
|
|
|
|
|
|
|
|
|
setMouseTracking (true);
|
|
|
|
setMouseTracking (true);
|
|
|
|
|
|
|
|
|
|
|
|