From d269a39f27e2dcd57d0e3362ef3a7fd9ad3f3639 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 17 May 2011 13:24:19 +0000 Subject: GatsCon can read files now, but it can't save them, or edit them yet. That'll be coming eventually. --- src/gatscon/filewidget.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/gatscon/filewidget.cpp (limited to 'src/gatscon/filewidget.cpp') diff --git a/src/gatscon/filewidget.cpp b/src/gatscon/filewidget.cpp new file mode 100644 index 0000000..b2dd09e --- /dev/null +++ b/src/gatscon/filewidget.cpp @@ -0,0 +1,39 @@ +#include "filewidget.h" + +#include "gatstotree.h" + +#include +#include +#include + +using namespace Bu; + +FileWidget::FileWidget( QWidget *pParent ) : + QWidget( pParent ) +{ + setupUi( this ); +} + +FileWidget::FileWidget( QWidget *pParent, QString sFile ) : + QWidget( pParent ) +{ + setupUi( this ); + + File fIn( sFile.toAscii().constData(), File::Read ); + Gats::GatsStream gsIn( fIn ); + Gats::Object *pObj; + while( (pObj = gsIn.readObject()) ) + { + QTreeWidgetItem *pNew = new QTreeWidgetItem( + twGats->invisibleRootItem() + ); + pNew->setText( 0, "" ); + gatsToTree( pNew, pObj ); + delete pObj; + } +} + +FileWidget::~FileWidget() +{ +} + -- cgit v1.2.3