aboutsummaryrefslogtreecommitdiff
path: root/src/gatscon/clientwidget.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-05-17 14:56:28 +0000
committerMike Buland <eichlan@xagasoft.com>2011-05-17 14:56:28 +0000
commit6d8bc516acf7a5995736423e838c987d08e69c09 (patch)
tree9db78ee528b26e0d5718b2ac4c987388e1b9c313 /src/gatscon/clientwidget.cpp
parentd269a39f27e2dcd57d0e3362ef3a7fd9ad3f3639 (diff)
downloadlibgats-6d8bc516acf7a5995736423e838c987d08e69c09.tar.gz
libgats-6d8bc516acf7a5995736423e838c987d08e69c09.tar.bz2
libgats-6d8bc516acf7a5995736423e838c987d08e69c09.tar.xz
libgats-6d8bc516acf7a5995736423e838c987d08e69c09.zip
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.
Diffstat (limited to 'src/gatscon/clientwidget.cpp')
-rw-r--r--src/gatscon/clientwidget.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gatscon/clientwidget.cpp b/src/gatscon/clientwidget.cpp
index 0ea04a3..c9cb4c1 100644
--- a/src/gatscon/clientwidget.cpp
+++ b/src/gatscon/clientwidget.cpp
@@ -2,11 +2,14 @@
2#include "clientthread.h" 2#include "clientthread.h"
3 3
4#include "gatstotree.h" 4#include "gatstotree.h"
5#include "treetogats.h"
5 6
6#include <QMessageBox> 7#include <QMessageBox>
7 8
9#include <gats/gatsstream.h>
8#include <bu/tcpsocket.h> 10#include <bu/tcpsocket.h>
9#include <bu/sio.h> 11#include <bu/sio.h>
12#include <bu/file.h>
10 13
11using namespace Bu; 14using namespace Bu;
12 15
@@ -27,6 +30,19 @@ ClientWidget::~ClientWidget()
27{ 30{
28} 31}
29 32
33void ClientWidget::saveTo( const QString &sFile )
34{
35 File fOut( sFile.toAscii().constData(), File::WriteNew );
36 Gats::GatsStream gsOut( fOut );
37 QTreeWidgetItem *pRoot = twHistory->invisibleRootItem();
38 for( int j = 0; j < pRoot->childCount(); j++ )
39 {
40 Gats::Object *pObj = treeToGats( pRoot->child( j ) );
41 gsOut.writeObject( pObj );
42 delete pObj;
43 }
44}
45
30void ClientWidget::send() 46void ClientWidget::send()
31{ 47{
32 try 48 try