From 6d8bc516acf7a5995736423e838c987d08e69c09 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 17 May 2011 14:56:28 +0000 Subject: Ok, you can now open files, save files, save files from proxies and clients, and add new root items to files. Later I'll add some actual editing capabilities, should be really easy. --- src/gatscon/proxywidget.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/gatscon/proxywidget.cpp') diff --git a/src/gatscon/proxywidget.cpp b/src/gatscon/proxywidget.cpp index 28bd1fc..3792e31 100644 --- a/src/gatscon/proxywidget.cpp +++ b/src/gatscon/proxywidget.cpp @@ -2,11 +2,14 @@ #include "proxythread.h" #include "gatstotree.h" +#include "treetogats.h" #include +#include #include #include +#include using namespace Bu; @@ -33,6 +36,19 @@ ProxyWidget::~ProxyWidget() { } +void ProxyWidget::saveTo( const QString &sFile ) +{ + File fOut( sFile.toAscii().constData(), File::WriteNew ); + Gats::GatsStream gsOut( fOut ); + QTreeWidgetItem *pRoot = twHistory->invisibleRootItem(); + for( int j = 0; j < pRoot->childCount(); j++ ) + { + Gats::Object *pObj = treeToGats( pRoot->child( j ) ); + gsOut.writeObject( pObj ); + delete pObj; + } +} + void ProxyWidget::sendToClient() { try -- cgit v1.2.3