]> git.sesse.net Git - vlc/commitdiff
*Qt4: InfoTree for files. The timer does not function correctly yet. :D
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 20 Sep 2006 19:37:51 +0000 (19:37 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 20 Sep 2006 19:37:51 +0000 (19:37 +0000)
modules/gui/qt4/components/infopanels.cpp
modules/gui/qt4/components/infopanels.hpp
modules/gui/qt4/dialogs/streaminfo.cpp

index b4fb3fcd6547b944143cc9b6966a3f56f0fa3209..64beb2e6023523738c3381472faa6a08b044ba83 100644 (file)
@@ -26,6 +26,8 @@
 
 #include <QTreeWidget>
 #include <QPushButton>
+#include <QHeaderView>
+#include <QList>
 
 InputStatsPanel::InputStatsPanel( QWidget *parent, intf_thread_t *_p_intf ) :
                                   QWidget( parent ), p_intf( _p_intf )
@@ -107,13 +109,48 @@ char* MetaPanel::GetName()
 InfoPanel::InfoPanel( QWidget *parent, intf_thread_t *_p_intf ) :
                                       QWidget( parent ), p_intf( _p_intf )
 {
+     resize(400, 500);
+     QGridLayout *layout = new QGridLayout(this);
+     InfoTree = new QTreeWidget(this);
+     QList<QTreeWidgetItem *> items;
+
+     layout->addWidget(InfoTree, 0, 0 );
+     InfoTree->setColumnCount( 1 );
+     InfoTree->header()->hide();
+     InfoTree->resize(400, 400);
+
 }
+
 InfoPanel::~InfoPanel()
 {
 }
+
 void InfoPanel::Update( input_item_t *p_item)
 {
+    InfoTree->clear();
+    QTreeWidgetItem *current_item = NULL;
+    QTreeWidgetItem *child_item = NULL;
+
+    for( int i = 0; i< p_item->i_categories ; i++)
+    {
+        current_item = new QTreeWidgetItem();
+        current_item->setText( 0, qfu(p_item->pp_categories[i]->psz_name) );
+        InfoTree->addTopLevelItem( current_item );
+
+        for( int j = 0 ; j < p_item->pp_categories[i]->i_infos ; j++ )
+        {
+            child_item = new QTreeWidgetItem ();
+            child_item->setText( 0,
+                    qfu(p_item->pp_categories[i]->pp_infos[j]->psz_name)
+                    + ": "
+                    + qfu(p_item->pp_categories[i]->pp_infos[j]->psz_value));
+
+            current_item->addChild(child_item);
+        }
+         InfoTree->setItemExpanded( current_item, true);
+    }
 }
+
 void InfoPanel::Clear()
 {
 }
index c9b335871476472a879ce59873c5c82a8d7bf4b0..6cd93aba8538190b1ccbbb9440b238b0bd18dd5c 100644 (file)
@@ -33,6 +33,7 @@
 
 
 class QTreeWidget;
+class QTreeWidgetItem;
 
 class InputStatsPanel: public QWidget
 {
@@ -74,6 +75,7 @@ public:
     virtual ~InfoPanel();
 private:
     intf_thread_t *p_intf;
+    QTreeWidget *InfoTree;
 
 public slots:
     void Update( input_item_t * );
index 9051ad7216d07aa3720a0604505ddf623adc98de..3c183bc55ea906338e33072af0f7fbf9a51129fb 100644 (file)
@@ -88,6 +88,10 @@ 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 );
+        // FIXME should not be updated here 
+        IP->Update( p_input->input.p_item );
+    }
 }