Changeset 216
- Timestamp:
- 02/25/10 17:47:46 (14 years ago)
- Location:
- trunk/yao/src/interface
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/Main.cpp
r213 r216 16 16 #include <QApplication> 17 17 #include <QTextCodec> 18 #include "src/Include/MainWindow .hpp"19 #include "BasicWindow.hpp"18 #include "src/Include/MainWindowController.hpp" 19 //#include "BasicWindow.hpp" 20 20 //#include <iostream> 21 21 … … 29 29 QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); 30 30 31 MainWindow *fen1 = new MainWindow; fen1->show(); 31 //MainWindowController *fen1 = new MainWindowController; fen1->show(); 32 MainWindowController & m_mwc = MainWindowController::getInstance(); 32 33 //BaseWindow bw; 33 34 //bw.show(); … … 36 37 return app.exec(); 37 38 38 fen1->~MainWindow();39 //fen1->~MainWindow(); 39 40 } 40 41 -
trunk/yao/src/interface/src/Include/MainWindow.hpp
r214 r216 1 1 #ifndef MAINWINDOW_HPP 2 2 #define MAINWINDOW_HPP 3 #include "../../../help/Enforcer.hpp" 4 #include "../../../help/FilePath.hpp" 5 #include <string> 3 6 7 #include "FilesViewer.hpp" 4 8 #include <QtGui> 9 #include "CtinWindow.hpp" 10 #include "ConstantWindow.hpp" 11 #include "FilesViewer.hpp" 12 #include "HatNameWindow.hpp" 13 #include "InsertFCTWindow.hpp" 14 #include "ModulWindow.hpp" 15 #include "NetwardWindow.hpp" 16 #include "NewProjectWindow.hpp" 17 #include "SpaceController.hpp" 18 #include "SpaceWindow.hpp" 19 #include "TrajWindow.hpp" 20 #include "OperaWindow.hpp" 21 #include "OptionWindow.hpp" 22 #include "OrderWindow.hpp" 23 #include "../YAOObjects/Table.hpp" 24 5 25 #include <QMainWindow> 6 26 #include <QWorkspace> … … 8 28 #include <QTabWidget> 9 29 #include <QWidget> 10 #include "MainWindowController.hpp"30 //#include "MainWindowController.hpp" 11 31 12 32 #include <QCloseEvent> … … 30 50 MainWindow(QWidget *parent = 0); 31 51 32 void actionsBarreOutils(QWorkspace *espace , MainWindowController mwc);33 void creerActions( MainWindowController mwc);52 void actionsBarreOutils(QWorkspace *espace); 53 void creerActions(); 34 54 void creerBarreOutils(); 35 55 void creerMenus(); 36 void creerRepertoire();37 void genererConstant();38 void genererHat();39 void genererSpace();40 void genererCtin();41 bool okToContinue();42 bool maybeSave();43 ~MainWindow();56 // void creerRepertoire(); 57 // void genererConstant(); 58 // void genererHat(); 59 // void genererSpace(); 60 // void genererCtin(); 61 // bool okToContinue(); 62 // bool maybeSave(); 63 // ~MainWindow(); 44 64 protected : 45 void closeEvent(QCloseEvent *event);65 //void closeEvent(QCloseEvent *event); 46 66 47 67 public slots: … … 49 69 void cacherBarreOutils(); 50 70 void desactiveBoutonsBarreOutils(); 51 void appelGenererD();52 void montrerActionCompilation();71 //void appelGenererD(); 72 //void montrerActionCompilation(); 53 73 void montrerActionGenererD(); 54 74 void createNewProject(); 55 void callHatModel();75 //void callHatModel(); 56 76 void changeColorConstantButton(); 57 77 void changeColorHatButton(); … … 64 84 void changeColorNetwardButton(); 65 85 void changeColorInsertFCTButton(); 86 66 87 void enConstruction(); 67 68 88 private : 69 89 // Les attributs des menus … … 79 99 QAction *actionFichierHat; 80 100 81 //QAction *actionModule;101 QAction *actionModule; 82 102 QAction *actionFichierInstruction; 83 103 QAction *actionGrapheModulaire; … … 93 113 94 114 // Les actions du menu edition 95 QAction *actionAnnuler;96 QAction *actionRevenir;97 QAction *actionCouper;98 QAction *actionCopier;99 QAction *actionColler;100 QAction *actionSelectionnerTout;115 //QAction *actionAnnuler; 116 //QAction *actionRevenir; 117 //QAction *actionCouper; 118 //QAction *actionCopier; 119 //QAction *actionColler; 120 //QAction *actionSelectionnerTout; 101 121 102 122 // Les actions du menu affichage … … 105 125 QAction *actionCacherFenetreProjet; 106 126 QAction *actionCacherFenetreDialog; 107 QAction *actionPleinEcran;127 //QAction *actionPleinEcran; 108 128 109 129 // Les actions du menu Execution … … 152 172 NewProjectWindow *copynp; 153 173 FilesViewer *fv; 154 char* copyProjectName;155 std::vector<std::string> theHeaderList;156 std::string filename;157 std::string filepath;174 //char* copyProjectName; 175 //std::vector<std::string> theHeaderList; 176 //std::string filename; 177 //std::string filepath; 158 178 //!< les onglets 159 179 QTabWidget *tabWidget; -
trunk/yao/src/interface/src/Include/MainWindowController.hpp
r214 r216 2 2 #define MAINWINDOWCONTROLLER_HPP 3 3 4 #include "../../../help/Enforcer.hpp" 5 #include "../../../help/FilePath.hpp" 4 6 #include <string> 5 #include "../../../help/FilePath.hpp"6 #include "../../../help/Enforcer.hpp"7 7 8 #include "CtinWindow.hpp" 8 9 #include "ConstantWindow.hpp" 10 #include "FilesViewer.hpp" 9 11 #include "HatNameWindow.hpp" 10 #include "OptionWindow.hpp" 12 #include "InsertFCTWindow.hpp" 13 #include "ModulWindow.hpp" 14 #include "NetwardWindow.hpp" 15 #include "NewProjectWindow.hpp" 16 #include "SpaceController.hpp" 17 #include "SpaceWindow.hpp" 11 18 //#include "TrajController.hpp" 12 19 #include "TrajWindow.hpp" 13 #include "SpaceController.hpp"14 #include "SpaceWindow.hpp"15 20 #include "OperaWindow.hpp" 16 #include "NetwardWindow.hpp" 17 #include "ModulWindow.hpp" 18 #include "CtinWindow.hpp" 21 #include "OptionWindow.hpp" 19 22 #include "OrderWindow.hpp" 20 #include "InsertFCTWindow.hpp"21 #include "FilesViewer.hpp"22 #include "NewProjectWindow.hpp"23 23 #include "../YAOObjects/Table.hpp" 24 #include "MainWindow.hpp" 24 25 25 26 … … 29 30 30 31 static MainWindowController & getInstance(); 32 ConstantWindow *getConstant(); 31 33 void setConstant(); 32 ConstantWindow *getConstant(); 34 35 void setFileListController(std::string fileController); 36 std::string getProjectNameFromMWC(); 33 37 34 38 void setProjectNameInMWC(std::string projectName); 35 std::string getProjectNameFromMWC();36 39 37 void setFileListController(std::string fileController);38 40 void setTheHeaderList(string theHeaderListSring); 39 41 … … 41 43 void setFileListController(); 42 44 45 CtinWindow *getCtin(); 43 46 HatNameWindow *getHatName(); 47 InsertFCTWindow *getInsertFCT(); 48 ModulWindow *getModul(); 49 NetwardWindow *getNetward(); 50 OrderWindow *getOrder(); 51 OperaWindow *getOpera(); 44 52 OptionWindow *getOption(); 53 SpaceWindow *getSpace(); 45 54 TrajWindow *getTraj(); 46 SpaceWindow *getSpace(); 47 OperaWindow *getOpera(); 48 NetwardWindow *getNetward(); 49 ModulWindow *getModul(); 50 CtinWindow *getCtin(); 51 OrderWindow *getOrder(); 52 InsertFCTWindow *getInsertFCT(); 55 53 56 void getNewProjectInstance(); 54 57 void getNP(); … … 62 65 63 66 MainWindowController() ;//{} 64 std::string m_projectNameInMWC; // MWC = MainWindowController 67 65 68 ConstantWindow *m_Constant; 69 CtinWindow *m_ctin; 70 FilesViewer *m_directoryViewer; 66 71 HatNameWindow *m_hat; 72 InsertFCTWindow *m_insertFCT; 73 ModulWindow *m_modul; 74 NetwardWindow *m_netward; 75 NewProjectWindow *np; 76 OrderWindow *m_order; 77 OperaWindow *m_opera; 67 78 OptionWindow *m_option; 68 79 TrajWindow *m_traj; 80 SpaceController *m_spc; 69 81 SpaceWindow *m_space; 70 SpaceController *m_spc; 71 OperaWindow *m_opera; 72 NetwardWindow *m_netward; 73 ModulWindow *m_modul; 74 CtinWindow *m_ctin; 75 OrderWindow *m_order; 76 InsertFCTWindow *m_insertFCT; 77 FilesViewer *m_directoryViewer; 78 NewProjectWindow *np; 82 std::string m_projectNameInMWC; // MWC = MainWindowController 83 79 84 std::vector<std::string> m_theHeaderList; 80 85 yao::Table<yao::Trajectory> m_theTrajectoryTable; -
trunk/yao/src/interface/src/MainWindow.cpp
r214 r216 30 30 espace = new QWorkspace; //Crée un espace de travail. Ici, ça serait notre zone centrale 31 31 32 MainWindowController & m_mwc = MainWindowController::getInstance();32 // MainWindowController & m_mwc = MainWindowController::getInstance(); 33 33 34 34 //copyProjectName = m_mwc.getProjectNameFromMWC(); 35 35 fv = new FilesViewer(); //Création d'un espace montrant l'arborescence des fichiers sur le disque dûr. 36 36 37 fenetreProjet = new QDockWidget(" Projet", this); // Réservation de l'espace pour la fenêtre projet37 fenetreProjet = new QDockWidget("Aperçu des projets: ", this); // Réservation de l'espace pour la fenêtre projet 38 38 fenetreProjet->setFeatures(QDockWidget::NoDockWidgetFeatures); //La fenêtre projet ne pourra être ni deplacée ni fermée. 39 39 fenetreProjet->setWidget(fv); // L'arborescence des fichiers est incluse dans la fenêtre projet. 40 //QDockWidget *dock2 = new QDockWidget("Apercu", this); 41 //addDockWidget(Qt::LeftDockWidgetArea, dock2); 40 QDockWidget *dock2 = new QDockWidget("", this); 42 41 addDockWidget(Qt::LeftDockWidgetArea, fenetreProjet); //Positionnement de la fenêtre projet à gauche dans la QMainWindow. 43 42 addDockWidget(Qt::LeftDockWidgetArea, dock2); 44 43 45 44 setCentralWidget(espace); //Ici, se précise la zone centrale de la QMainWindow. 46 45 // Appel des differentes méthodes crées. 47 creerActions( m_mwc); //Appel de la methode creerActions(), voir le code ci-aprÚs.46 creerActions(); //Appel de la methode creerActions(), voir le code ci-aprÚs. 48 47 creerMenus(); // Appel de la méthode creerMenu(), voir le code ci-aprÚs. 49 48 creerBarreOutils(); //Cree la barre d'outils … … 54 53 addDockWidget(Qt::BottomDockWidgetArea, dock3); 55 54 tabWidget = new QTabWidget(dock3);//(this); 56 55 dock3->setWidget(tabWidget); 57 56 //tabWidget->setGeometry(QRect(310, 565, 969, 106)); 58 57 page1 = new QWidget(); 59 // 58 //page1->setObjectName(QString::fromUtf8("tab")); 60 59 tabWidget->addTab(page1, " compilation "); 61 60 page2 = new QWidget(); … … 64 63 //QTabWidget::setTabPosition(QTabWidget::self, South); 65 64 //horizontalLayout->addWidget(tabWidget); 66 tabWidget->setCurrentIndex(1);65 // tabWidget->setCurrentIndex(1); 67 66 //connect(espace, SIGNAL(windowActivated(QWidget * w)), this, SLOT(setActiveWindow(QWidget * w))); 68 67 … … 114 113 115 114 /********************************** Implémentation de la methode creerActions() **********************************************/ 116 void MainWindow::creerActions( MainWindowController mwc) {115 void MainWindow::creerActions() { 117 116 118 117 // Les actions du menu fichier … … 122 121 //connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(activeBoutonsBarreOutils())); 123 122 connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(createNewProject())); 124 //connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(montrerActionGenererD()));123 connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(montrerActionGenererD())); 125 124 actionOuvrirProjet = new QAction(tr("&Ouvrir un projet"), this); 126 125 actionOuvrirProjet->setIcon(QIcon("Images/icons/openfile.png")); … … 159 158 160 159 161 connect(actionFichierDescription, SIGNAL(triggered()), this, SLOT(appelGenererD()));160 // connect(actionFichierDescription, SIGNAL(triggered()), this, SLOT(appelGenererD())); 162 161 163 162 … … 171 170 actionCacherBarreOutils = new QAction(tr("Cacher la barre d'outils"), this); 172 171 actionCacherBarreOutils->setCheckable(true); 173 172 // connect(actionCacherBarreOutils, SIGNAL(triggered()), this, SLOT(cacherBarreOutils())); 174 173 actionCacherFenetreApercu = new QAction(tr("Cacher la fenetre apercu"), this); 175 174 actionCacherFenetreApercu->setCheckable(true); … … 178 177 actionCacherFenetreDialog = new QAction(tr("Cacher la fenetre dialog"), this); 179 178 actionCacherFenetreDialog->setCheckable(true); 180 actionPleinEcran = new QAction(tr("Plein ecran"), this);181 actionPleinEcran->setCheckable(true);179 //actionPleinEcran = new QAction(tr("Plein ecran"), this); 180 //actionPleinEcran->setCheckable(true); 182 181 183 182 // Les actions du menu Execution 184 183 actionGenerationD = new QAction(tr("Generer le fichier .d"), this); 185 184 actionGenerationD->setEnabled(false); 186 connect(actionGenerationD, SIGNAL(triggered()), this, SLOT(appelGenererD()));185 // connect(actionGenerationD, SIGNAL(triggered()), this, SLOT(appelGenererD())); 187 186 188 187 actionCompilation = new QAction(tr("Compilation"), this); … … 201 200 // Les actions de la barre d'outils 202 201 203 actionsBarreOutils(espace , mwc);202 actionsBarreOutils(espace); 204 203 205 204 } … … 236 235 } 237 236 /*****************************************************************************************************************************/ 238 void MainWindow::callHatModel(){237 /*void MainWindow::callHatModel(){ 239 238 //mwc.setFileListController("wwww.h"); 240 239 MainWindowController & mwc2 = MainWindowController::getInstance(); … … 248 247 249 248 /********************************** Implementation de la methode actionsBarreOutils() ****************************************/ 250 void MainWindow::actionsBarreOutils(QWorkspace *espace , MainWindowController mwc) {249 void MainWindow::actionsBarreOutils(QWorkspace *espace) { 251 250 252 251 m_ConstantButton = new QPushButton(tr("Constant"), this); 253 252 m_ConstantButton->setToolTip("Bouton désactivé. Vous devez d'abord creer un nouveau projet ou en ouvrir un."); 254 m_ConstantCopy = mwc.getConstant();253 m_ConstantCopy = new ConstantWindow; 255 254 espace->addWindow(m_ConstantCopy); 256 255 m_ConstantCopy->hide(); … … 261 260 262 261 m_hatNameButton = new QPushButton(tr("Hatname"), this); 263 m_hatCopy = mwc.getHatName();262 m_hatCopy = new HatNameWindow("test");//mwc.getHatName(); 264 263 //m_hatCopy->setLocalProjectName(copynp->getNewProjectName()); 265 264 espace->addWindow(m_hatCopy); … … 268 267 connect(m_hatNameButton, SIGNAL(clicked()), this, SLOT(changeColorHatButton())); 269 268 m_optionButton = new QPushButton(tr("Option"), this); 270 m_optionCopy = mwc.getOption();269 m_optionCopy = new OptionWindow; //mwc.getOption(); 271 270 espace->addWindow(m_optionCopy); 272 271 m_optionCopy->hide(); … … 275 274 276 275 m_trajButton = new QPushButton(tr("Traj"), this); 277 m_trajCopy =mwc.getTraj();278 espace->addWindow(m_trajCopy);279 m_trajCopy->hide();280 connect(m_trajButton, SIGNAL(clicked()), m_trajCopy, SLOT(show()));281 connect(m_trajButton, SIGNAL(clicked()), this, SLOT(changeColorTrajButton()));276 //m_trajCopy = new TrajWindow(); //mwc.getTraj(); 277 //espace->addWindow(m_trajCopy); 278 //m_trajCopy->hide(); 279 //connect(m_trajButton, SIGNAL(clicked()), m_trajCopy, SLOT(show())); 280 //connect(m_trajButton, SIGNAL(clicked()), this, SLOT(changeColorTrajButton())); 282 281 m_spaceButton = new QPushButton(tr("Space"), this); 283 m_spaceCopy = mwc.getSpace();282 m_spaceCopy = new SpaceWindow; //mwc.getSpace(); 284 283 espace->addWindow(m_spaceCopy); 285 284 m_spaceCopy->hide(); … … 287 286 connect(m_spaceButton, SIGNAL(clicked()), this, SLOT(changeColorSpaceButton())); 288 287 m_operaButton = new QPushButton(tr("Opera"), this); 289 m_operaCopy = mwc.getOpera();288 m_operaCopy = new OperaWindow; //mwc.getOpera(); 290 289 espace->addWindow(m_operaCopy); 291 290 m_operaCopy->hide(); … … 294 293 295 294 m_netwardButton = new QPushButton(tr("Netward"), this); 296 m_netwardCopy = mwc.getNetward();295 m_netwardCopy = new NetwardWindow; //mwc.getNetward(); 297 296 espace->addWindow(m_netwardCopy); 298 297 m_netwardCopy->hide(); … … 301 300 302 301 m_modulButton = new QPushButton(tr("Module"), this); 303 m_modulCopy = mwc.getModul();302 m_modulCopy = new ModulWindow; //mwc.getModul(); 304 303 espace->addWindow(m_modulCopy); 305 304 m_modulCopy->hide(); … … 307 306 connect(m_modulButton, SIGNAL(clicked()), this, SLOT(changeColorModulButton())); 308 307 m_ctinButton = new QPushButton(tr("Ctin"), this); 309 m_ctinCopy = mwc.getCtin();308 m_ctinCopy = new CtinWindow; //mwc.getCtin(); 310 309 espace->addWindow(m_ctinCopy); 311 310 m_ctinCopy->hide(); … … 313 312 connect(m_ctinButton, SIGNAL(clicked()), this, SLOT(changeColorCtinButton())); 314 313 m_orderButton = new QPushButton(tr("Order"), this); 315 /* m_orderCopy =mwc.getOrder();314 m_orderCopy = new OrderWindow; //mwc.getOrder(); 316 315 espace->addWindow(m_orderCopy); 317 316 m_orderCopy->hide(); 318 connect(m_orderButton, SIGNAL(clicked()), m_orderCopy, SLOT(show()));*/317 //connect(m_orderButton, SIGNAL(clicked()), m_orderCopy, SLOT(show())); 319 318 connect(m_orderButton, SIGNAL(clicked()), this, SLOT(enConstruction())); 320 319 321 320 m_insertFCTButton = new QPushButton(tr("Insert_fct"), this); 322 m_insertFCTCopy =mwc.getInsertFCT();321 m_insertFCTCopy = new InsertFCTWindow; //mwc.getInsertFCT(); 323 322 espace->addWindow(m_insertFCTCopy); 324 323 m_insertFCTCopy->hide(); … … 374 373 montrerActionGenererD(); 375 374 376 std::cout << copynp->getNewProjectName() << std::endl;375 // std::cout << copynp->getNewProjectName() << std::endl; 377 376 //return true; 378 377 } 379 378 /*********************************** Implémentation de la methode sauvegardeProjet() *****************************************/ 380 379 … … 460 459 /********************************** Implémentation de la methode montrerActionCompilation() ******************************/ 461 460 462 void MainWindow::montrerActionCompilation() {461 /*void MainWindow::montrerActionCompilation() { 463 462 actionCompilation->setEnabled(true); 464 } 463 }*/ 465 464 466 465 /*********************************** Implémentation de la methode appelGenererD *******************************************/ 467 466 468 void MainWindow::appelGenererD()467 /*void MainWindow::appelGenererD() 469 468 { 470 469 //theHeaderList = m_hatCopy->getTheHeaderList(); … … 527 526 528 527 description.close(); 529 } 528 }*/ 530 529 /************************************ Implémentation du slot enConstruction **********************************************/ 531 530 void MainWindow::enConstruction() { … … 574 573 575 574 /*********************************** Implémentation de la méthode closeEvent ********************************************/ 576 void MainWindow::closeEvent(QCloseEvent *event) {575 /*void MainWindow::closeEvent(QCloseEvent *event) { 577 576 578 577 if (maybeSave()) { … … 583 582 event->ignore(); 584 583 585 } 584 }*/ 586 585 /***************************************************************************************************************/ 587 bool MainWindow::maybeSave()586 /*bool MainWindow::maybeSave() 588 587 { 589 588 if (espace->activeWindow()) { … … 600 599 } 601 600 return true; 602 } 601 }*/ 603 602 /*********************************** Implémentation de la méthode okToContinue ********************************************/ 604 bool MainWindow::okToContinue() {603 /*bool MainWindow::okToContinue() { 605 604 606 605 if (this->isWindowModified()) { … … 618 617 619 618 return true; 620 } 619 }*/ 621 620 622 621 /*********************************** Implémentation de la méthode genererSpace ********************************************/ … … 635 634 /*********************************** Implémentation de la methode du destructeur *********************************************/ 636 635 637 MainWindow::~MainWindow() {636 /*MainWindow::~MainWindow() { 638 637 639 638 … … 691 690 delete espace; 692 691 delete tableWidget; 693 } 692 }*/ 694 693 /************************************* Fin du parametrage du destructeur ****************************************************/ 695 694 -
trunk/yao/src/interface/src/MainWindowController.cpp
r214 r216 17 17 //for(vector<string>::iterator it = m_hat->getTheHeaderList().begin(); it != m_hat->getTheHeaderList().end(); it++) 18 18 //setTheHeaderList("test push_back"); 19 MainWindow *fen1 = new MainWindow; //fen1->show(); 20 19 21 npTest = false; 20 np = new NewProjectWindow;22 np = new NewProjectWindow; 21 23 np->hide(); 22 24 //std::cout << /*np->getNewProjectName()*/"chaine in mainwindow controller." << std::endl;
Note: See TracChangeset
for help on using the changeset viewer.