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