]> git.sesse.net Git - vlc/commitdiff
*Qt4: InfoTabs, the layout..
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 17 Sep 2006 12:15:42 +0000 (12:15 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 17 Sep 2006 12:15:42 +0000 (12:15 +0000)
modules/gui/qt4/components/infopanels.cpp
modules/gui/qt4/components/infopanels.hpp
modules/gui/qt4/dialogs/streaminfo.cpp
modules/gui/qt4/dialogs/streaminfo.hpp

index 01ae14388093edebc2c19acbab667feb5b9b0621..b4fb3fcd6547b944143cc9b6966a3f56f0fa3209 100644 (file)
@@ -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()
+{
+}
+
index 4f3dca8e14a7d363f84cc52d01592bf47bdfae2f..c9b335871476472a879ce59873c5c82a8d7bf4b0 100644 (file)
 
 #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
index 799a572766218b7401dbd62cd0c8803cfa4eed52..126748336533f54de5c189a756bbc96e0e61c1f0 100644 (file)
  * 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 );
+}
+
index c5cdaa9405d07f77bef13588c385f7b166209d81..0eb7c553b992ffd8d0a03b8144ca3b5729920c74 100644 (file)
 #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