Commit 3ac61394 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Support for Media Art in the Media Info dialog and various fixed on that dialog.

parent b271b9ff
...@@ -47,39 +47,36 @@ MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) : ...@@ -47,39 +47,36 @@ MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
{ {
int line = 0; int line = 0;
QGridLayout *l = new QGridLayout( this ); QGridLayout *l = new QGridLayout( this );
l->setColumnStretch( 2, 5 );
l->setColumnStretch( 5, 3 );
#define ADD_META( string, widget ) { \ #define ADD_META( string, widget ) { \
l->addWidget( new QLabel( qtr( string ) + " :" ), line, 0 ); \ l->addWidget( new QLabel( qtr( string ) + " :" ), line, 0 ); \
widget = new QLineEdit; \ widget = new QLineEdit; \
l->addWidget( widget, line, 1, 1, 7 ); \ l->addWidget( widget, line, 1, 1, 9 ); \
line++; } line++; }
ADD_META( VLC_META_TITLE, title_text ); /* OK */ ADD_META( VLC_META_TITLE, title_text ); /* OK */
ADD_META( VLC_META_ARTIST, artist_text ); /* OK */ ADD_META( VLC_META_ARTIST, artist_text ); /* OK */
ADD_META( VLC_META_GENRE, genre_text ); /* FIXME List id3genres.h is not ADD_META( VLC_META_COLLECTION, collection_text ); /* OK */
includable yet ? */
/* Genre Name */ /* FIXME List id3genres.h is not includable yet ? */
/* Album Name */ genre_text = new QLineEdit;
l->addWidget( new QLabel( qfu( VLC_META_COLLECTION ) + " :" ), line, 0 ); l->addWidget( new QLabel( qtr( VLC_META_GENRE ) + " :" ), line, 0 );
collection_text = new QLineEdit; l->addWidget( genre_text, line, 1, 1, 6 );
l->addWidget( collection_text, line, 1, 1, 5 );
l->addWidget( new QLabel( qfu( VLC_META_DATE ) + " :" ), line, 6 );
/* Date (Should be in years) */ /* Date (Should be in years) */
date_text = new QSpinBox; setSpinBounds( date_text ); date_text = new QSpinBox; setSpinBounds( date_text );
l->addWidget( date_text, line, 7 ); l->addWidget( new QLabel( qfu( VLC_META_DATE ) + " :" ), line, 7 );
l->addWidget( date_text, line, 8, 1, 2 );
line++; line++;
/* Number and Rating */ /* Number and Rating */
l->addWidget( new QLabel( qfu( _("Track number/Position" ) ) + " :" ), l->addWidget( new QLabel( qfu( _("Track number/Position" ) ) + " :" ),
line, 0 ); line, 0 );
seqnum_text = new QSpinBox; setSpinBounds( seqnum_text ); seqnum_text = new QSpinBox; setSpinBounds( seqnum_text );
l->addWidget( seqnum_text, line, 1, 1, 3 ); l->addWidget( seqnum_text, line, 1, 1, 4 );
l->addWidget( new QLabel( qfu( VLC_META_RATING ) + " :" ), line, 4 ); l->addWidget( new QLabel( qfu( VLC_META_RATING ) + " :" ), line, 5 );
rating_text = new QSpinBox; setSpinBounds( rating_text) ; rating_text = new QSpinBox; setSpinBounds( rating_text) ;
l->addWidget( rating_text, line, 5, 1, 3 ); l->addWidget( rating_text, line, 6, 1, 4 );
line++; line++;
ADD_META( VLC_META_NOW_PLAYING, nowplaying_text ); ADD_META( VLC_META_NOW_PLAYING, nowplaying_text );
...@@ -87,23 +84,43 @@ MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) : ...@@ -87,23 +84,43 @@ MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
/* Language and settings */ /* Language and settings */
l->addWidget( new QLabel( qfu( VLC_META_LANGUAGE ) + " :" ), line, 0 ); l->addWidget( new QLabel( qfu( VLC_META_LANGUAGE ) + " :" ), line, 0 );
language_text = new QLineEdit; language_text = new QLineEdit;
l->addWidget( language_text, line, 1, 1, 3 ); l->addWidget( language_text, line, 1, 1, 4 );
l->addWidget( new QLabel( qfu( VLC_META_SETTING ) + " :" ), line, 4 ); l->addWidget( new QLabel( qfu( VLC_META_SETTING ) + " :" ), line, 5 );
setting_text = new QLineEdit; setting_text = new QLineEdit;
l->addWidget( setting_text, line, 5, 1, 3 ); l->addWidget( setting_text, line, 6, 1, 4 );
line++; line++;
ADD_META( VLC_META_COPYRIGHT, copyright_text ); /* ART_URL */
ADD_META( VLC_META_PUBLISHER, publisher_text ); // ADD_META( VLC_META_URL, setting_text );
art_cover = new QLabel( "" );
art_cover->setMinimumHeight( 128 );
art_cover->setMinimumWidth( 128 );
art_cover->setMaximumHeight( 128 );
art_cover->setMaximumWidth( 128 );
art_cover->setScaledContents( true );
art_cover->setPixmap( QPixmap( ":/noart.png" ) );
l->addWidget( art_cover, line, 8, 4, 2 );
ADD_META( VLC_META_ENCODED_BY, publisher_text ); #define ADD_META_B( string, widget ) { \
ADD_META( VLC_META_DESCRIPTION, description_text ); // Comment Two lines? l->addWidget( new QLabel( qtr( string ) + " :" ), line, 0 ); \
widget = new QLineEdit; \
l->addWidget( widget, line, 1, 1, 7 ); \
line++; }
ADD_META_B( VLC_META_COPYRIGHT, copyright_text );
ADD_META_B( VLC_META_PUBLISHER, publisher_text );
ADD_META_B( VLC_META_ENCODED_BY, publisher_text );
ADD_META_B( VLC_META_DESCRIPTION, description_text ); // Comment Two lines?
/* ADD_META( TRACKID) DO NOT SHOW it */ /* ADD_META( TRACKID) DO NOT SHOW it */
/* ADD_URI - DO not show it, done outside */ /* ADD_URI - DO not show it, done outside */
/* ART_URL */ #undef ADD_META
// ADD_META( VLC_META_URL, setting_text ); #undef ADD_META_B
// CONNECT( model, artSet( QString ) , this, setArt( QString ) );
} }
MetaPanel::~MetaPanel() MetaPanel::~MetaPanel()
...@@ -158,6 +175,15 @@ void MetaPanel::update( input_item_t *p_item ) ...@@ -158,6 +175,15 @@ void MetaPanel::update( input_item_t *p_item )
#undef UPDATE_META #undef UPDATE_META
} }
void MetaPanel::setArt( QString artUrl )
{
msg_Dbg( p_intf, "Trying to update art" );
if( artUrl.isNull() )
art_cover->setPixmap( QPixmap( ":/noart.png" ) );
else
art_cover->setPixmap( QPixmap( artUrl ) );
}
void MetaPanel::clear(){} void MetaPanel::clear(){}
ExtraMetaPanel::ExtraMetaPanel( QWidget *parent, intf_thread_t *_p_intf ) : ExtraMetaPanel::ExtraMetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
......
...@@ -45,6 +45,7 @@ class QTreeWidgetItem; ...@@ -45,6 +45,7 @@ class QTreeWidgetItem;
class QTreeView; class QTreeView;
class QSpinBox; class QSpinBox;
class QLineEdit; class QLineEdit;
class QLabel;
class MetaPanel: public QWidget class MetaPanel: public QWidget
{ {
...@@ -68,10 +69,13 @@ private: ...@@ -68,10 +69,13 @@ private:
QLineEdit *language_text; QLineEdit *language_text;
QLineEdit *nowplaying_text; QLineEdit *nowplaying_text;
QLineEdit *publisher_text; QLineEdit *publisher_text;
QLabel *art_cover;
public slots: public slots:
void update( input_item_t * ); void update( input_item_t * );
void clear(); void clear();
private slots:
void setArt( QString );
signals: signals:
void uriSet( QString ); void uriSet( QString );
}; };
......
...@@ -47,7 +47,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput, ...@@ -47,7 +47,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
p_input = NULL; p_input = NULL;
setWindowTitle( qtr( "Media information" ) ); setWindowTitle( qtr( "Media information" ) );
resize( 600 , 450 ); resize( 700 , 450 );
QGridLayout *layout = new QGridLayout( this ); QGridLayout *layout = new QGridLayout( this );
...@@ -68,12 +68,12 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput, ...@@ -68,12 +68,12 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
closeButton->setDefault( true ); closeButton->setDefault( true );
uriLine = new QLineEdit; uriLine = new QLineEdit;
QLabel *uriLabel = new QLabel( qtr( "Location" ) ); QLabel *uriLabel = new QLabel( qtr( "Location :" ) );
layout->addWidget( IT, 0, 0, 1, 3 ); layout->addWidget( IT, 0, 0, 1, 7 );
layout->addWidget( closeButton, 2, 2 ); layout->addWidget( closeButton, 2, 6 );
layout->addWidget( uriLine, 1, 1, 1, 2 );
layout->addWidget( uriLabel, 1, 0, 1, 1 ); layout->addWidget( uriLabel, 1, 0, 1, 1 );
layout->addWidget( uriLine, 1, 1, 1, 6 );
BUTTONACT( closeButton, close() ); BUTTONACT( closeButton, close() );
CONNECT( MP, uriSet( QString ), uriLine, setText( QString ) ); CONNECT( MP, uriSet( QString ), uriLine, setText( QString ) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment