Changeset 201


Ignore:
Timestamp:
02/17/10 09:56:57 (14 years ago)
Author:
yerima
Message:

New class with a basic graphical code in visual Yao.

Location:
trunk/yao/src/interface
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/yao/src/interface/Main.cpp

    r172 r201  
    1717#include <QTextCodec> 
    1818#include "src/Include/MainWindow.hpp" 
    19  
    20 #include <iostream> 
     19#include "BaseWindow.hpp" 
     20//#include <iostream> 
    2121 
    2222 
     
    3030 
    3131                MainWindow *fen1 = new MainWindow; fen1->show(); 
    32  
     32                //BaseWindow bw; 
     33                //bw.show(); 
    3334                //TrajWindow tj; 
    3435                //tj.show(); 
  • trunk/yao/src/interface/src/DefvalWindow.cpp

    r195 r201  
    2121/***************************************** The constructor **********************************************************************/ 
    2222 
    23 DefvalWindow::DefvalWindow(QWidget *parent): QWidget(parent) {  /*!< The constructor. */ 
     23DefvalWindow::DefvalWindow(BaseWindow *parent): BaseWindow(parent) {  /*!< The constructor. */ 
    2424         
    25         this->setWindowTitle("Directive Defval.");     /*!< To set the window's title. */ 
    26         isCalled = false; 
     25        //this->setWindowTitle("Directive Defval.");     /*!< To set the window's title. */ 
     26        QPushButton *b = new QPushButton("Test"); 
     27        m_layoutGrid->addWidget(b , 4, 5); 
     28//      isCalled = false; 
    2729                // Instanciation des classes. 
    2830                // Déclaration des boutons et champs de saisie de texte. 
    29  
    30                 compteur                        = 0; 
    31                  
    32                 m_labelNomDefval                = new QLabel("Constante: ");    /*!< QLabel for Nom de la constante . */ 
    33                 m_labelValeurDefval             = new QLabel("Valeur: ");  /*!< QLabel for Valeur de la constante. */ 
    34  
    35                 m_ligneNomDefval                = new QLineEdit(this) ;    /*!< Name of the QLineEdit. */ 
    36                 m_ligneValeurDefval             = new QLineEdit(this) ;   /*!< Value of the QLineEdit. */ 
    37  
    38                 m_ajoutDefval                   = new QPushButton("Ajouter", this);   /*!< QPushButton for Ajout. */ 
    39                 m_DefvalHelpButton              = new QPushButton("De l'aide ?");   /*!< QPushButton for aide. */ 
    40                 m_supDefval                     = new QPushButton("Supprimer", this);  /*!< QPushButton for Supprimer. */ 
    41                         m_supDefval->setDisabled(true);   /*!< setDisabled is true. */ 
    42                 m_saveDefvalButton              = new QPushButton("Enregistrer", this);   /*!< QPushButton for Enregistrer. */ 
    43                         m_saveDefvalButton->setDisabled(true); 
    44                 m_quitDefval                    = new QPushButton("Quitter", this);   /*!< QPushButton for Quitter. */ 
    45  
    46                 QStringList horizontalHeaders; 
    47                         horizontalHeaders << "Constante(s)"  << "Valeur(s)" << " ";  /*!< added Nom Netward Entrees and sorties in table */ 
    48                 vueDefval                       = new QTableWidget(0, 2);  /*!< QTableWidget's in whitch the objects are listed for thue view. */ 
    49                         vueDefval->setEditTriggers(QAbstractItemView::NoEditTriggers); /*!< this ligne give no edit mode*/ 
    50                         vueDefval->setShowGrid(false);  /*!< this ligne cover the grille in table */ 
    51                         vueDefval->setSelectionBehavior(QAbstractItemView::SelectRows);  /*!< this ligne give a section of the ligne */ 
    52                         vueDefval->setHorizontalHeaderLabels(horizontalHeaders); /*!< displays the QTableWidget */ 
    53         //--------- Les gestionnaires de positionnement. 
    54                 m_layoutH1Defval                = new QHBoxLayout; 
    55                         m_layoutH1Defval->addWidget(m_saveDefvalButton); 
    56                         m_layoutH1Defval->addWidget(m_quitDefval);//m_ajoutDefval); 
    57                 m_layoutGDefval                 = new QGridLayout;  /*!< set QGridLayout m-layoutGDefval */ 
    58                 m_layoutGDefval->addWidget(m_labelNomDefval, 0, 2); 
    59                 m_layoutGDefval->addWidget(m_ligneNomDefval, 0, 3, 1, 2); 
    60                 m_layoutGDefval->addWidget(m_labelValeurDefval, 1, 2); 
    61                 m_layoutGDefval->addWidget(m_ligneValeurDefval, 1, 3, 1, 2); 
    62                 m_layoutGDefval->addWidget(m_DefvalHelpButton, 3, 1); /*!<  m_DefvalHelpButton in the QGridLayout */ 
    63                 m_layoutGDefval->addWidget(vueDefval, 2, 2, 4, 3); /*!< added m_vueDefval in the QGridLayout */ 
    64                 m_layoutGDefval->addWidget(m_ajoutDefval, 3, 5);  /*!< added m_ajoutDefval in the QGridLayout */ 
    65                 m_layoutGDefval->addWidget(m_supDefval, 4, 5); /*!< added m_supDefval in the QGridLayout */ 
    66                 m_layoutGDefval->addLayout(m_layoutH1Defval, 6, 2, 1, 3);  /*!< added m_saveDefvalButton in the QGridLayout */ 
    67  
    68         index = vueDefval->currentIndex(); 
    69  
    70         m_modeleListeNoms                       = new QStringListModel(m_listeNomsDefval); 
    71  
    72         this->setLayout(m_layoutGDefval); //Activation du gestionnaire principal. 
    73  
    74         // Gestion des connexions entre les widgets. 
    75         connect(m_quitDefval, SIGNAL(clicked()), this, SLOT(close()));  /*!< slot for the close this windows*/ 
    76         connect(m_supDefval, SIGNAL(clicked()), this, SLOT(deleteDefvalRow())); /*!< To delete the object selected in the view*/ 
    77         connect(m_ajoutDefval, SIGNAL(clicked()), this, SLOT(addDefvalRow()));  /*!< This slot add the object in the view */ 
    78         connect(m_DefvalHelpButton, SIGNAL(clicked()), this, SLOT(callDefvalHelp())); /*!< This slot opens the help window */ 
    79         connect(m_saveDefvalButton, SIGNAL(clicked()), this, SLOT(saveDefvalData())); /*!< This slot save data in structure */ 
    80  
    81         this->setFixedWidth(baseSize().width() + 410); 
    82 } 
    83 /****************************************** addDefvalRow() method **********************************************/ 
    84 void DefvalWindow::addDefvalRow() { 
    85  
    86         addRow();                               // Permet de créer une nouvelle dans le tableau d'affichage. 
    87  
    88         testContenu(compteur);  // Permet de vérifier si une ligne est présente dans le tableau d'affichage. 
    89                                                         // Au cas échéant, on ne désactive pas les boutons "Enregistrer" et "Supprimer".  
    90          
    91     static int i = 1; 
    92     static int j = 1; 
    93         QString NomDefval = m_ligneNomDefval->text(); 
    94         QString ValDefval = m_ligneValeurDefval->text(); 
    95  
    96  
    97         for(int i1 = 0; i1 < NomDefval.size(); i1++) 
    98                 if(!((NomDefval.at(i1) >= QChar('a')&& NomDefval.at(i1) <= QChar('z')) || (NomDefval.at(i1) >= QChar('A')&& NomDefval.at(i1) <= QChar('Z')) //-------- 
    99                 || (NomDefval.at(i1) >= QChar('0')&& NomDefval.at(i1) <= QChar('9')) || (NomDefval.at(i1) == QChar('_')))) //|| (line1.isEmpty()) 
    100                         { 
    101                                 QMessageBox::critical(this, "Erreur", "Veuillez entrer une valeur exacte du nom de la constante."); 
    102                                 return; // Arrêt de la méthode 
    103                         } 
    104         for(int i2 = 0; i2 < ValDefval.size(); i2++) 
    105                 if(!((ValDefval.at(i2) >= QChar('a') && ValDefval.at(i2) <= QChar('z')) || (ValDefval.at(i2) >= QChar('A')&& ValDefval.at(i2) <= QChar('Z'))  
    106                 ||(ValDefval.at(i2) >= QChar('0') && ValDefval.at(i2) <= QChar('9')) || (ValDefval.at(i2) == QChar('_')) || (ValDefval.at(i2) == QChar('-')) || (ValDefval.at(i2) == QChar('E')) || (ValDefval.at(i2) == QChar('e')) || (ValDefval.at(i2) == QChar('+')) || (ValDefval.at(i2) == QChar('.')))) //|| (line1.isEmpty()) 
    107                         { 
    108                                 QMessageBox::critical(this, "Erreur", "Veuillez entrer une valeur correcte pour la constante."); 
    109                                 return; // Arrêt de la méthode 
    110                         } 
    111         if ( m_ligneNomDefval->text().isEmpty()) 
    112                 { 
    113                 QMessageBox::critical(this, "Erreur", "Le champ du nom de la constante est vide: entrer un nom SVP!"); 
    114                 return; // Arrêt de la méthode 
    115                 } 
    116  
    117         if ((i!=0)&&(j!=0)) { 
    118                 if (isCalled) {--i ; isCalled = false; } 
    119  
    120         addNameInTable(i, j, m_ligneNomDefval->text()); 
    121         m_listeNomsDefval.append(m_ligneNomDefval->text() + " " + m_ligneValeurDefval->text()); 
    122         addValueInTable(i, j, m_ligneValeurDefval->text()); 
    123  
    124         i++; 
    125         } 
    126  
    127         initialiserChamps(); 
    128 } 
    129 /************************************ deleteDefvalRow() method ****************************************************/ 
    130 void DefvalWindow::deleteDefvalRow() { 
    131  
    132         vueDefval->removeRow(vueDefval->currentRow()); 
    133         isCalled = true; 
    134         -- compteur; 
    135         testContenu(compteur); 
    136 } 
    137  
    138 /****************************************************************************************/ 
    139 void DefvalWindow::addNameInTable(int ligne, int colonne, QString nomDefval) { 
    140  
    141         QTableWidgetItem *chaine = new QTableWidgetItem; 
    142                 chaine->setText(nomDefval); 
    143  
    144         vueDefval->setItem(ligne-1, colonne-1, new QTableWidgetItem(nomDefval)); 
    145 } 
    146  
    147 /****************************************************************************************/ 
    148 void DefvalWindow::addValueInTable(int ligne, int colonne, QString valeurDefval) { 
    149  
    150         QTableWidgetItem *chaine = new QTableWidgetItem; 
    151                 chaine->setText(valeurDefval); 
    152  
    153         vueDefval->setItem(ligne - 1, colonne, chaine); 
    154 } 
    155  
    156 /****************************************************************************************/ 
    157 void DefvalWindow::addRow() { 
    158  
    159         int row = vueDefval->rowCount(); 
    160         vueDefval->insertRow(row); 
    161         compteur ++; 
    16231} 
    16332/****************************************************************************************/ 
    164 void DefvalWindow::saveDefvalData() { 
    165  
    166         QTableWidgetItem *cell1 = new QTableWidgetItem; 
    167         QTableWidgetItem *cell2 = new QTableWidgetItem;  
    168          
    169         for (int i = 0; i < vueDefval->rowCount() ; i++) { 
    170                         cell1 = vueDefval->item(i,0); 
    171                         cell2 = vueDefval->item(i,1); 
    172                                  
    173                         defvalData.push_back(cell1->text() + " " + cell2->text()); 
    174  
    175         } 
    176         //for (QStringList::iterator it = defvalData.begin(); it != defvalData.end(); it++) 
    177         //cout << "Voici les valeurs ajoutées: " << it->toStdString() <<endl; 
    178         m_quitDefval->setEnabled(true); 
    179 } 
    180 /****************************************************************************************/ 
    181 void DefvalWindow::initialiserChamps() { 
    182  
    183         m_ligneNomDefval->setText(""); 
    184         m_ligneValeurDefval->setText(""); 
    185 } 
    186  
    187 /************************************ Implémentation de la méthode callHelpDefval ****************************************/ 
    188 void DefvalWindow::callDefvalHelp() 
    189 { 
    190         QMessageBox::about(this, tr("Aide sur la directive defval."),("<p> La directive defval permet d'associer un nom symbolique à une valeur." 
    191                                                                   "<p><u>Exemple 1</u>: defval szx 12 <p><u>Exemple 2</u>: defval szy \"chaine\"<p> <u>Exemple 3</u>: defval szz szx" 
    192                                                                   "<p> Pour plus d'informations sur defval, <a href=\"help/defval_aide.html\">cliquez ici.</a>")); 
    193 } 
    194  
    195 /****************************************************************************************/ 
    196 void DefvalWindow::ouvrirProjetExistant() { 
    197  
    198          QStringList filtres; 
    199  
    200         fd = new QFileDialog(this); 
    201                 fd->setDirectory("."); 
    202                 fd->setFileMode (QFileDialog::AnyFile); 
    203  
    204         filtres  << "*.*" 
    205                          << "Tous les fichiers (*.*)"; 
    206                 fd->setFilters(filtres); 
    207                 lstF = fd->getSaveFileName(); 
    208 } 
    209 /****************************************************************************************************************************/ 
    210 QStringList DefvalWindow::getDataDefval() { 
    211  
    212         return defvalData; 
    213 } 
    214  
    215 /************************************ testContenu() ***************************************************/ 
    216 bool DefvalWindow::testContenu(int anInt) { 
    217  
    218         if (anInt != 0) { 
    219                 m_supDefval->setEnabled(true); 
    220                 m_saveDefvalButton->setEnabled(true); 
    221         } 
    222         else 
    223         { 
    224                 m_supDefval->setDisabled(true); 
    225                 m_saveDefvalButton->setDisabled(true); 
    226         } 
    227 } 
    228  
    229 /****************************************************************************************/ 
    230 void DefvalWindow::closeEvent(QCloseEvent *event) { 
     33/*void DefvalWindow::closeEvent(QCloseEvent *event) { 
    23134         
    23235      if (maybeSave()) { 
     
    23740            event->ignore(); 
    23841       
    239 } 
     42}*/ 
    24043/***************************************************************************************************************/ 
    241 bool DefvalWindow::maybeSave() 
     44/*bool DefvalWindow::maybeSave() 
    24245{ 
    24346      if (isWindowModified()) { 
     
    25558      return true; 
    25659}        
    257  
     60*/ 
    25861/************************************************************************************/ 
    25962 
     
    26467}*/ 
    26568/********************************************************************************/ 
     69QStringList DefvalWindow::getDataDefval() { 
     70QStringList test; 
     71        return test;//defvalData; 
     72} 
    26673 
    26774 
  • trunk/yao/src/interface/src/HatNameWindow.cpp

    r195 r201  
    1515 
    1616/*************************************** Implémentation du constructeur **************************************************/ 
    17 HatNameWindow::HatNameWindow(string param1, QWidget *parent) : QWidget(parent) { 
     17HatNameWindow::HatNameWindow(string aprojectName, QWidget *parent) : QWidget(parent) { 
    1818  
    1919        setWindowTitle("Directive Hatname."); // Titre de la fenetre. 
    20         compteur                        = 0; 
     20        compteur                = 0; 
    2121         
    2222        m_labelNom1HatName      = new QLabel("Nom du fichier (.h): "); 
     
    3434 
    3535        m_comboHatName->setEditable(true); 
    36  
    37                listeFichiers << param1.c_str();//this->getLocalProjectName().c_str();//NewProjectWindow::getNewProjectName().c_str(); 
     36        QString test = aprojectName.c_str();//"blablabla"; 
     37               listeFichiers << test;//aHeaderList.c_str();//param1.c_str();//this->getLocalProjectName().c_str();//NewProjectWindow::getNewProjectName().c_str(); 
    3838        modeleFichiers = new QStringListModel(listeFichiers); 
    39  
    4039 
    4140        vueFichiers = new QListView; 
  • trunk/yao/src/interface/src/Include/DefvalWindow.hpp

    r190 r201  
    77#ifndef DEFVALWINDOW_HPP 
    88#define DEFVALWINDOW_HPP 
    9  
    10 #include <QWidget> 
    11 #include <QTextStream> 
    12 #include <QPushButton> 
    13 #include <QGridLayout> 
    14 #include <QLineEdit> 
    15 #include <QStandardItemModel> 
    16 #include <QTableWidget> 
    17 #include <QString> 
    18 #include <QFileDialog> 
    19 #include <QStringListModel> 
     9#include "BaseWindow.hpp" 
    2010#include <QStringList> 
    21 #include <QLabel> 
    22 #include <QIODevice> 
    23 #include <QMessageBox> 
    24 #include <QCloseEvent> 
    25  
     11//#include <QPushButton> 
    2612//using namespace std; 
    2713 
    28 class DefvalWindow : public QWidget { 
     14class DefvalWindow : public BaseWindow { 
    2915 
    3016        Q_OBJECT; 
     
    3925             */    
    4026          
    41                 DefvalWindow(QWidget *parent=0);   /*!< This function returns the constante's data. */ 
    42                 void addNameInTable(int ligne, int colonne, QString nomDefval); 
    43                 void addValueInTable(int ligne, int colonne, QString valeurDefval); 
    44                 void addRow(); 
    45                 bool testContenu(int anInt); 
    46                 bool maybeSave(); 
    47                QStringList getDataDefval();  
    48          
     27                DefvalWindow(BaseWindow *parent=0);   /*!< This function returns the constante's data. */ 
     28                QStringList getDataDefval();     
    4929        protected : 
    50                    void closeEvent(QCloseEvent *event);                 
     30//                   void closeEvent(QCloseEvent *event);                 
    5131         
    5232        public slots :        /*!< Functions called after a click. */ 
    5333 
    54                 void addDefvalRow();    /*!< This function is called to add row in the visual window model. */ 
    55                 void deleteDefvalRow(); /*!< This function is called to delete row from the Yao model. */  
    56                 void initialiserChamps();  
    57                 void callDefvalHelp(); 
    58                 void ouvrirProjetExistant(); 
    59                 void saveDefvalData();  /*!< This function is called to add data in the Yao model. */ 
    60                 //void fermerEnrDef(); 
    61  
    62  
    63         private : 
    64  
    65                 QLabel  *m_labelNomDefval;   /*!< QLabel for the Constante Name. */ 
    66                 QLabel  *m_labelValeurDefval;  /*!< QLabel for the Constante value.  */                  
    67  
    68                 QLineEdit *m_ligneNomDefval;   /*!< QLineEdit for the Constante Name. */ 
    69                 QLineEdit *m_ligneValeurDefval;  /*!< QLineEdit for the Constante Name. */ 
    70  
    71                 QPushButton *m_ajoutDefval;    /*!< The button "add". */ 
    72                 QPushButton *m_supDefval;     /*!< The button "delete". */ 
    73                 QPushButton *m_saveDefvalButton;  /*!< The button "save". */ 
    74                 QPushButton *m_quitDefval;    /*!< The button "close window". */ 
    75                 QPushButton *m_DefvalHelpButton;  /*!< The button "Help". */ 
    76  
    77                 QGridLayout *m_layoutGDefval;  //!< QGridLayout for m_layoutGDefval              
    78                 QHBoxLayout *m_layoutH1Defval;   //!< QHBoxLayout m_layoutH1Defval 
    79                  
    80                 QStandardItemModel *modeleDefval; 
    81                 QTableWidget *vueDefval;  /*!< Name of the QTableWidget's object in whitch the objects are listed for the viewer. */ 
    82  
    83                 QFileDialog *fd; 
    84                 QModelIndex index; 
    85  
    86                 QString lstF; 
    87                 QStringList m_listeNomsDefval; 
    88                 QStringList m_listeValeursDefval; 
    89                 QStringListModel *m_modeleListeNoms; 
    90                 QStringList defvalData; 
    91  
    92                 bool isCalled; 
    93                  
    94                 int compteur; 
    9534}; 
    96  
    9735#endif 
  • trunk/yao/src/interface/src/Include/HatNameWindow.hpp

    r184 r201  
    4444             */ 
    4545 
    46             HatNameWindow(std::string param1 = "", QWidget *parent = 0); 
    47             void setNomFichierHat(QString nomFichierHat);                       /*!< This function sets the file's name. */ 
    48             std::string getNomFichierHat();                                         /*!< This function returns the fil's name */ 
    49             void testPresenceFichier(); 
    50                         QStringList getHatName(); 
    51             void setLocalProjectName(std::string name); 
    52             std::string getLocalProjectName(); 
    53              bool testContenu(int anInt); 
     46        HatNameWindow(std::string aprojectName , QWidget *parent = 0); 
     47        void setNomFichierHat(QString nomFichierHat);                       /*!< This function sets the file's name. */ 
     48        std::string getNomFichierHat();                                         /*!< This function returns the fil's name */ 
     49        void testPresenceFichier(); 
     50        QStringList getHatName(); 
     51        void setLocalProjectName(std::string name); 
     52        std::string getLocalProjectName(); 
     53        bool testContenu(int anInt); 
    5454 
    5555            /*! 
  • trunk/yao/src/interface/src/Include/MainWindow.hpp

    r171 r201  
    152152                    NewProjectWindow *copynp; 
    153153                    FilesViewer *fv; 
    154                     std::string copyProjectName; 
     154                    char* copyProjectName; 
    155155                    std::vector<std::string> theHeaderList; 
    156156                    std::string filename; 
  • trunk/yao/src/interface/src/Include/MainWindowController.hpp

    r171 r201  
    2222#include "NewProjectWindow.hpp" 
    2323#include "../YAOObjects/Table.hpp" 
    24  
    2524 
    2625 
     
    5251                OrderWindow *getOrder(); 
    5352                InsertFCTWindow *getInsertFCT(); 
    54                 NewProjectWindow *getNewProjectInstance(); 
    55                 NewProjectWindow *getNP(); 
     53                void getNewProjectInstance(); 
     54                void getNP(); 
    5655 
    5756                SpaceController getSpaceController(); 
     
    6261        private : 
    6362 
    64                 MainWindowController() {} 
     63                MainWindowController() ;//{} 
    6564                std::string m_projectNameInMWC;  // MWC = MainWindowController 
    6665                DefvalWindow *m_defval; 
     
    8079                std::vector<std::string> m_theHeaderList; 
    8180                yao::Table<yao::Trajectory> m_theTrajectoryTable; 
    82  
     81                bool npTest; 
    8382            }; 
    8483 
  • trunk/yao/src/interface/src/MainWindow.cpp

    r171 r201  
    3333        MainWindowController & m_mwc = MainWindowController::getInstance();      
    3434 
    35         copyProjectName = m_mwc.getProjectNameFromMWC(); 
    36  
     35        //copyProjectName = m_mwc.getProjectNameFromMWC(); 
    3736        fv  = new FilesViewer();                        //Création d'un espace montrant l'arborescence des fichiers sur le disque dûr. 
    3837         
     
    264263    m_hatNameButton   = new QPushButton(tr("Hatname"), this); 
    265264        m_hatCopy = mwc.getHatName(); 
    266         //m_hatCopy->setLocalProjectName(copynp->getNewProjectName()); 
     265        //m_hatCopy->setLocalProjectName(copynp->getNewProjectName()); 
    267266        espace->addWindow(m_hatCopy); 
    268267        m_hatCopy->hide(); 
     
    369368 
    370369        activeBoutonsBarreOutils(); 
    371         copynp = new NewProjectWindow;//mwc4.getNP(); 
     370        copynp = new NewProjectWindow();//mwc4.getNP(); 
    372371        espace->addWindow(copynp); 
    373372        copynp->show(); 
     
    376375        montrerActionGenererD(); 
    377376 
     377        std::cout <<  copynp->getNewProjectName() << std::endl; 
    378378//return true; 
    379379  } 
     
    526526    //genererDefval(); 
    527527    //genererHat(); 
    528     //genererSpace(); 
    529528 
    530529    description.close(); 
     
    597596                        QMessageBox::Cancel | QMessageBox::Escape); 
    598597            if (ret == QMessageBox::Yes) 
    599               true;//return save(); 
     598              return true;//return save(); 
    600599            else if (ret == QMessageBox::Cancel) 
    601600            return false; 
  • trunk/yao/src/interface/src/MainWindowController.cpp

    r171 r201  
    44//! \author  MAYAKI Abdouramane & MAYOMBO Alexis. 
    55 
    6  
    76#include "Include/MainWindowController.hpp" 
    8  
     7#include <iostream> 
    98//! \class MainWindowController & MainWindowController::getInstance()  
    109//! \brief Implementation of the MainWindow controller for visual_YAO. 
     
    1413 
    1514/****************************************************************************************************************************************/ 
    16 //MainWindowController::MainWindowController() { 
     15MainWindowController::MainWindowController() { 
    1716 
    1817    //for(vector<string>::iterator it = m_hat->getTheHeaderList().begin(); it != m_hat->getTheHeaderList().end(); it++) 
    1918        //setTheHeaderList("test push_back"); 
    20     //np = new NewProjectWindow; 
    21     //setProjectNameInMWC("test.h");//np->getNewProjectName()); 
     19        npTest = false; 
     20    np = new NewProjectWindow; 
     21        np->hide(); 
     22 std::cout << /*np->getNewProjectName()*/"chaine in mainwindow controller." << std::endl; 
     23 //   if (npTest)  
     24//      setProjectNameInMWC(np->getNewProjectName()); 
     25//      else 
     26//      setProjectNameInMWC("not ready!"); 
     27 
     28//setProjectNameInMWC("test.h");//np->getNewProjectName()); 
    2229    //m_defval = new DefvalWindow; 
    2330    //m_projectNameInMWC = np->getNewProjectName(); 
    2431    //m_hat->setLocalProjectName(m_projectNameInMWC); 
    2532    //m_hat = new HatNameWindow("test"); 
    26     //setProjectNameInMWC(); 
    27  
    28 //} 
     33  
     34} 
    2935/********************************************************* getInstance() ****************************************************************/ 
    3036MainWindowController & MainWindowController::getInstance() { 
     
    6672HatNameWindow *MainWindowController::getHatName() { 
    6773 
    68  
    69     return new HatNameWindow(getProjectNameFromMWC()); 
     74        //setProjectNameInMWC(getNewProjectName());              
     75        string g = getProjectNameFromMWC(); 
     76    return new HatNameWindow(g); 
    7077 
    7178} 
     
    134141 
    135142/**************************************************************** getNewProjectInstance() ***********************************************/ 
    136 NewProjectWindow *MainWindowController::getNewProjectInstance() { 
     143void MainWindowController::getNewProjectInstance() { 
    137144 
    138145   // m_projectName = np->name; 
    139   return this->getNP(); 
    140 } 
     146  getNP(); 
     147        std::cout << /*np->getNewProjectName()*/"Mon age!" << std::endl; 
     148   //if (npTest)  
     149        setProjectNameInMWC(np->getNewProjectName()); 
     150//      else 
     151//      setProjectNameInMWC("not ready!"); 
     152 
     153 
     154} 
     155 
    141156 
    142157/**************************************************************** getNP() ***************************************************************/ 
    143 NewProjectWindow *MainWindowController::getNP() { 
    144  
    145     return np; 
     158void MainWindowController::getNP() { 
     159        np->show(); 
     160         
     161        //np = new NewProjectWindow; 
     162        npTest = true;      
    146163} 
    147164 
     
    196213 
    197214 
    198  
    199 /****************************************************************************************************************************************/ 
     215/****************************************************************************************************************************************/ 
  • trunk/yao/src/interface/src/NewProjectWindow.cpp

    r174 r201  
    1919        //name = projectName; 
    2020    //theHeaderList = &theHeaders; 
    21  
     21//      string testchaine; 
    2222    this->setWindowTitle("Fenêtre de création d'un nouveau projet."); 
    2323 
     
    5353       //setNewProjectName(newProjectName); 
    5454 
    55          
     55        //aprojectName = "rrrrrr";//getNewProjectName();         
     56 
    5657        this->setFixedWidth(baseSize().width() + 450); 
    5758        this->setLayout(m_layoutF); 
    5859        this->move(width()/3,height()/3); 
    5960        this->show(); 
     61        //projectname = "test" ;//newProjectName.c_str() ; 
    6062} 
    6163 
Note: See TracChangeset for help on using the changeset viewer.