示例#1
0
bool BirthdayReminder::load()
{
	reloadSettings();
	foreach (Protocol *proto, Protocol::all()) {
		foreach (Account *account, proto->accounts())
			onAccountCreated(account);
		connect(proto, SIGNAL(accountCreated(qutim_sdk_0_3::Account*)),
				SLOT(onAccountCreated(qutim_sdk_0_3::Account*)));
	}
示例#2
0
AccountsModel::AccountsModel(QObject *parent) :
	QAbstractListModel(parent)
{
	AccountManager *manager = AccountManager::instance();
	connect(manager, &AccountManager::accountAdded, this, &AccountsModel::onAccountCreated);
	connect(manager, &AccountManager::accountRemoved, this, &AccountsModel::onAccountDestroyed);

	foreach (Account *account, manager->accounts())
		onAccountCreated(account);
}
示例#3
0
NotificationFilterImpl::NotificationFilterImpl()
{
	registerFilter(this, LowPriority);
	connect(ChatLayer::instance(), SIGNAL(sessionCreated(qutim_sdk_0_3::ChatSession*)),
			SLOT(onSessionCreated(qutim_sdk_0_3::ChatSession*)));

	foreach (Protocol *proto, Protocol::all()) {
		foreach (Account *acc, proto->accounts())
			onAccountCreated(acc);
		connect(proto, SIGNAL(accountCreated(qutim_sdk_0_3::Account*)),
				SLOT(onAccountCreated(qutim_sdk_0_3::Account*)));
	}
示例#4
0
AWNService::AWNService()
{
    m_uread = 0;
    m_item = 0;
    m_activeAccount = 0;
    m_iconTimer = 0;
	//m_cws = 0;
    m_awn = new QDBusInterface("net.launchpad.DockManager",
                              "/net/launchpad/DockManager",
                              "net.launchpad.DockManager");
    QDBusConnection::sessionBus().connect("net.launchpad.DockManager",
                                          "/net/launchpad/DockManager",
                                          "net.launchpad.DockManager",
                                          "ItemRemoved",
                                          this,
                                          SLOT(onItemRemoved(QDBusObjectPath)));
    QDBusMessage mes = m_awn->call("GetCapabilities");
	if(mes.type()==QDBusMessage::ReplyMessage) {
        QDBusReply<QStringList> r;
        r = mes;
        m_capabilities = r.value();
		debug() << "[AWN] dock capabilities: " << m_capabilities;
    }
	else {
		debug() << "[AWN] error: " << mes.errorName() << " : " << mes.errorMessage();
        return;
    }
    if(! m_capabilities.contains("dock-item-icon-file")  ||
       ! m_capabilities.contains("dock-item-message")    ||
       ! m_capabilities.contains("menu-item-with-label") ||
       ! m_capabilities.contains("menu-item-icon-name")    )
    {
        deleteLater();
        return;
    }
    m_icon_size = 128;
    //TODO: а если несколько панелей, как определить на какой находится док?
    QDBusInterface panel("org.awnproject.Awn",
                         "/org/awnproject/Awn/Panel1",
                         "org.awnproject.Awn.Panel");
    QVariant var = panel.property("Size");
    if(var.isValid())
        m_icon_size = var.toInt();
    if(!QDir::temp().exists("qutim-awn"))
        QDir::temp().mkdir("qutim-awn");
    generateIcons();
    m_firstIcon = "qutim";
    m_currentIcon = "qutim";
    m_iconTimer = new QTimer(this);
    connect(m_iconTimer,SIGNAL(timeout()),this,SLOT(nextIcon()));
    m_iconTimer->start(500);
    m_cwc = new ChatWindowController(this);
    qApp->installEventFilter(this);
    connect(ChatLayer::instance(), SIGNAL(sessionCreated(qutim_sdk_0_3::ChatSession*)),this, SLOT(onSessionCreated(qutim_sdk_0_3::ChatSession*)));
    QMap<QString, Protocol*> protocols;
    foreach (Protocol *proto, Protocol::all()) {
        protocols.insert(proto->id(), proto);
        connect(proto, SIGNAL(accountCreated(qutim_sdk_0_3::Account*)),
                this, SLOT(onAccountCreated(qutim_sdk_0_3::Account*)));
        foreach(Account *a, proto->accounts())
            emit onAccountCreated(a);
    }