- Timestamp:
- 08/02/10 10:15:06 (14 years ago)
- Location:
- trunk/yao/src/interface/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/src/MainWindow.cpp
r392 r393 12 12 13 13 #include "include/MainWindow.hpp" 14 15 14 #include<iostream> 16 15 17 16 //using namespace antlr; 18 17 using namespace std; 18 //using namespace antlr; 19 19 using namespace yao; 20 20 … … 100 100 //menuFichier->addAction(actionImporterProjet); 101 101 menuFichier->addSeparator(); 102 menuFichier->addAction(action EnregistrerProjet);102 menuFichier->addAction(actionSaveProject); 103 103 menuFichier->addAction(actionEnregistrerSousProjet); 104 104 menuFichier->addSeparator(); … … 162 162 163 163 //connect(runAction, SIGNAL(triggered()), this, SLOT()); 164 action EnregistrerProjet = new QAction(tr("Enregi&strer"), this);165 action EnregistrerProjet->setIcon(QIcon("Images/icons/save.png"));166 action EnregistrerProjet->setEnabled(false); // Option désactivée par défaut.167 action EnregistrerProjet->setStatusTip("Pour sauvegarder le projet en cours");164 actionSaveProject = new QAction(tr("Enregi&strer"), this); 165 actionSaveProject->setIcon(QIcon("Images/icons/save.png")); 166 actionSaveProject->setEnabled(false); // Option désactivée par défaut. 167 actionSaveProject->setStatusTip("Pour sauvegarder le projet en cours"); 168 168 actionEnregistrerSousProjet = new QAction(tr("Enregistrer sous"), this); 169 169 actionEnregistrerSousProjet->setIcon(QIcon("Images/icons/saveas.png")); … … 401 401 connect(m_netwardWindow, SIGNAL(netwardWindowIsClosed(int )), this, SLOT(initializeWindow(int ))); 402 402 //connect(m_netwardButton, SIGNAL(clicked()), this, SLOT(changeColorNetwardButton())); 403 404 403 } 405 404 … … 426 425 427 426 connect(m_ctinWindow, SIGNAL(ctinWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 428 429 427 430 428 } … … 453 451 454 452 connect(m_insertFCTWindow, SIGNAL(insertFCTWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 455 456 453 457 454 } … … 513 510 void MainWindow::openProject() { // Affiche la fenetre nouveau projet lorsqu'elle est appelée. 514 511 515 516 //FilePath filename="test_00.d";517 518 //try{519 // Check argument count.520 //if(argc <= 1)521 //throw runtime_error("No file specified");522 523 // Check if help menu is required.524 // if(strcmp(argv[1], "-h") == 0){525 // Display::displayHelp();526 // exit(EXIT_SUCCESS);527 // }528 529 //filename = argv[1];530 //if(filename.getExtension().empty())531 // filename += ".d";532 533 // Initilization of the lexer and lexing (wrapped from the object tokenizer)534 //Tokenizer tokenizer(filename);535 // Initialization of the parser and parsing (wrapped from the object tokenizer)536 // Translator translator(tokenizer);537 // Code generation of the files Y1ProjectName.h and Y2ProjectName.h538 //translator.generateCode();539 // translator.descriptionVisualYAO();540 // exitStatus = EXIT_SUCCESS;541 //cout << "End application" << endl;542 512 QFileDialog *dialogue = new QFileDialog(this); //Crée une boite de dialogue 543 513 544 514 QString cheminFichier = dialogue->getOpenFileName(this, tr("Ouverture d'un project existant."), QDir::homePath(), tr("*.d *.i *.txt")); //Retourne le chemin du fichier. 545 546 // translator.theConstantTable;547 //m_ConstantCopy = new ConstantWindow(&theConstantTable, &theHeaderList);548 //for (Table<Constant>::iterator it = translator.theConstantTable.begin(); it != translator.theConstantTable.end(); it++)549 // cout << it->getName() << " " << it->getText() << endl;550 551 //QMessageBox msgBox;552 //msgBox.setWindowTitle("Aide sur la création d'un nouveau projet.");553 554 // translator.theConstantTable;555 515 556 516 QProcess builder; … … 558 518 builder.setProcessChannelMode(QProcess::MergedChannels); 559 519 builder.start("Yao9Generator " + cheminFichier);//, QStringList() 560 // <<"-e" 561 // <<"/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf" 562 563 // ); 564 //char *test2[]; 565 //QDebug ( QString * string ) 566 if (!builder.waitForFinished()) 567 qDebug() << "Make failed:" << builder.errorString(); 568 else 569 //qDebug << "Make output:" << builder.readAll(); 570 { 520 if (!builder.waitForFinished()) 521 qDebug() << "Make failed:" << builder.errorString(); 522 else { 571 523 QString test(builder.readAll()); 572 //for (int i = 0; i <= test.size(); i++)573 // {574 // if (test.at(i) == ' ')575 576 // }577 578 524 istringstream iss(test.toStdString()); 579 580 525 FilePath mot; 581 526 FilePath name; 582 527 while ( getline(iss, mot, '\n' ) ) 583 528 { 584 585 529 if (mot.getExtension() == ".def1") 586 530 { … … 592 536 Constant aConstant(name.getTitle(), mot.getTitle()); 593 537 theConstantTable.push_back(aConstant); 594 595 538 } 596 539 if (mot.getExtension() == ".h") … … 604 547 activateToolBarButtons(); 605 548 606 //cout << "Voici le resulat: " << test.toStdString() << endl; 607 } 608 609 //Tokenizer tokenizer("test_00.d");//cheminFichier.toStdString()); 610 //Translator translator(tokenizer); 611 //translator.descriptionVisualYAO(); 612 //translator.theConstantTable; 613 //for (Table<Constant>::iterator it = translator.theConstantTable.begin(); it != translator.theConstantTable.end(); it++) 614 // cout << it->getName() << " " << it->getText() << endl; 615 //string test << qDebug(); 616 617 /*QProcess process; 618 619 process.start( "sudo ", QStringList() 620 << "-S" 621 << "-p" << "password:\n" 622 << "gnome-terminal" ); 623 */ 624 //string test = "Yao9Generator " + cheminFichier.toStdString(); 625 //system(test.c_str());// "Yao9Generator projects/test_04/test_04.d"); 626 627 628 629 630 //QMessageBox::about(this, "test", "Ouverture un projet existant."); 549 } 550 631 551 } 632 552 … … 634 554 void MainWindow::hatUpdate() { 635 555 636 //m_hatnameWindow->repaint();//update();637 //theConstantTable;638 556 if (m_hatnameWindow != NULL) //Teste si l'objet n'est pas déjà crée. S'il n'est pas 639 557 { … … 988 906 delete actionOuvrirProjetsRecents; 989 907 //delete actionImporterProjet; 990 delete action EnregistrerProjet;908 delete actionSaveProject; 991 909 delete actionEnregistrerSousProjet; 992 910 delete actionImprimerProjet; -
trunk/yao/src/interface/src/include/MainWindow.hpp
r392 r393 167 167 QAction *actionOuvrirProjetsRecents; 168 168 QAction *actionImporterProjet; 169 QAction *action EnregistrerProjet;169 QAction *actionSaveProject; 170 170 QAction *actionEnregistrerSousProjet; 171 171 QAction *actionImprimerProjet;
Note: See TracChangeset
for help on using the changeset viewer.