|
|
|
@ -128,8 +128,8 @@ void NewSecretsDialog::init()
|
|
|
|
|
mainLayout->addWidget(label);
|
|
|
|
|
mainLayout->addLayout(topLeftLayout);
|
|
|
|
|
|
|
|
|
|
connect(buttonEdit, TQT_SIGNAL(clicked()), TQT_SLOT(slotDialogEdit()));
|
|
|
|
|
connect(buttonCancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(close()));
|
|
|
|
|
connect(buttonEdit, TQ_SIGNAL(clicked()), TQ_SLOT(slotDialogEdit()));
|
|
|
|
|
connect(buttonCancel, TQ_SIGNAL(clicked()), this, TQ_SLOT(close()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class TrayPrivate
|
|
|
|
@ -276,7 +276,7 @@ void Tray::contextMenuAboutToShow (TDEPopupMenu* menu)
|
|
|
|
|
deviceNewConnAction = actionCollection ()->action (actionName.utf8());
|
|
|
|
|
if (!deviceNewConnAction)
|
|
|
|
|
{
|
|
|
|
|
deviceNewConnAction = new TDEAction (menuCaption, 0, (*it), TQT_SLOT(newConnection()), actionCollection(), actionName.utf8());
|
|
|
|
|
deviceNewConnAction = new TDEAction (menuCaption, 0, (*it), TQ_SLOT(newConnection()), actionCollection(), actionName.utf8());
|
|
|
|
|
}
|
|
|
|
|
newConnActionMenu->insert(deviceNewConnAction);
|
|
|
|
|
}
|
|
|
|
@ -287,14 +287,14 @@ void Tray::contextMenuAboutToShow (TDEPopupMenu* menu)
|
|
|
|
|
TDEAction * deviceNewConnAction = 0;
|
|
|
|
|
TQString menuCaption = "VPN Connection";
|
|
|
|
|
TQString actionName = TQString("new_connection_%1").arg("vpn");
|
|
|
|
|
deviceNewConnAction = new TDEAction (menuCaption, 0, this, TQT_SLOT(slotNewVPNConnection()), actionCollection(), actionName.utf8());
|
|
|
|
|
deviceNewConnAction = new TDEAction (menuCaption, 0, this, TQ_SLOT(slotNewVPNConnection()), actionCollection(), actionName.utf8());
|
|
|
|
|
newConnActionMenu->insert(deviceNewConnAction);
|
|
|
|
|
}
|
|
|
|
|
else if ( devices == 1 )
|
|
|
|
|
{
|
|
|
|
|
newConnAction = actionCollection ()->action ("new_connection");
|
|
|
|
|
TQObject::disconnect( newConnAction, TQT_SIGNAL(activated()) );
|
|
|
|
|
TQObject::connect( newConnAction, TQT_SIGNAL(activated()), d->trayComponents[0], TQT_SLOT(newConnection()));
|
|
|
|
|
TQObject::disconnect( newConnAction, TQ_SIGNAL(activated()) );
|
|
|
|
|
TQObject::connect( newConnAction, TQ_SIGNAL(activated()), d->trayComponents[0], TQ_SLOT(newConnection()));
|
|
|
|
|
}
|
|
|
|
|
if (newConnAction) {
|
|
|
|
|
newConnAction->plug(menu);
|
|
|
|
@ -326,7 +326,7 @@ void Tray::contextMenuAboutToShow (TDEPopupMenu* menu)
|
|
|
|
|
TQString actionText = conn->friendlyName;
|
|
|
|
|
|
|
|
|
|
if (!deviceNewConnAction) {
|
|
|
|
|
deviceNewConnAction = new TDEAction (actionText, 0, &d->signalMapper, TQT_SLOT(map()), actionCollection(), actionName.utf8());
|
|
|
|
|
deviceNewConnAction = new TDEAction (actionText, 0, &d->signalMapper, TQ_SLOT(map()), actionCollection(), actionName.utf8());
|
|
|
|
|
}
|
|
|
|
|
d->signalMapper.setMapping(deviceNewConnAction, d->current_idx);
|
|
|
|
|
d->act_conn_map.insert(d->current_idx, conn->UUID);
|
|
|
|
@ -524,8 +524,8 @@ void Tray::createDeviceTrayComponent(TQString dev)
|
|
|
|
|
}
|
|
|
|
|
if(devTray)
|
|
|
|
|
{
|
|
|
|
|
connect(devTray, TQT_SIGNAL(needsCenterStage(TrayComponent*, bool)), TQT_SLOT(trayComponentNeedsCenterStage(TrayComponent*, bool)));
|
|
|
|
|
connect(devTray, TQT_SIGNAL(uiUpdated()), TQT_SLOT(trayUiChanged()));
|
|
|
|
|
connect(devTray, TQ_SIGNAL(needsCenterStage(TrayComponent*, bool)), TQ_SLOT(trayComponentNeedsCenterStage(TrayComponent*, bool)));
|
|
|
|
|
connect(devTray, TQ_SIGNAL(uiUpdated()), TQ_SLOT(trayUiChanged()));
|
|
|
|
|
d->trayComponents.append(devTray);
|
|
|
|
|
//WILLTODO: sort
|
|
|
|
|
}
|
|
|
|
@ -617,7 +617,7 @@ void Tray::connectTrayDeviceManager() {
|
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = foreground_tray_dev->connectionManager();
|
|
|
|
|
if (deviceConnMan) {
|
|
|
|
|
slotUpdateDeviceState(deviceConnMan->deviceStatus().statusFlags, d->foregroundTrayComponent->lastKnownState, TQString());
|
|
|
|
|
connect(deviceConnMan, TQT_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), this, TQT_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)));
|
|
|
|
|
connect(deviceConnMan, TQ_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), this, TQ_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -630,7 +630,7 @@ void Tray::disconnectTrayDeviceManager() {
|
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = foreground_tray_dev->connectionManager();
|
|
|
|
|
if (deviceConnMan) {
|
|
|
|
|
slotUpdateDeviceState(deviceConnMan->deviceStatus().statusFlags, d->foregroundTrayComponent->lastKnownState, TQString());
|
|
|
|
|
disconnect(deviceConnMan, TQT_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), this, 0);
|
|
|
|
|
disconnect(deviceConnMan, TQ_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), this, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1076,7 +1076,7 @@ Tray::Tray() : KSystemTray()
|
|
|
|
|
d = new TrayPrivate(this);
|
|
|
|
|
d->helpMenu = new KHelpMenu(0, TDEGlobal::instance()->aboutData(), false);
|
|
|
|
|
|
|
|
|
|
connect(&d->signalMapper, TQT_SIGNAL(mapped(int)), this, TQT_SLOT(slotDeactivateConnection(int)));
|
|
|
|
|
connect(&d->signalMapper, TQ_SIGNAL(mapped(int)), this, TQ_SLOT(slotDeactivateConnection(int)));
|
|
|
|
|
|
|
|
|
|
setPixmap (m_pixmapCache["tdenetworkmanager"]);
|
|
|
|
|
setMouseTracking (true);
|
|
|
|
@ -1084,27 +1084,27 @@ Tray::Tray() : KSystemTray()
|
|
|
|
|
// Actions used for plugging into the menu
|
|
|
|
|
new TDEAction (i18n ("Switch to offline mode"),
|
|
|
|
|
SmallIcon ("no", TQIconSet::Automatic), 0,
|
|
|
|
|
this, TQT_SLOT (slotOfflineMode()), actionCollection (), "offline_mode");
|
|
|
|
|
this, TQ_SLOT (slotOfflineMode()), actionCollection (), "offline_mode");
|
|
|
|
|
|
|
|
|
|
new TDEAction (i18n ("Switch to online mode"),
|
|
|
|
|
SmallIcon ("ok", TQIconSet::Automatic), 0,
|
|
|
|
|
this, TQT_SLOT (slotOnlineMode()), actionCollection (), "online_mode");
|
|
|
|
|
this, TQ_SLOT (slotOnlineMode()), actionCollection (), "online_mode");
|
|
|
|
|
|
|
|
|
|
new TDEAction (i18n ("Disable Wireless"),
|
|
|
|
|
SmallIcon ("wireless_off", TQIconSet::Automatic), 0,
|
|
|
|
|
this, TQT_SLOT (slotDisableWireless()), actionCollection (), "disable_wireless");
|
|
|
|
|
this, TQ_SLOT (slotDisableWireless()), actionCollection (), "disable_wireless");
|
|
|
|
|
|
|
|
|
|
new TDEAction (i18n ("Enable Wireless"),
|
|
|
|
|
SmallIcon ("wireless", TQIconSet::Automatic), 0,
|
|
|
|
|
this, TQT_SLOT (slotEnableWireless()), actionCollection (), "enable_wireless");
|
|
|
|
|
this, TQ_SLOT (slotEnableWireless()), actionCollection (), "enable_wireless");
|
|
|
|
|
|
|
|
|
|
new TDEAction (i18n ("Edit Connections"),
|
|
|
|
|
SmallIcon ("edit", TQIconSet::Automatic), 0,
|
|
|
|
|
this, TQT_SLOT (slotEditConnections()), actionCollection (), "edit_connections");
|
|
|
|
|
this, TQ_SLOT (slotEditConnections()), actionCollection (), "edit_connections");
|
|
|
|
|
|
|
|
|
|
new TDEAction (i18n ("Configure Notifications"),
|
|
|
|
|
SmallIcon ("knotify", TQIconSet::Automatic), 0,
|
|
|
|
|
this, TQT_SLOT (slotEditNotifications()), actionCollection (), "configure_notifications");
|
|
|
|
|
this, TQ_SLOT (slotEditNotifications()), actionCollection (), "configure_notifications");
|
|
|
|
|
|
|
|
|
|
// this action is only connected when the menu is shown, hence the 0 receiver
|
|
|
|
|
new TDEAction (i18n ("New connection ..."),
|
|
|
|
@ -1120,15 +1120,15 @@ Tray::Tray() : KSystemTray()
|
|
|
|
|
actionCollection (), "deactivate_menu");
|
|
|
|
|
|
|
|
|
|
// get notified when NM's state changes
|
|
|
|
|
connect(TDEGlobal::networkManager(), TQT_SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, TQT_SLOT(slotStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
|
|
|
|
|
connect(TDEGlobal::networkManager(), TQ_SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, TQ_SLOT(slotStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
|
|
|
|
|
|
|
|
|
|
// get notified about new/removed devices
|
|
|
|
|
connect(hwdevices, TQT_SIGNAL(hardwareAdded(TDEGenericDevice*)), this, TQT_SLOT(slotGenericDeviceAdded(TDEGenericDevice*)));
|
|
|
|
|
connect(hwdevices, TQT_SIGNAL(hardwareRemoved(TDEGenericDevice*)), this, TQT_SLOT(slotGenericDeviceRemoved(TDEGenericDevice*)));
|
|
|
|
|
connect(hwdevices, TQ_SIGNAL(hardwareAdded(TDEGenericDevice*)), this, TQ_SLOT(slotGenericDeviceAdded(TDEGenericDevice*)));
|
|
|
|
|
connect(hwdevices, TQ_SIGNAL(hardwareRemoved(TDEGenericDevice*)), this, TQ_SLOT(slotGenericDeviceRemoved(TDEGenericDevice*)));
|
|
|
|
|
|
|
|
|
|
// Notifications
|
|
|
|
|
connect(TDEGlobal::networkManager(), TQT_SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, TQT_SLOT(slotStateChangedNotify(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
|
|
|
|
|
connect(TDEGlobal::networkManager(), TQT_SIGNAL(vpnEvent(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)), this, TQT_SLOT(slotVPNEventHandler(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)));
|
|
|
|
|
connect(TDEGlobal::networkManager(), TQ_SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, TQ_SLOT(slotStateChangedNotify(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
|
|
|
|
|
connect(TDEGlobal::networkManager(), TQ_SIGNAL(vpnEvent(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)), this, TQ_SLOT(slotVPNEventHandler(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)));
|
|
|
|
|
|
|
|
|
|
// Get connection list
|
|
|
|
|
TDEGlobalNetworkManager* nm = TDEGlobal::networkManager();
|
|
|
|
|