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

*Qt4: InfoTabs, the layout..

parent 187a6ea2
......@@ -23,8 +23,9 @@
#include "components/infopanels.hpp"
#include "qt4.hpp"
#include "ui/input_stats.h"
#include <QWidget>
#include <QTreeWidget>
#include <QPushButton>
InputStatsPanel::InputStatsPanel( QWidget *parent, intf_thread_t *_p_intf ) :
QWidget( parent ), p_intf( _p_intf )
......@@ -71,3 +72,49 @@ void InputStatsPanel::Update( input_item_t *p_item )
vlc_mutex_unlock(& p_item->p_stats->lock );
}
void InputStatsPanel::Clear()
{
}
MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
QWidget( parent ), p_intf( _p_intf )
{
}
MetaPanel::~MetaPanel()
{
}
void MetaPanel::Update( input_item_t *p_item)
{
}
void MetaPanel::Clear()
{
}
char* MetaPanel::GetURI()
{
char *URI;
return URI;
}
char* MetaPanel::GetName()
{
char *Name;
return Name;
}
InfoPanel::InfoPanel( QWidget *parent, intf_thread_t *_p_intf ) :
QWidget( parent ), p_intf( _p_intf )
{
}
InfoPanel::~InfoPanel()
{
}
void InfoPanel::Update( input_item_t *p_item)
{
}
void InfoPanel::Clear()
{
}
......@@ -23,10 +23,17 @@
#ifndef _INFOPANELS_H_
#define _INFOPANELS_H_
#include <vlc/vlc.h>
#include <vlc_meta.h>
#include <QWidget>
#include "ui/input_stats.h"
class QTreeWidget;
class InputStatsPanel: public QWidget
{
Q_OBJECT;
......@@ -39,7 +46,38 @@ private:
public slots:
void Update( input_item_t * );
void Clear();
};
class MetaPanel: public QWidget
{
Q_OBJECT;
public:
MetaPanel( QWidget *, intf_thread_t * );
virtual ~MetaPanel();
private:
intf_thread_t *p_intf;
public slots:
void Update( input_item_t * );
void Clear();
char* GetURI();
char* GetName();
};
class InfoPanel: public QWidget
{
Q_OBJECT;
public:
InfoPanel( QWidget *, intf_thread_t * );
virtual ~InfoPanel();
private:
intf_thread_t *p_intf;
public slots:
void Update( input_item_t * );
void Clear();
};
#endif
......@@ -20,32 +20,74 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
#include "input_manager.hpp"
#include <QTabWidget>
#include <QBoxLayout>
#include "dialogs/streaminfo.hpp"
#include "input_manager.hpp"
#include "dialogs_provider.hpp"
#include "util/qvlcframe.hpp"
#include "components/infopanels.hpp"
#include "qt4.hpp"
/* This is the dialog Windows */
StreamInfoDialog *StreamInfoDialog::instance = NULL;
StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf, bool _main_input ) :
QVLCFrame( _p_intf ), main_input( _main_input )
{
setWindowTitle( _("Stream information" ) );
ISP = new InputStatsPanel( this, p_intf );
QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom,this);
setGeometry(0,0,470,550);
IT = new InfoTab( this, p_intf) ;
QPushButton *closeButton = new QPushButton(qtr("&Close"));
layout->addWidget(IT);
layout->addWidget(closeButton);
BUTTONACT( closeButton, close() );
ON_TIMEOUT( update() );
p_input = NULL;
}
void StreamInfoDialog::update()
{
if( main_input )
p_input = MainInputManager::getInstance( p_intf )->getInput();
if( p_input && !p_input->b_dead )
ISP->Update( p_input->input.p_item );
IT->update();
}
StreamInfoDialog::~StreamInfoDialog()
{
}
void StreamInfoDialog::close()
{
this->toggleVisible();
}
/* This is the tab Widget Inside the windows*/
InfoTab::InfoTab( QWidget *parent, intf_thread_t *_p_intf ) :
QTabWidget( parent ), p_intf( _p_intf )
{
setGeometry(0, 0, 400, 500);
ISP = new InputStatsPanel( NULL, p_intf );
MP = new MetaPanel(NULL, p_intf);
IP = new InfoPanel(NULL, p_intf);
addTab(MP, qtr("&Meta"));
addTab(ISP, qtr("&Stats"));
addTab(IP, qtr("&Info"));
}
InfoTab::~InfoTab()
{
}
void InfoTab::update()
{
if( p_intf )
p_input = MainInputManager::getInstance( p_intf )->getInput();
if( p_input && !p_input->b_dead )
ISP->Update( p_input->input.p_item );
}
......@@ -24,8 +24,30 @@
#define _STREAMINFO_DIALOG_H_
#include "util/qvlcframe.hpp"
#include <QTabWidget>
#include <QBoxLayout>
class InputStatsPanel;
class MetaPanel;
class InfoPanel;
class InfoTab: public QTabWidget
{
Q_OBJECT;
public:
InfoTab( QWidget *, intf_thread_t * );
virtual ~InfoTab();
private:
intf_thread_t *p_intf;
input_thread_t *p_input;
InputStatsPanel *ISP;
MetaPanel *MP;
InfoPanel *IP;
public slots:
void update();
};
class StreamInfoDialog : public QVLCFrame
{
......@@ -41,11 +63,12 @@ public:
private:
StreamInfoDialog( intf_thread_t *, bool );
input_thread_t *p_input;
InputStatsPanel *ISP;
InfoTab *IT;
bool main_input;
static StreamInfoDialog *instance;
public slots:
void update();
void close();
};
#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