Commit e654a86d authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Move the Write MetaData button outside of the component part because it...

Qt4 - Move the Write MetaData button outside of the component part because it is more expected to be in the main dialog.

parent b6198c88
......@@ -115,11 +115,6 @@ MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
ADD_META_B( VLC_META_ENCODED_BY, publisher_text );
ADD_META_B( VLC_META_DESCRIPTION, description_text ); // Comment Two lines?
QPushButton *write = new QPushButton( qtr( "&Write" ) );
l->addWidget( write, line, 0 );
BUTTONACT( write, saveMeta() );
/* ADD_META( TRACKID) DO NOT SHOW it */
/* ADD_URI - DO not show it, done outside */
......
......@@ -49,8 +49,7 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
setWindowTitle( qtr( "Media information" ) );
resize( 700 , 450 );
QGridLayout *layout = new QGridLayout( this );
/* TabWidgets and Tabs creation */
IT = new QTabWidget;
MP = new MetaPanel( IT, p_intf );
IT->addTab( MP, qtr( "&General" ) );
......@@ -64,6 +63,10 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
IT->addTab( ISP, qtr( "&Stats" ) );
}
QGridLayout *layout = new QGridLayout( this );
/* FIXME GNOME/KDE ? */
saveMetaButton = new QPushButton( qtr( "&Save Metadata" ) );
QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
closeButton->setDefault( true );
......@@ -72,12 +75,22 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
layout->addWidget( IT, 0, 0, 1, 7 );
layout->addWidget( closeButton, 2, 6 );
layout->addWidget( saveMetaButton, 2, 5 );
layout->addWidget( uriLabel, 1, 0, 1, 1 );
layout->addWidget( uriLine, 1, 1, 1, 6 );
BUTTONACT( closeButton, close() );
/* The tabs buttons are shown in the main dialog for space and cosmetics */
CONNECT( saveMetaButton, clicked(), MP, saveMeta() );
/* Let the MetaData Panel update the URI */
CONNECT( MP, uriSet( QString ), uriLine, setText( QString ) );
CONNECT( IT, currentChanged ( int ), this, updateButtons( int ) );
/* Create the main Update function with a time (150ms) */
if( mainInput ) {
ON_TIMEOUT( update() );
var_AddCallback( THEPL, "item-change", ItemChanged, this );
......@@ -170,3 +183,11 @@ void MediaInfoDialog::close()
deleteLater();
}
}
void MediaInfoDialog::updateButtons( int i_tab )
{
msg_Dbg( p_intf, "Coin Coin, Tab number: %i", i_tab );
if( i_tab == 0 ) saveMetaButton->show();
else saveMetaButton->hide();
}
......@@ -66,11 +66,13 @@ private:
MetaPanel *MP;
InfoPanel *IP;
ExtraMetaPanel *EMP;
QPushButton *saveMetaButton;
public slots:
void update();
void update( input_item_t *, bool, bool );
void close();
void clear();
void updateButtons( int i_tab );
};
#endif
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