Commit 7f2ab0ac authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt, redesign of the media info dialog

Close #2915, #2831, #2898
parent 3a78a00c
...@@ -60,100 +60,100 @@ MetaPanel::MetaPanel( QWidget *parent, ...@@ -60,100 +60,100 @@ MetaPanel::MetaPanel( QWidget *parent,
: QWidget( parent ), p_intf( _p_intf ) : QWidget( parent ), p_intf( _p_intf )
{ {
QGridLayout *metaLayout = new QGridLayout( this ); QGridLayout *metaLayout = new QGridLayout( this );
metaLayout->setVerticalSpacing( 12 ); metaLayout->setVerticalSpacing( 0 );
QFont smallFont = QApplication::font();
smallFont.setPointSize( smallFont.pointSize() - 2 );
smallFont.setBold( true );
int line = 0; /* Counter for GridLayout */ int line = 0; /* Counter for GridLayout */
p_input = NULL; p_input = NULL;
QLabel *label;
#define ADD_META( string, widget ) { \ #define ADD_META( string, widget, col, colspan ) { \
metaLayout->addWidget( new QLabel( qtr( string ) + " :" ), line, 0 ); \ label = new QLabel( qtr( string ) ); label->setFont( smallFont ); \
label->setContentsMargins( 3, 2, 0, 0 ); \
metaLayout->addWidget( label, line++, col, 1, colspan ); \
widget = new QLineEdit; \ widget = new QLineEdit; \
metaLayout->addWidget( widget, line, 1, 1, 9 ); \ metaLayout->addWidget( widget, line, col, 1, colspan ); \
line++; } CONNECT( widget, textEdited( QString ), this, enterEditMode() ); \
}
/* Title, artist and album*/ /* Title, artist and album*/
ADD_META( VLC_META_TITLE, title_text ); /* OK */ ADD_META( VLC_META_TITLE, title_text, 0, 10 ); line++;
ADD_META( VLC_META_ARTIST, artist_text ); /* OK */ ADD_META( VLC_META_ARTIST, artist_text, 0, 10 ); line++;
ADD_META( VLC_META_ALBUM, collection_text ); /* OK */ ADD_META( VLC_META_ALBUM, collection_text, 0, 7 );
/* Date */
label = new QLabel( qtr( VLC_META_DATE ) );
label->setFont( smallFont ); label->setContentsMargins( 3, 2, 0, 0 );
metaLayout->addWidget( label, line - 1, 7, 1, 2 );
/* Date (Should be in years) */
date_text = new QLineEdit;
date_text->setAlignment( Qt::AlignRight );
date_text->setInputMask("0000");
date_text->setMaximumWidth( 128 );
metaLayout->addWidget( date_text, line, 7, 1, -1 );
line++;
/* Genre Name */ /* Genre Name */
/* TODO List id3genres.h is not includable yet ? */ /* TODO List id3genres.h is not includable yet ? */
genre_text = new QLineEdit; ADD_META( VLC_META_GENRE, genre_text, 0, 7 );
metaLayout->addWidget( new QLabel( qtr( VLC_META_GENRE ) + " :" ), line, 0 );
metaLayout->addWidget( genre_text, line, 1, 1, 3 );
/* Number - on the same line */ /* Number - on the same line */
metaLayout->addWidget( new QLabel( qtr( VLC_META_TRACK_NUMBER ) + " :" ), label = new QLabel( qtr( VLC_META_TRACK_NUMBER ) );
line, 5, 1, 2 ); label->setFont( smallFont ); label->setContentsMargins( 3, 2, 0, 0 );
metaLayout->addWidget( label, line - 1, 7, 1, 3 );
seqnum_text = new QLineEdit; seqnum_text = new QLineEdit;
seqnum_text->setInputMask("0000"); seqnum_text->setMaximumWidth( 60 );
seqnum_text->setAlignment( Qt::AlignRight ); metaLayout->addWidget( seqnum_text, line, 7, 1, 1 );
metaLayout->addWidget( seqnum_text, line, 7, 1, 3 );
line++;
/* Date (Should be in years) */ label = new QLabel( "/" ); label->setFont( smallFont );
date_text = new QLineEdit; metaLayout->addWidget( label, line, 8, 1, 1 );
date_text->setInputMask("0000");
date_text->setAlignment( Qt::AlignRight ); seqtot_text = new QLineEdit;
metaLayout->addWidget( new QLabel( qtr( VLC_META_DATE ) + " :" ), line, 0 ); seqtot_text->setMaximumWidth( 60 );
metaLayout->addWidget( date_text, line, 1, 1, 3 ); metaLayout->addWidget( seqtot_text, line, 9, 1, 1 );
line++;
/* Rating - on the same line */ /* Rating - on the same line */
/* /*
metaLayout->addWidget( new QLabel( qtr( VLC_META_RATING ) + " :" ), line, 4, 1, 2 ); metaLayout->addWidget( new QLabel( qtr( VLC_META_RATING ) ), line, 4, 1, 2 );
rating_text = new QSpinBox; setSpinBounds( rating_text ); rating_text = new QSpinBox; setSpinBounds( rating_text );
metaLayout->addWidget( rating_text, line, 6, 1, 1 ); metaLayout->addWidget( rating_text, line, 6, 1, 1 );
*/ */
/* Now Playing - Useful for live feeds (HTTP, DVB, ETC...) */
ADD_META( VLC_META_NOW_PLAYING, nowplaying_text, 0, 7 );
nowplaying_text->setReadOnly( true ); line--;
/* Language on the same line */ /* Language on the same line */
metaLayout->addWidget( new QLabel( qfu( VLC_META_LANGUAGE ) + " :" ), line, 5, 1, 2 ); ADD_META( VLC_META_LANGUAGE, language_text, 7, -1 ); line++;
language_text = new QLineEdit;
language_text->setReadOnly( true );
metaLayout->addWidget( language_text, line, 7, 1, 3 );
line++;
/* ART_URL */ /* ART_URL */
art_cover = new CoverArtLabel( this, p_intf ); art_cover = new CoverArtLabel( this, p_intf );
metaLayout->addWidget( art_cover, line, 8, 4, 2, Qt::AlignRight ); metaLayout->addWidget( art_cover, line + 1, 7, 6, 3, Qt::AlignLeft );
/* Settings is unused */ ADD_META( VLC_META_PUBLISHER, publisher_text, 0, 7 ); line++;
/* l->addWidget( new QLabel( qtr( VLC_META_SETTING ) + " :" ), line, 5 ); ADD_META( VLC_META_COPYRIGHT, copyright_text, 0, 7 ); line++;
setting_text = new QLineEdit; ADD_META( VLC_META_ENCODED_BY, encodedby_text, 0, 7 ); line++;
l->addWidget( setting_text, line, 6, 1, 4 ); */ ADD_META( N_("Comments"), description_text, 0, 7 ); line++;
/* Less used metadata */ /* VLC_META_SETTING: Useless */
#define ADD_META_2( string, widget ) { \ /* ADD_META( TRACKID ) Useless ? */
metaLayout->addWidget( new QLabel( qtr( string ) + " :" ), line, 0 ); \ /* ADD_URI - Do not show it, done outside */
widget = new QLineEdit; \
metaLayout->addWidget( widget, line, 1, 1, 7 ); \
line++; }
/* Now Playing - Useful for live feeds (HTTP, DVB, ETC...) */
ADD_META_2( VLC_META_NOW_PLAYING, nowplaying_text );
nowplaying_text->setReadOnly( true );
ADD_META_2( VLC_META_PUBLISHER, publisher_text );
ADD_META_2( VLC_META_COPYRIGHT, copyright_text );
ADD_META_2( N_("Comments"), description_text );
/* useless metadata */
//ADD_META_2( VLC_META_ENCODED_BY, encodedby_text ); metaLayout->setColumnStretch( 1, 20 );
/* ADD_META( TRACKID ) Useless ? */
/* ADD_URI - DO not show it, done outside */
metaLayout->setColumnStretch( 1, 2 );
metaLayout->setColumnMinimumWidth ( 1, 80 ); metaLayout->setColumnMinimumWidth ( 1, 80 );
metaLayout->setRowStretch( line, 10 ); metaLayout->setRowStretch( line, 10 );
#undef ADD_META #undef ADD_META
#undef ADD_META_2
CONNECT( title_text, textEdited( QString ), this, enterEditMode() );
CONNECT( artist_text, textEdited( QString ), this, enterEditMode() );
CONNECT( collection_text, textEdited( QString ), this, enterEditMode() );
CONNECT( genre_text, textEdited( QString ), this, enterEditMode() );
CONNECT( seqnum_text, textEdited( QString ), this, enterEditMode() ); CONNECT( seqnum_text, textEdited( QString ), this, enterEditMode() );
CONNECT( seqtot_text, textEdited( QString ), this, enterEditMode() );
CONNECT( date_text, textEdited( QString ), this, enterEditMode() ); CONNECT( date_text, textEdited( QString ), this, enterEditMode() );
CONNECT( description_text, textEdited( QString ), this, enterEditMode() );
/* CONNECT( rating_text, valueChanged( QString ), this, enterEditMode( QString ) );*/ /* CONNECT( rating_text, valueChanged( QString ), this, enterEditMode( QString ) );*/
/* We are not yet in Edit Mode */ /* We are not yet in Edit Mode */
...@@ -222,12 +222,11 @@ void MetaPanel::update( input_item_t *p_item ) ...@@ -222,12 +222,11 @@ void MetaPanel::update( input_item_t *p_item )
UPDATE_META( Language, language_text ); UPDATE_META( Language, language_text );
UPDATE_META( NowPlaying, nowplaying_text ); UPDATE_META( NowPlaying, nowplaying_text );
UPDATE_META( Publisher, publisher_text ); UPDATE_META( Publisher, publisher_text );
// UPDATE_META( Setting, setting_text ); UPDATE_META( EncodedBy, encodedby_text );
//FIXME this is wrong if has Publisher and EncodedBy fields
UPDATE_META( EncodedBy, publisher_text );
UPDATE_META( Date, date_text ); UPDATE_META( Date, date_text );
UPDATE_META( TrackNum, seqnum_text ); UPDATE_META( TrackNum, seqnum_text );
// UPDATE_META( Setting, setting_text );
// UPDATE_META_INT( Rating, rating_text ); // UPDATE_META_INT( Rating, rating_text );
#undef UPDATE_META_INT #undef UPDATE_META_INT
......
...@@ -71,6 +71,8 @@ private: ...@@ -71,6 +71,8 @@ private:
QLineEdit *copyright_text; QLineEdit *copyright_text;
QLineEdit *collection_text; QLineEdit *collection_text;
QLineEdit *seqnum_text; QLineEdit *seqnum_text;
QLineEdit *seqtot_text;
QLineEdit *description_text; QLineEdit *description_text;
// QSpinBox *rating_text; // QSpinBox *rating_text;
QLineEdit *date_text; QLineEdit *date_text;
...@@ -78,7 +80,7 @@ private: ...@@ -78,7 +80,7 @@ private:
QLineEdit *language_text; QLineEdit *language_text;
QLineEdit *nowplaying_text; QLineEdit *nowplaying_text;
QLineEdit *publisher_text; QLineEdit *publisher_text;
// QLineEdit *encodedby_text; QLineEdit *encodedby_text;
CoverArtLabel *art_cover; CoverArtLabel *art_cover;
public slots: public slots:
......
...@@ -51,15 +51,17 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, ...@@ -51,15 +51,17 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
setWindowTitle( qtr( "Media Information" ) ); setWindowTitle( qtr( "Media Information" ) );
setWindowRole( "vlc-media-info" ); setWindowRole( "vlc-media-info" );
setWindowFlags( Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
/* TabWidgets and Tabs creation */ /* TabWidgets and Tabs creation */
infoTabW = new QTabWidget; infoTabW = new QTabWidget;
MP = new MetaPanel( infoTabW, p_intf ); MP = new MetaPanel( infoTabW, p_intf );
infoTabW->addTab( MP, qtr( "&General" ) ); infoTabW->addTab( MP, qtr( "&General" ) );
EMP = new ExtraMetaPanel( infoTabW, p_intf ); EMP = new ExtraMetaPanel( infoTabW, p_intf );
infoTabW->addTab( EMP, qtr( "&Extra Metadata" ) ); infoTabW->addTab( EMP, qtr( "&Metadata" ) );
IP = new InfoPanel( infoTabW, p_intf ); IP = new InfoPanel( infoTabW, p_intf );
infoTabW->addTab( IP, qtr( "&Codec Details" ) ); infoTabW->addTab( IP, qtr( "&Codec" ) );
if( isMainInputInfo ) if( isMainInputInfo )
{ {
ISP = new InputStatsPanel( infoTabW, p_intf ); ISP = new InputStatsPanel( infoTabW, p_intf );
......
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