Commit 9b14cc45 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Media Info. Re-add some info for DVB. Clean the in_Edit state that was...

Qt4 - Media Info. Re-add some info for DVB. Clean the in_Edit state that was stored two times in different classes.

parent fdd5a55a
This diff is collapsed.
......@@ -55,32 +55,38 @@ public:
virtual ~MetaPanel();
void saveMeta();
void setInput( input_item_t * );
void setEdit( bool );
bool isInEditMode();
void setEditMode( bool );
private:
input_item_t *p_input;
intf_thread_t *p_intf;
bool b_inEditMode;
QLineEdit *uri_text;
QLineEdit *title_text;
QLineEdit *artist_text;
QLineEdit *genre_text;
// QLineEdit *copyright_text;
QLineEdit *copyright_text;
QLineEdit *collection_text;
QLineEdit *seqnum_text;
// QLineEdit *description_text;
QLineEdit *description_text;
QSpinBox *rating_text;
QLineEdit *date_text;
// QLineEdit *setting_text;
QLineEdit *language_text;
// QLineEdit *nowplaying_text;
// QLineEdit *publisher_text;
QLineEdit *nowplaying_text;
QLineEdit *publisher_text;
// QLineEdit *encodedby_text;
QLabel *art_cover;
bool in_edit;
public slots:
void update( input_item_t * );
void clear();
void editMeta( QString );
private slots:
void enterEditMode();
signals:
void uriSet( QString );
void editing();
......
......@@ -88,10 +88,9 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
/* Let the MetaData Panel update the URI */
CONNECT( MP, uriSet( QString ), uriLine, setText( QString ) );
CONNECT( MP, editing(), this, editMeta() );
CONNECT( IT, currentChanged ( int ), this, updateButtons( int ) );
CONNECT( MP, editing( bool ), this, editMeta( bool ) );
CONNECT( IT, currentChanged( int ), this, updateButtons( int ) );
/* Create the main Update function with a time (150ms) */
if( mainInput ) {
......@@ -114,6 +113,8 @@ void MediaInfoDialog::showTab( int i_tab = 0 )
IT->setCurrentIndex( i_tab );
}
/**/
void MediaInfoDialog::editMeta()
{
saveMetaButton->show();
......@@ -144,11 +145,8 @@ void MediaInfoDialog::setInput( input_item_t *p_input )
*/
input_thread_t *p_current =
MainInputManager::getInstance( p_intf )->getInput();
if( !p_current || p_current->b_dead )
in_edit = true;
else
in_edit = ( input_GetItem( p_current ) != p_input );
MP->setEdit( in_edit );
MP->setEditMode( ( !p_current || p_current->b_dead ) ?
true: false );
}
void MediaInfoDialog::update()
......@@ -174,7 +172,8 @@ void MediaInfoDialog::update()
vlc_object_release( p_input );
}
void MediaInfoDialog::update( input_item_t *p_item, bool update_info,
void MediaInfoDialog::update( input_item_t *p_item,
bool update_info,
bool update_meta )
{
MP->setInput( p_item );
......@@ -204,15 +203,12 @@ void MediaInfoDialog::close()
if( mainInput == false ) {
deleteLater();
}
MP->setEdit( false );
in_edit = false;
MP->setEditMode( false );
}
void MediaInfoDialog::updateButtons( int i_tab )
{
msg_Dbg( p_intf, "Coin Coin, Tab number: %i", i_tab );
if( in_edit and i_tab == 0 )
if( MP->isInEditMode() && i_tab == 0 )
saveMetaButton->show();
else
saveMetaButton->hide();
......
......@@ -62,13 +62,11 @@ private:
int i_runs;
bool mainInput;
bool stats;
bool in_edit;
InputStatsPanel *ISP;
MetaPanel *MP;
InfoPanel *IP;
ExtraMetaPanel *EMP;
QPushButton *saveMetaButton;
QPushButton *editMetaButton;
public slots:
void update();
void saveMeta();
......
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