- Timestamp:
- 10/16/10 20:40:11 (14 years ago)
- Location:
- trunk/yao/src/interface/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/src/FilesViewer.cpp
r317 r455 1 1 //! \file FilesViewer.cpp 2 2 //! \brief Implementation of the FileViewer window for visual_YAO. 3 //! \version 20 09/11/09(yyyy/mm/dd)4 //! \author MAYAKI Abdouramane & MAYOMBO Alexis.3 //! \version 2010/10/16 (yyyy/mm/dd) 4 //! \author MAYAKI Abdouramane. 5 5 6 6 … … 18 18 setWindowTitle(tr("Arborescence des fichiers")); 19 19 20 modeleFichiers = new QDirModel;// Choix du modÚle.21 modeleFichiers->setReadOnly(false);// AccÚs en lecture.20 modeleFichiers = new QDirModel;//The computer files system directories' model. 21 modeleFichiers->setReadOnly(false);//Read only access. 22 22 //modeleFichiers->setSorting(QDir::DirsFirst | QDir::IgnoreCase | QDir::Name); 23 23 24 vueFichiers = new QTreeView;// La vue en arbre.25 vueFichiers->setModel(modeleFichiers); // La vue prend en compte son modÚle.24 vueFichiers = new QTreeView;//The tree view. 25 vueFichiers->setModel(modeleFichiers); //The view take here the model. 26 26 vueFichiers->setRootIndex(modeleFichiers->index(QString(projectPath.c_str()))); 27 27 vueFichiers->header()->setStretchLastSection(true); … … 33 33 vueFichiers->scrollTo(index); 34 34 vueFichiers->resizeColumnToContents(0); 35 vueFichiers->setColumnWidth(0, 240); //To set the column's width (here column 0). 35 36 36 mkdirButton = new QPushButton(tr("&Creer un repertoire")); 37 removeButton = new QPushButton(tr("&Supprimer")); 38 boutonActualiser = new QPushButton("Actualiser"); 37 mkdirButton = new QPushButton(tr("&Creer un repertoire"));//To create a directory from the view. 38 removeButton = new QPushButton(tr("&Supprimer"));//To remove files and directories from the view. 39 boutonActualiser = new QPushButton("Actualiser");//To update the view. 39 40 40 41 connect(mkdirButton, SIGNAL(clicked()), this, SLOT(createDirectory())); 41 connect(removeButton, SIGNAL(clicked()), this, SLOT(remove ()));42 connect(removeButton, SIGNAL(clicked()), this, SLOT(removeFilesOrDirectory())); 42 43 connect(boutonActualiser, SIGNAL(clicked()), modeleFichiers, SLOT(refresh())); 43 44 … … 56 57 } 57 58 58 /****************************************** *************************************************************************************/59 /****************************************** Implementation of the createDirectory method. (SLOT) *****************************************/ 59 60 void FilesViewer::createDirectory() 60 61 { … … 72 73 } 73 74 74 /***************************************** **************************************************************************************/75 void FilesViewer::remove ()75 /***************************************** Implementation of the removeFilesOrDirectory ******************************************************/ 76 void FilesViewer::removeFilesOrDirectory() 76 77 { 77 78 QModelIndex index = vueFichiers->currentIndex(); … … 90 91 } 91 92 92 /************************************** *****************************************************************************************/93 void FilesViewer:: appelActualiser()93 /************************************** Implementation of the updateTheView method ***********************************************/ 94 void FilesViewer::updateTheView() 94 95 { 95 modeleFichiers->refresh(); 96 modeleFichiers->refresh();//To refresh the view. 96 97 } 97 98 -
trunk/yao/src/interface/src/MainWindow.cpp
r454 r455 525 525 m_projectPath = m_newProjectWindow->getProjectPath(); 526 526 if (!m_newProjectName.empty()) { 527 clearAllStructures();// To eraze Yao structure before creating the new project. 527 528 theHeaderList.push_back(m_newProjectWindow->getProjectName() + ".h"); 528 clearAllStructures();// To eraze Yao structure before creating the new project.529 529 emit WindowTitleChanged(); //Emits the signal to change the window's title. 530 530 emit newProjectIsCreated();//Emits the signal that the project is created. 531 531 activateToolBarButtons(); // To active the toolbar buttons. 532 532 } 533 fv-> appelActualiser(); //Permet de mettre à jour automatiquement la liste des fichiers visibles dans filesviewer.533 fv->updateTheView(); //Permet de mettre à jour automatiquement la liste des fichiers visibles dans filesviewer. 534 534 //connect(m_newProjectWindow, SIGNAL(newProjectIsCreated()), this, SLOT(activateToolBarButtons())); 535 535 // connect(m_newProjectWindow, SIGNAL(projectDone()), this, SLOT(clearAllStructures())); … … 594 594 m_projectPath = m_newProjectWindow->getProjectPath(); 595 595 theHeaderList.push_back(m_newProjectWindow->getProjectName() + ".h"); 596 fv-> appelActualiser(); //Permet de mettre à jour automatiquement la liste des fichiers visibles dans filesviewer.596 fv->updateTheView(); //To refresh the view from FileViewer class. 597 597 //connect(m_newProjectWindow, SIGNAL(newProjectIsCreated()), this, SLOT(activateToolBarButtons())); 598 598 activateToolBarButtons(); -
trunk/yao/src/interface/src/include/FilesViewer.hpp
r317 r455 14 14 public: 15 15 16 FilesViewer(std::string projectPath="projects/", QWidget *parent = 0);17 void appelActualiser();16 FilesViewer(std::string projectPath="projects/", QWidget *parent = 0);//The projectPath is initialized with project/ by default. 17 void updateTheView(); 18 18 19 19 20 20 public slots: 21 21 22 23 void remove();22 void createDirectory(); 23 void removeFilesOrDirectory(); 24 24 25 25 private: 26 26 27 QTreeView *vueFichiers; 28 29 public: 30 31 QDirModel *modeleFichiers; 32 QPushButton *mkdirButton; 33 QPushButton *removeButton; 34 QPushButton *boutonActualiser; 27 QTreeView *vueFichiers; 28 QDirModel *modeleFichiers; 29 QPushButton *mkdirButton; 30 QPushButton *removeButton; 31 QPushButton *boutonActualiser; 35 32 36 33 };
Note: See TracChangeset
for help on using the changeset viewer.