AccountManager::AccountManager()
: QObject( qApp ), d(new Private())
{
	setObjectName( "KopeteAccountManager" );
	connect( Solid::Networking::notifier(), SIGNAL(shouldConnect()), this, SLOT(networkConnected()) );
	connect( Solid::Networking::notifier(), SIGNAL(shouldDisconnect()), this, SLOT(networkDisconnected()) );
	connect( Solid::PowerManagement::notifier(), SIGNAL(resumingFromSuspend()), this, SLOT(resume()) );
#ifdef __GNUC__
#warning TODO: Switch to a org.kde.Solid.PowerManagement Sleeping/Suspending signal when available.
#endif
	QDBusConnection::systemBus().connect( "org.freedesktop.UPower", "/org/freedesktop/UPower", "", "Sleeping", this, SLOT( suspend() ) );
	d->suspended = false;
}
Пример #2
0
TestClient::TestClient()
    : KMainWindow( 0 ),
      m_status( AppDisconnected ), m_view( new QWidget( this ) )
{
    ui.setupUi( m_view );

    setCentralWidget(m_view);

    networkStatusChanged( Solid::Networking::status() );
    appDisconnected();

    kDebug() << "About to connect";
    connect( Solid::Networking::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)), SLOT(networkStatusChanged(Solid::Networking::Status)) );
    kDebug() << "Connected.";
    connect( Solid::Networking::notifier(), SIGNAL(shouldConnect()), this, SLOT(doConnect()) );
    connect( Solid::Networking::notifier(), SIGNAL(shouldDisconnect()), this, SLOT(doDisconnect()) );

    connect( ui.connectButton, SIGNAL(clicked()), SLOT(connectButtonClicked()) );
}