#undef ADD_META
#undef ADD_META_2
+ ReadOnly( true );
}
MetaPanel::~MetaPanel(){}
**/
void MetaPanel::saveMeta()
{
+ ReadOnly( true );
playlist_t *p_playlist;
char psz[5];
pl_Release( p_playlist );
}
+void MetaPanel::ReadOnly(bool readonly)
+{
+ title_text->setReadOnly( readonly );
+ artist_text->setReadOnly( readonly );
+ collection_text->setReadOnly( readonly );
+ genre_text->setReadOnly( readonly );
+ date_text->setReadOnly( readonly );
+ seqnum_text->setReadOnly( readonly );
+ rating_text->setReadOnly( readonly );
+ language_text->setReadOnly( readonly );
+ setting_text->setReadOnly( readonly );
+ copyright_text->setReadOnly( readonly );
+ publisher_text->setReadOnly( readonly );
+ description_text->setReadOnly( readonly );
+
+}
+
+void MetaPanel::editMeta()
+{
+ ReadOnly( false );
+}
+
/**
* Update all the MetaData and art on an "item-changed" event
**/
QGridLayout *layout = new QGridLayout( this );
/* FIXME GNOME/KDE ? */
+ editMetaButton = new QPushButton( qtr( "&Edit Metadata" ) );
saveMetaButton = new QPushButton( qtr( "&Save Metadata" ) );
+ saveMetaButton->hide();
QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
closeButton->setDefault( true );
layout->addWidget( uriLabel, 1, 0, 1, 1 );
layout->addWidget( uriLine, 1, 1, 1, 7 );
layout->addWidget( saveMetaButton, 2, 6 );
+ layout->addWidget( editMetaButton, 2, 6 );
layout->addWidget( closeButton, 2, 7 );
BUTTONACT( closeButton, close() );
/* The tabs buttons are shown in the main dialog for space and cosmetics */
- CONNECT( saveMetaButton, clicked(), MP, saveMeta() );
+ CONNECT( saveMetaButton, clicked(), this, saveMeta() );
+ CONNECT( editMetaButton, clicked(), this, editMeta() );
/* Let the MetaData Panel update the URI */
CONNECT( MP, uriSet( QString ), uriLine, setText( QString ) );
IT->setCurrentIndex( i_tab );
}
+void MediaInfoDialog::editMeta()
+{
+ in_edit = true;
+ editMetaButton->hide();
+ saveMetaButton->show();
+ MP->editMeta();
+}
+
+void MediaInfoDialog::saveMeta()
+{
+ MP->saveMeta();
+ editMetaButton->show();
+ saveMetaButton->hide();
+ in_edit = false;
+}
+
static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param )
{
void MediaInfoDialog::update( input_item_t *p_item, bool update_info,
bool update_meta )
{
+ if( in_edit ) return;
MP->p_input = p_item;
if( update_info )
IP->update( p_item );
void MediaInfoDialog::close()
{
+ in_edit = false;
this->toggleVisible();
if( mainInput == false ) {