Parcourir la source

Adding fileToLoad in main in csl

Rémi Synave il y a 2 ans
Parent
commit
aaae8adef3
3 fichiers modifiés avec 10 ajouts et 7 suppressions
  1. 3 2
      csl/Informations.cpp
  2. 2 2
      csl/Informations.hpp
  3. 5 3
      csl/main.cpp

+ 3 - 2
csl/Informations.cpp

@@ -8,7 +8,7 @@
 #include "Informations.hpp"
 
 
-Informations::Informations (QString &fts):QMainWindow(),fileToSave(fts)
+Informations::Informations (QString &ftl, QString &fts):QMainWindow(),fileToLoad(ftl), fileToSave(fts)
 {
   setWindowTitle (tr ("DSL - Draw Strength Line"));
 
@@ -46,7 +46,8 @@ Informations::Informations (QString &fts):QMainWindow(),fileToSave(fts)
 
 void Informations::ready(){
   qDebug() << "Je suis prêt" << Qt::endl;
-  fileToSave = "test.txt";
+  fileToLoad = "filetoLoad.json";
+  fileToSave = "fileToSave.json";
   close();
 }
 

+ 2 - 2
csl/Informations.hpp

@@ -14,7 +14,7 @@ class Informations: public QMainWindow
 
 
 private:
-  QString &fileToSave;
+  QString &fileToLoad, &fileToSave;
   
   QPushButton *readyB;
 
@@ -25,7 +25,7 @@ private slots:
   void ready ();
   
 public:
-  Informations (QString &fts);  
+  Informations (QString &ftl, QString &fts);  
 };
 
 #endif

+ 5 - 3
csl/main.cpp

@@ -7,19 +7,21 @@
 int
 main (int argc, char *argv[])
 {
+  QString fileToLoad = "";
   QString fileToSave = "";
   
   QApplication app (argc, argv);
   
-  Informations infos(fileToSave);
+  Informations infos(fileToLoad, fileToSave);
   infos.show();
   app.exec();
 
-  if(fileToSave=="")
+  if((fileToLoad=="") || (fileToSave==""))
     qDebug() << "Erreur dans le formulaire de départ" << Qt::endl;
   else
     {
-      qDebug() << "Chaine recue : " << fileToSave << Qt::endl;
+      qDebug() << "Chaine1 recue : " << fileToLoad << Qt::endl;
+      qDebug() << "Chaine2 recue : " << fileToSave << Qt::endl;
       
       Experiment window;
       window.show ();