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

Qt4 - Meta Information, again. Add URI/URL support. Fix a bug.

parent 460774aa
...@@ -100,10 +100,10 @@ MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) : ...@@ -100,10 +100,10 @@ MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
ADD_META( VLC_META_DESCRIPTION, description_text ); // Comment Two lines? ADD_META( VLC_META_DESCRIPTION, description_text ); // Comment Two lines?
/* ADD_META( TRACKID) DO NOT SHOW it */ /* ADD_META( TRACKID) DO NOT SHOW it */
/* ADD_URI - DO not show it, done outside */
// ADD_META( _( "URI" ), uri_text ); // FIXME URI outside
// ADD_META( VLC_META_URL, setting_text );
/* ART_URL */ /* ART_URL */
// ADD_META( VLC_META_URL, setting_text );
} }
MetaPanel::~MetaPanel() MetaPanel::~MetaPanel()
...@@ -123,7 +123,7 @@ void MetaPanel::update( input_item_t *p_item ) ...@@ -123,7 +123,7 @@ void MetaPanel::update( input_item_t *p_item )
#define UPDATE_META_INT( meta, widget ) { \ #define UPDATE_META_INT( meta, widget ) { \
psz_meta = p_item->p_meta->psz_##meta; \ psz_meta = p_item->p_meta->psz_##meta; \
if( !EMPTY_STR( psz_meta ) ) \ if( !EMPTY_STR( psz_meta ) ) \
widget->setValue( atoi( psz_meta ) ); }/*FIXME Atoi ?*/ widget->setValue( atoi( psz_meta ) ); }
/* Name / Title */ /* Name / Title */
psz_meta = p_item->p_meta->psz_title; psz_meta = p_item->p_meta->psz_title;
...@@ -133,10 +133,14 @@ void MetaPanel::update( input_item_t *p_item ) ...@@ -133,10 +133,14 @@ void MetaPanel::update( input_item_t *p_item )
title_text->setText( qfu( p_item->psz_name ) ); title_text->setText( qfu( p_item->psz_name ) );
else title_text->setText( "" ); else title_text->setText( "" );
/* if( !EMPTY_STR( p_item->psz_uri ) ) /* URL / URI */
uri_text->setText( qfu( p_item->psz_uri ) );*/ psz_meta = p_item->p_meta->psz_url;
/// else uri_text->setText( "" ); if( !EMPTY_STR( psz_meta ) )
emit uriSet( QString( psz_meta ) );
else if( !EMPTY_STR( p_item->psz_uri ) )
emit uriSet( QString( p_item->psz_uri ) );
/* Other classic though */
UPDATE_META( artist, artist_text ); UPDATE_META( artist, artist_text );
UPDATE_META( genre, genre_text ); UPDATE_META( genre, genre_text );
UPDATE_META( copyright, copyright_text ); UPDATE_META( copyright, copyright_text );
......
...@@ -72,6 +72,8 @@ private: ...@@ -72,6 +72,8 @@ private:
public slots: public slots:
void update( input_item_t * ); void update( input_item_t * );
void clear(); void clear();
signals:
void uriSet( QString );
}; };
class ExtraMetaPanel: public QWidget class ExtraMetaPanel: public QWidget
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
******************************************************************************/ ******************************************************************************/
#include <QTabWidget>
#include <QGridLayout>
#include "dialogs/mediainfo.hpp" #include "dialogs/mediainfo.hpp"
#include "input_manager.hpp" #include "input_manager.hpp"
#include "dialogs_provider.hpp" #include "dialogs_provider.hpp"
...@@ -32,6 +29,10 @@ ...@@ -32,6 +29,10 @@
#include "components/infopanels.hpp" #include "components/infopanels.hpp"
#include "qt4.hpp" #include "qt4.hpp"
#include <QTabWidget>
#include <QGridLayout>
#include <QLineEdit>
#include <QLabel>
static int ItemChanged( vlc_object_t *p_this, const char *psz_var, static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *param ); vlc_value_t oldval, vlc_value_t newval, void *param );
...@@ -66,10 +67,16 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput, ...@@ -66,10 +67,16 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput,
QPushButton *closeButton = new QPushButton( qtr( "&Close" ) ); QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
closeButton->setDefault( true ); closeButton->setDefault( true );
uriLine = new QLineEdit;
QLabel *uriLabel = new QLabel( qtr( "Location" ) );
layout->addWidget( IT, 0, 0, 1, 3 ); layout->addWidget( IT, 0, 0, 1, 3 );
layout->addWidget( closeButton, 1, 2 ); layout->addWidget( closeButton, 2, 2 );
layout->addWidget( uriLine, 1, 1, 1, 2 );
layout->addWidget( uriLabel, 1, 0, 1, 1 );
BUTTONACT( closeButton, close() ); BUTTONACT( closeButton, close() );
CONNECT( MP, uriSet( QString ), uriLine, setText( QString ) );
if( mainInput ) { if( mainInput ) {
ON_TIMEOUT( update() ); ON_TIMEOUT( update() );
...@@ -109,7 +116,6 @@ void MediaInfoDialog::setInput(input_item_t *p_input) ...@@ -109,7 +116,6 @@ void MediaInfoDialog::setInput(input_item_t *p_input)
void MediaInfoDialog::update() void MediaInfoDialog::update()
{ {
msg_Dbg( p_intf, "updating MetaData Info" );
/* Timer runs at 150 ms, dont' update more than 2 times per second */ /* Timer runs at 150 ms, dont' update more than 2 times per second */
if( i_runs % 3 != 0 ) return; if( i_runs % 3 != 0 ) return;
i_runs++; i_runs++;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
class QTabWidget; class QTabWidget;
class InfoTab; class InfoTab;
class QLineEdit;
class MediaInfoDialog : public QVLCFrame class MediaInfoDialog : public QVLCFrame
{ {
...@@ -53,6 +54,7 @@ public: ...@@ -53,6 +54,7 @@ public:
void showTab( int ); void showTab( int );
bool need_update; bool need_update;
void setInput( input_item_t * ); void setInput( input_item_t * );
QLineEdit *uriLine;
private: private:
input_thread_t *p_input; input_thread_t *p_input;
QTabWidget *IT; QTabWidget *IT;
......
...@@ -176,7 +176,7 @@ void DialogsProvider::mediaInfoDialog() ...@@ -176,7 +176,7 @@ void DialogsProvider::mediaInfoDialog()
void DialogsProvider::mediaCodecDialog() void DialogsProvider::mediaCodecDialog()
{ {
MediaInfoDialog::getInstance( p_intf )->showTab( 1 ); MediaInfoDialog::getInstance( p_intf )->showTab( 2 );
} }
void DialogsProvider::bookmarksDialog() void DialogsProvider::bookmarksDialog()
......
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