Beispiel #1
0
void InputWidget::connectMyIrcUser()
{
    const Network *network = currentNetwork();
    if (network->me()) {
        connect(network->me(), SIGNAL(nickSet(const QString &)), this, SLOT(updateNickSelector()));
        connect(network->me(), SIGNAL(userModesSet(QString)), this, SLOT(updateNickSelector()));
        connect(network->me(), SIGNAL(userModesAdded(QString)), this, SLOT(updateNickSelector()));
        connect(network->me(), SIGNAL(userModesRemoved(QString)), this, SLOT(updateNickSelector()));
        connect(network->me(), SIGNAL(awaySet(bool)), this, SLOT(updateNickSelector()));
        disconnect(network, SIGNAL(myNickSet(const QString &)), this, SLOT(connectMyIrcUser()));
        updateNickSelector();
    }
Beispiel #2
0
	void CNotificationManager::showStateNotification(libnutcommon::DeviceState state) {
		if (!m_NotificationsEnabled)
			return;
		
		CUIDevice * uiDevice = qobject_cast<CUIDevice *>(sender());
		if (!uiDevice)
			return;
		
		QString message;
		switch (state) {
		case libnutcommon::DS_UP:
			message = tr("%2 is now up and running on network: %1")
				.arg(currentNetwork(uiDevice->device()));
			break;
		case libnutcommon::DS_UNCONFIGURED:
			message = tr("%2 got carrier (to network: %1) but needs configuration.\n\nClick here to open the device details.")
				.arg(currentNetwork(uiDevice->device()));
			break;
		case libnutcommon::DS_ACTIVATED:
			message = tr("%1 is now activated and waits for carrier.");
			break;
		case libnutcommon::DS_DEACTIVATED:
			message = tr("%1 is now deactivated");
			break;
		default:
			return;
		}
		
		{
			QSystemTrayIcon * trayIcon = m_UIDeviceIcons.value(uiDevice, NULL);
			message = message.arg(trayIcon && trayIcon->isVisible() ? tr("Device") : uiDevice->device()->getName());
		}
		
		if (state == libnutcommon::DS_UNCONFIGURED)
			showMessage(QString(), message, uiDevice->m_ShowEnvironmentsAction, SLOT(trigger()), uiDevice);
		else
			showMessage(QString(), message, NULL, NULL, uiDevice);
	}