void WeatherButton::slotIconChanged( int group ) { if ( group != KIcon::Panel ) return; generateIcons(); repaint( false ); }
void SimpleButton::slotIconChanged( int group ) { if (group != KIcon::Panel) { return; } generateIcons(); repaint(false); }
void HideButton::slotIconChanged(int group) { if (group != KIconLoader::Panel) { return; } generateIcons(); repaint(); }
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); }
void SimpleButton::setPixmap(const QPixmap &pix) { QButton::setPixmap(pix); generateIcons(); update(); }
void SimpleButton::resizeEvent( QResizeEvent * ) { generateIcons(); }
void HideButton::resizeEvent(QResizeEvent *) { generateIcons(); }
void HideButton::setPixmap(const QPixmap &pix) { setIcon(pix); generateIcons(); }
void WeatherButton::setPixmap( const QPixmap &pix ) { QButton::setPixmap( pix ); generateIcons(); }
void WeatherButton::resizeEvent( QResizeEvent * ) { generateIcons(); }