diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-05-17 14:56:28 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-05-17 14:56:28 +0000 |
commit | 6d8bc516acf7a5995736423e838c987d08e69c09 (patch) | |
tree | 9db78ee528b26e0d5718b2ac4c987388e1b9c313 /src/gatscon/proxywidget.cpp | |
parent | d269a39f27e2dcd57d0e3362ef3a7fd9ad3f3639 (diff) | |
download | libgats-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/proxywidget.cpp')
-rw-r--r-- | src/gatscon/proxywidget.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ | |||
2 | #include "proxythread.h" | 2 | #include "proxythread.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 <gats/types.h> | 10 | #include <gats/types.h> |
9 | #include <bu/sio.h> | 11 | #include <bu/sio.h> |
12 | #include <bu/file.h> | ||
10 | 13 | ||
11 | using namespace Bu; | 14 | using namespace Bu; |
12 | 15 | ||
@@ -33,6 +36,19 @@ ProxyWidget::~ProxyWidget() | |||
33 | { | 36 | { |
34 | } | 37 | } |
35 | 38 | ||
39 | void ProxyWidget::saveTo( const QString &sFile ) | ||
40 | { | ||
41 | File fOut( sFile.toAscii().constData(), File::WriteNew ); | ||
42 | Gats::GatsStream gsOut( fOut ); | ||
43 | QTreeWidgetItem *pRoot = twHistory->invisibleRootItem(); | ||
44 | for( int j = 0; j < pRoot->childCount(); j++ ) | ||
45 | { | ||
46 | Gats::Object *pObj = treeToGats( pRoot->child( j ) ); | ||
47 | gsOut.writeObject( pObj ); | ||
48 | delete pObj; | ||
49 | } | ||
50 | } | ||
51 | |||
36 | void ProxyWidget::sendToClient() | 52 | void ProxyWidget::sendToClient() |
37 | { | 53 | { |
38 | try | 54 | try |