From 9effad543ef68faa4e4d66cff71fde4d65804166 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Wed, 20 Sep 2006 19:37:51 +0000 Subject: [PATCH] *Qt4: InfoTree for files. The timer does not function correctly yet. :D --- modules/gui/qt4/components/infopanels.cpp | 37 +++++++++++++++++++++++ modules/gui/qt4/components/infopanels.hpp | 2 ++ modules/gui/qt4/dialogs/streaminfo.cpp | 4 +++ 3 files changed, 43 insertions(+) diff --git a/modules/gui/qt4/components/infopanels.cpp b/modules/gui/qt4/components/infopanels.cpp index b4fb3fcd65..64beb2e602 100644 --- a/modules/gui/qt4/components/infopanels.cpp +++ b/modules/gui/qt4/components/infopanels.cpp @@ -26,6 +26,8 @@ #include #include +#include +#include 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 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() { } diff --git a/modules/gui/qt4/components/infopanels.hpp b/modules/gui/qt4/components/infopanels.hpp index c9b3358714..6cd93aba85 100644 --- a/modules/gui/qt4/components/infopanels.hpp +++ b/modules/gui/qt4/components/infopanels.hpp @@ -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 * ); diff --git a/modules/gui/qt4/dialogs/streaminfo.cpp b/modules/gui/qt4/dialogs/streaminfo.cpp index 9051ad7216..3c183bc55e 100644 --- a/modules/gui/qt4/dialogs/streaminfo.cpp +++ b/modules/gui/qt4/dialogs/streaminfo.cpp @@ -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 ); + } } -- 2.39.5