예제 #1
0
void WeatherButton::slotIconChanged( int group )
{
    if ( group != KIcon::Panel )
        return;

    generateIcons();
    repaint( false );
}
예제 #2
0
void SimpleButton::slotIconChanged( int group )
{
    if (group != KIcon::Panel)
    {
        return;
    }

    generateIcons();
    repaint(false);
}
예제 #3
0
void HideButton::slotIconChanged(int group)
{
    if (group != KIconLoader::Panel)
    {
        return;
    }

    generateIcons();
    repaint();
}
예제 #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);
    }
예제 #5
0
void SimpleButton::setPixmap(const QPixmap &pix)
{
    QButton::setPixmap(pix);
    generateIcons();
    update();
}
예제 #6
0
void SimpleButton::resizeEvent( QResizeEvent * )
{
    generateIcons();
}
예제 #7
0
void HideButton::resizeEvent(QResizeEvent *)
{
    generateIcons();
}
예제 #8
0
void HideButton::setPixmap(const QPixmap &pix)
{
    setIcon(pix);
    generateIcons();
}
예제 #9
0
void WeatherButton::setPixmap( const QPixmap &pix )
{
    QButton::setPixmap( pix );
    generateIcons();
}
예제 #10
0
void WeatherButton::resizeEvent( QResizeEvent * )
{
    generateIcons();
}