Ejemplo n.º 1
0
PropertiesDialog::PropertiesDialog(QWidget *parent):QDialog(parent)
{
    setupUi(this);
    QObject::connect(AlbumBox,SIGNAL(textEdited(QString)),this,SLOT(propChanged()));
    QObject::connect(ArtistBox,SIGNAL(textEdited(QString)),this,SLOT(propChanged()));
    QObject::connect(TitleBox,SIGNAL(textEdited(QString)),this,SLOT(propChanged()));
    QObject::connect(localsetButton,SIGNAL(clicked()),this,SLOT(setCover()));
    QObject::connect(removeButton,SIGNAL(clicked()),this,SLOT(removeCover()));
    QObject::connect(this,SIGNAL(accepted()),this,SLOT(write()));
    coverChanged=false;
}
Ejemplo n.º 2
0
void PropertiesDialog::setCover()
{
    QString filename=QFileDialog::getOpenFileName(this,"Select an image","/home","Images (*.png *.jpg *.jpeg *.gif)");
    if(!filename.isNull())
    {
        QPixmap pic=QPixmap(filename).scaled(128,128,Qt::IgnoreAspectRatio);
        AlbumArt->setPixmap(pic);
        propChanged();
        coverChanged=true;
    }
}
Ejemplo n.º 3
0
bool SSPropModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
	if(role == Qt::EditRole && index.isValid() && index.column() == 1){
		QList<QByteArray> names = m_object->dynamicPropertyNames();
		m_object->setProperty(names.at(index.row()), value);
		emit dataChanged(index, index);
		emit propChanged();
		return true;
	}		
	return false;
}
Ejemplo n.º 4
0
void QUPowerDeviceInterface::connectNotify(const char *signal)
{
    if (QLatin1String(signal) == SIGNAL(changed())) {
        if (!connection().connect(QLatin1String(UPOWER_SERVICE),
                                  path,
                                  UPOWER_DEVICE_SERVICE,
                                  QLatin1String("Changed"),
                                  this, SIGNAL(changed()))) {
            qDebug() << "Error" << connection().lastError().message();
        }
    } else if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QVariant))) {
        if (!connection().connect(QLatin1String(UPOWER_SERVICE),
                                  path,
                                  UPOWER_DEVICE_SERVICE,
                                  QLatin1String("Changed"),
                                  this, SIGNAL(propChanged()))) {
            qDebug() << "Error" << connection().lastError().message();
        }
    }
}
Ejemplo n.º 5
0
void PropertiesDialog::removeCover()
{
    itdb_track_remove_thumbnails(currentTrack);
    AlbumArt->setPixmap(QPixmap(":/images/no-cover-art.jpg"));
    propChanged();
}
Ejemplo n.º 6
0
SSPropModel::SSPropModel(QObject* obj, QObject *parent)
	: QAbstractItemModel(parent), m_object(obj)
{
	connect(this, SIGNAL(propChanged()), obj, SLOT(update()));
	connect(this, SIGNAL(propChanged()), obj, SLOT(updateCanvas()));
}