示例#1
0
void AbstractCardItem::setName(const QString &_name)
{
    if (name == _name)
        return;
    
    emit deleteCardInfoPopup(name);
    disconnect(info, 0, this, 0);
    name = _name;
    info = db->getCard(name);
    connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
    update();
}
void CardInfo::imageLoaded(const QImage &image)
{
    if (!image.isNull()) {
        QPixmapCache::insert(pixmapCacheKey, QPixmap::fromImage(image));
        emit pixmapUpdated();
    }
}
示例#3
0
void CardInfo::imageLoaded(const QImage &image)
{
    if (!image.isNull()) {
        *pixmap = QPixmap::fromImage(image);
        emit pixmapUpdated();
    }
}
示例#4
0
void CardInfo::updatePixmapCache()
{
    qDebug() << "Updating pixmap cache for" << name;
    clearPixmapCache();
    loadPixmap();

    emit pixmapUpdated();
}
示例#5
0
void CardInfoPicture::setCard(CardInfo *card)
{
    if (info)
        disconnect(info, 0, this, 0);
    info = card;
    connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));

    updatePixmap();
}
LockScreenView::LockScreenView(MWidgetController* controller) : MWidgetView(controller),
    controller(controller),
    layout(new QGraphicsLinearLayout(Qt::Vertical)),
    lockScreenHeader(new LockScreenHeader),
    landscapePixmap(GCONF_KEY_LANDSCAPE),
    portraitPixmap(GCONF_KEY_PORTRAIT)
{
    // Set the main layout
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    controller->setLayout(layout);

    // Add a header for the lock screen
    layout->addItem(lockScreenHeader);

    // Update the style name based on whether there are any custom background pixmaps or not
    updateStyleName();
    connect(&landscapePixmap, SIGNAL(pixmapUpdated()), this, SLOT(updateStyleName()));
    connect(&portraitPixmap, SIGNAL(pixmapUpdated()), this, SLOT(updateStyleName()));
}
示例#7
0
void CardInfoPicture::setCard(CardInfoPtr card)
{
    if (info) {
        disconnect(info.data(), nullptr, this, nullptr);
    }

    info = card;

    if (info) {
        connect(info.data(), SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
    }

    updatePixmap();
}
void PlainDesktopBackgroundPixmap::createDefocusedPixmap()
{
    // Disconnect previous pixmapRequestsFinished() connections if any
    disconnect(MTheme::instance(), SIGNAL(pixmapRequestsFinished()), this, SLOT(createDefocusedPixmap()));

    if (pixmapFromFile_.isNull() && pixmapFromTheme_ != NULL && pixmapFromTheme_->isNull()) {
        // A pixmap from the theme is being used but it is not available yet: listen to pixmapRequestsFinished() signals
        connect(MTheme::instance(), SIGNAL(pixmapRequestsFinished()), this, SLOT(createDefocusedPixmap()));
    } else {
        // A pixmap from a file is being used or a pixmap from the theme is being used and it is available
        defocusedPixmap_ = QSharedPointer<QPixmap>(createDefocusedPixmap(*pixmap(), blurRadius_, brightness_));
        emit pixmapUpdated();
    }
}
示例#9
0
void CardInfoWidget::setCard(CardInfo *card)
{
	if (info)
		disconnect(info, 0, this, 0);
	info = card;
	connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
	connect(info, SIGNAL(destroyed()), this, SLOT(clear()));

	updatePixmap();
	nameLabel2->setText(card->getName());
	manacostLabel2->setText(card->getManaCost());
	cardtypeLabel2->setText(card->getCardType());
	powtoughLabel2->setText(card->getPowTough());
	loyaltyLabel2->setText(card->getLoyalty() > 0 ? QString::number(card->getLoyalty()) : QString());
	textLabel->setText(card->getText());

	powtoughLabel1->setVisible(shouldShowPowTough());
	powtoughLabel2->setVisible(shouldShowPowTough());
	loyaltyLabel1->setVisible(shouldShowLoyalty());
	loyaltyLabel2->setVisible(shouldShowLoyalty());
}
void LockScreenBackgroundPixmap::updatePixmap()
{
    // Destroy the old pixmap
    destroyPixmap();

    QString image = gConfItem->value().toString();
    if (!image.isEmpty()) {
        if (image.startsWith('/')) {
            // Load from absolute path: if it fails the pixmap will be invalid and the default will be used
            pixmapFromTheme = false;
            pixmap = new QPixmap;
            pixmap->load(image);
        } else {
            // Load from theme
            pixmapFromTheme = true;
            pixmap = const_cast<QPixmap *>(MTheme::pixmap(image));
        }
    }

    // Let the view know about the updated pixmap
    emit pixmapUpdated();
}
示例#11
0
void AbstractCardItem::cardInfoUpdated()
{
    info = db->getCard(name);
    connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
}