[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/office/zippl
From:       Klaas Freitag <freitag () suse ! de>
Date:       2010-06-07 9:37:00
Message-ID: 20100607093700.B02ABAC8CD () svn ! kde ! org
[Download RAW message or body]

SVN commit 1135426 by freitag:

- fixed compilation by removing not needed header
- open zipplfile from commandline or open file dialog
- README added


 A             README  
 M  +0 -1      graphwidget.cpp  
 M  +1 -0      main.cpp  
 M  +19 -1     mainwindow.cpp  
 M  +1 -1      mainwindow.h  
 M  +0 -1      zipplcontroler.cpp  
 M  +0 -2      zipplxmlreader.h  


--- trunk/playground/office/zippl/graphwidget.cpp #1135425:1135426
@@ -40,7 +40,6 @@
 ****************************************************************************/
 
 #include "graphwidget.h"
-#include "spot.h"
 
 #include <QDebug>
 #include <QGraphicsScene>
--- trunk/playground/office/zippl/main.cpp #1135425:1135426
@@ -5,6 +5,7 @@
 {
     QApplication a(argc, argv);
     MainWindow w;
+    w.openFile( argc, argv );
     w.show();
     return a.exec();
 }
--- trunk/playground/office/zippl/mainwindow.cpp #1135425:1135426
@@ -10,9 +10,27 @@
   mGraphWidget = new GraphWidget;
   setCentralWidget( mGraphWidget );
   mController = new ZipplControler( mGraphWidget );
-  mController->loadFile( "/home/kf/kde/zippl/zippl/zippl.xml");
 }
 
+void MainWindow::openFile( int argc, char *argv[] )
+{
+  QString file;
+  qDebug() << "ARGC: " << argc;
+  qDebug() << "ARGV: " << argv;
+
+  if( argc > 1 ) {
+    file = argv[1];
+  } else {
+    file = QFileDialog::getOpenFileName( this, tr("Pick a Zippl file to Open"),
+                                         QDir::homePath(), tr("Zippl Files (*xml)"));
+  }
+  if( file.isEmpty() ) {
+    // Error!
+  } else {
+    mController->loadFile( file );
+  }
+}
+
 MainWindow::~MainWindow()
 {
 
--- trunk/playground/office/zippl/mainwindow.h #1135425:1135426
@@ -13,7 +13,7 @@
 public:
     MainWindow(QWidget *parent = 0);
     ~MainWindow();
-
+  void openFile( int argc, char *argv[] );
 private:
     GraphWidget *mGraphWidget;
     ZipplControler *mController;
--- trunk/playground/office/zippl/zipplcontroler.cpp #1135425:1135426
@@ -1,6 +1,5 @@
 #include "zipplcontroler.h"
 #include "zipplxmlreader.h"
-#include "zipplfile.h"
 
 #include <QtGui>
 
--- trunk/playground/office/zippl/zipplxmlreader.h #1135425:1135426
@@ -1,8 +1,6 @@
 #ifndef ZIPPLXMLREADER_H
 #define ZIPPLXMLREADER_H
 
-#include "spot.h"
-
 #include <QXmlStreamReader>
 #include <QIODevice>
 #include <QStack>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic