Пример #1
0
void MediaWidget::checkScreenSaver()
{
	bool suspendScreenSaver = false;

	switch (backend->getPlaybackStatus()) {
	case Idle:
	case Paused:
		break;
	case Playing:
		suspendScreenSaver = isVisible();
		break;
	}

	if (suspendScreenSaver) {
		// KDE - Inhibit doesn't inhibit "lock screen after inactivity"
		QDBusInterface(QLatin1String("org.freedesktop.ScreenSaver"), QLatin1String("/ScreenSaver"),
			QLatin1String("org.freedesktop.ScreenSaver")).call(QDBus::NoBlock,
			QLatin1String("SimulateUserActivity"));

		// GNOME - Inhibit doesn't inhibit power management functions
		QDBusInterface(QLatin1String("org.gnome.ScreenSaver"), QLatin1String("/"),
			       QLatin1String("org.gnome.ScreenSaver")).
			call(QDBus::NoBlock, QLatin1String("SimulateUserActivity"));
	}

	if (screenSaverSuspended != suspendScreenSaver) {
		// X11 - needed if none of the above applications is running
		screenSaverSuspended = suspendScreenSaver;
		XScreenSaverSuspend(QX11Info::display(), suspendScreenSaver);
	}
}
Пример #2
0
bool KSSLSigners::addCA(const QString &cert,
                        bool ssl,
                        bool email,
                        bool code) const {
     return QDBusReply<bool>(QDBusInterface("org.kde.kded", "/modules/kssld").
                             call("caAdd", cert, ssl, email, code));
}
Пример #3
0
void MToolsRadio::longAction()
{
    QDBusInterface("com.nokia.DuiControlPanel",
                   "/",
                   "com.nokia.DuiControlPanelIf",
                   QDBusConnection::sessionBus(),
                   this).call(QDBus::NoBlock,
                              "appletPage", "Phone network");
}
void AppletAvialabilityWidget::openPresence()
{
    QDBusInterface("com.nokia.Presence-ui",
                   "/",
                   "com.nokia.PresenceUiInterface",
                   QDBusConnection::sessionBus(),
                   this).call(QDBus::NoBlock,
                              "showPresenceUi");
}
Пример #5
0
void RingtoneDialog::setRingtone()
{
    QDBusInterface("com.nokia.profiled",
                   "/com/nokia/profiled",
                   "com.nokia.profiled",
                   QDBusConnection::sessionBus())
    .call(QDBus::NoBlock, "set_value", "general", "ringing.alert.tone", QUrl(uri).toLocalFile());

    QMaemo5InformationBox::information(this->parentWidget(), tr("Selected song set as ringing tone"));

    ConfirmDialog::done(QMessageBox::Yes);
}
Пример #6
0
void Systray::showMessage(const QString & title, const QString & message, MessageIcon icon, int millisecondsTimeoutHint)
{

#ifdef USE_FDO_NOTIFICATIONS
    if(QDBusInterface(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE).isValid()) {
        QList<QVariant> args = QList<QVariant>() << "owncloud" << quint32(0) << "owncloud"
                                                 << title << message << QStringList () << QVariantMap() << qint32(-1);
        QDBusMessage method = QDBusMessage::createMethodCall(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE, "Notify");
        method.setArguments(args);
        QDBusConnection::sessionBus().asyncCall(method);
    } else
#endif
    {
        QSystemTrayIcon::showMessage(title, message, icon, millisecondsTimeoutHint);
    }
}
Пример #7
0
QtSystemTray::QtSystemTray() : QObject(), statusType_(StatusShow::None), trayMenu_(0), onlineIcon_(":icons/online.png"), awayIcon_(":icons/away.png"), dndIcon_(":icons/dnd.png"), offlineIcon_(":icons/offline.png"), newMessageIcon_(":icons/new-chat.png"), throbberMovie_(":/icons/connecting.mng"), unreadMessages_(false), connecting_(false) {
	trayIcon_ = new QSystemTrayIcon(offlineIcon_);
	trayIcon_->setToolTip("Swift");
	connect(trayIcon_, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(handleIconActivated(QSystemTrayIcon::ActivationReason)));
	connect(&throbberMovie_, SIGNAL(frameChanged(int)), this, SLOT(handleThrobberFrameChanged(int)));
#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
	bool isUnity = QDBusInterface("com.canonical.Unity.Launcher", "/com/canonical/Unity/Launcher").isValid();
	if (isUnity) {
		// Add an activation menu, because this is the only way to get the application to the
		// front on Unity. See the README for sni-qt (which handles Qt tray icons for Unity)
		trayMenu_ = new QMenu();
		QAction* showAction = new QAction(QString("Show/Hide"), this);
		connect(showAction, SIGNAL(triggered()), SIGNAL(clicked()));
		trayMenu_->addAction(showAction);
		trayIcon_->setContextMenu(trayMenu_);
	}
#endif
	trayIcon_->show();
}
Пример #8
0
void SkypeConnection::startLogOn() {
	kDebug(SKYPE_DEBUG_GLOBAL);

	if (d->startTimer) {
		d->startTimer->deleteLater();
		d->startTimer = 0L;
	}

	QDBusReply <QString> reply = QDBusInterface("com.Skype.API", "/com/Skype", "com.Skype.API", BUS).call("Invoke", "PING");

	if ( reply.value() != "PONG" ){
		emit error(i18n("Could not ping Skype"));
		disconnectSkype(crLost);
		emit connectionDone(seNoSkype, 0);
		return;
	}

	d->fase = cfNameSent;
	send(QString("NAME %1").arg(d->appName));
}
Пример #9
0
bool KSSLSigners::remove(const QString &subject) {
     return QDBusReply<bool>(QDBusInterface("org.kde.kded", "/modules/kssld").
                             call("caRemove", subject));
}
Пример #10
0
bool KSSLSigners::useForCode(const QString &subject) const{
     return QDBusReply<bool>(QDBusInterface("org.kde.kded", "/modules/kssld").
                             call("caUseForCode", subject));
}
Пример #11
0
bool KSSLSigners::regenerate() {
     return QDBusReply<bool>(QDBusInterface("org.kde.kded", "/modules/kssld").
                             call("caRegenerate"));
}
Пример #12
0
bool KSSLSigners::setUse(const QString &subject, bool ssl, bool email, bool code) {
     return QDBusReply<bool>(QDBusInterface("org.kde.kded", "/modules/kssld").
                             call("caSetUse", subject, ssl, email, code));
}
Пример #13
0
QString KSSLSigners::getCert(const QString &subject) {
     return QDBusReply<QString>(QDBusInterface("org.kde.kded", "/modules/kssld").
                                call("caGetCert", subject));
}
Пример #14
0
QStringList KSSLSigners::list() {
     return QDBusReply<QStringList>(QDBusInterface("org.kde.kded", "/modules/kssld").
                                    call("caList"));
}