Changeset 455 for trunk/yao


Ignore:
Timestamp:
10/16/10 20:40:11 (14 years ago)
Author:
yerima
Message:

The system files are correctly showed in the QTreeView.

Location:
trunk/yao/src/interface/src
Files:
3 edited

Legend:

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

    r317 r455  
    11//! \file    FilesViewer.cpp 
    22//! \brief   Implementation of the FileViewer window for visual_YAO. 
    3 //! \version 2009/11/09 (yyyy/mm/dd) 
    4 //! \author  MAYAKI Abdouramane & MAYOMBO Alexis. 
     3//! \version 2010/10/16 (yyyy/mm/dd) 
     4//! \author  MAYAKI Abdouramane. 
    55 
    66 
     
    1818        setWindowTitle(tr("Arborescence des fichiers")); 
    1919 
    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. 
    2222        //modeleFichiers->setSorting(QDir::DirsFirst | QDir::IgnoreCase | QDir::Name); 
    2323 
    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. 
    2626        vueFichiers->setRootIndex(modeleFichiers->index(QString(projectPath.c_str()))); 
    2727        vueFichiers->header()->setStretchLastSection(true); 
     
    3333        vueFichiers->scrollTo(index); 
    3434        vueFichiers->resizeColumnToContents(0); 
     35        vueFichiers->setColumnWidth(0, 240); //To set the column's width (here column 0). 
    3536 
    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. 
    3940 
    4041    connect(mkdirButton, SIGNAL(clicked()), this, SLOT(createDirectory())); 
    41     connect(removeButton, SIGNAL(clicked()), this, SLOT(remove())); 
     42    connect(removeButton, SIGNAL(clicked()), this, SLOT(removeFilesOrDirectory())); 
    4243    connect(boutonActualiser, SIGNAL(clicked()), modeleFichiers, SLOT(refresh())); 
    4344 
     
    5657} 
    5758 
    58 /*******************************************************************************************************************************/ 
     59/****************************************** Implementation of the createDirectory method. (SLOT) *****************************************/ 
    5960void FilesViewer::createDirectory() 
    6061{ 
     
    7273} 
    7374 
    74 /*******************************************************************************************************************************/ 
    75 void FilesViewer::remove() 
     75/***************************************** Implementation of the removeFilesOrDirectory ******************************************************/ 
     76void FilesViewer::removeFilesOrDirectory() 
    7677{ 
    7778    QModelIndex index = vueFichiers->currentIndex(); 
     
    9091} 
    9192 
    92 /*******************************************************************************************************************************/ 
    93 void FilesViewer::appelActualiser() 
     93/************************************** Implementation of the updateTheView method ***********************************************/ 
     94void FilesViewer::updateTheView() 
    9495{ 
    95     modeleFichiers->refresh(); 
     96    modeleFichiers->refresh();//To refresh the view. 
    9697} 
    9798 
  • trunk/yao/src/interface/src/MainWindow.cpp

    r454 r455  
    525525        m_projectPath = m_newProjectWindow->getProjectPath(); 
    526526        if (!m_newProjectName.empty()) { 
     527                clearAllStructures();// To eraze Yao structure before creating the new project. 
    527528                theHeaderList.push_back(m_newProjectWindow->getProjectName() + ".h"); 
    528                 clearAllStructures();// To eraze Yao structure before creating the new project. 
    529529                emit WindowTitleChanged(); //Emits the signal to change the window's title.  
    530530                emit newProjectIsCreated();//Emits the signal that the project is created. 
    531531                activateToolBarButtons(); // To active the toolbar buttons. 
    532532        } 
    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. 
    534534        //connect(m_newProjectWindow, SIGNAL(newProjectIsCreated()), this, SLOT(activateToolBarButtons())); 
    535535        //      connect(m_newProjectWindow, SIGNAL(projectDone()), this, SLOT(clearAllStructures())); 
     
    594594        m_projectPath = m_newProjectWindow->getProjectPath(); 
    595595        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. 
    597597        //connect(m_newProjectWindow, SIGNAL(newProjectIsCreated()), this, SLOT(activateToolBarButtons())); 
    598598        activateToolBarButtons(); 
  • trunk/yao/src/interface/src/include/FilesViewer.hpp

    r317 r455  
    1414        public: 
    1515 
    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(); 
    1818 
    1919 
    2020        public slots: 
    2121 
    22             void createDirectory(); 
    23             void remove(); 
     22                void createDirectory(); 
     23                void removeFilesOrDirectory(); 
    2424 
    2525        private: 
    2626 
    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; 
    3532 
    3633}; 
Note: See TracChangeset for help on using the changeset viewer.