Changeset 443 for trunk/yao


Ignore:
Timestamp:
10/08/10 13:48:30 (14 years ago)
Author:
yerima
Message:

In the InsertFCTWindow, data are restaured in the view after closing the window. Some controls are implemented in the InstructionWindow?'s class like as clicking on only the name of the functions (sub-menu).

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

Legend:

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

    r419 r443  
    1616        localFunctionTable      = aFunctionTable; 
    1717         
     18         
    1819        QRegExp regExp("[A-Za-z_][A-Za-z0-9_]*"); 
    1920        m_insertFCTNameLine->setValidator(new QRegExpValidator(regExp, this)); 
     
    2829        m_insertFCTTableView->resizeColumnsToContents(); 
    2930                         
    30        
     31        for (Table<Function>::iterator it = localFunctionTable->begin(); it != localFunctionTable->end(); it++) { 
     32                m_insertFCTModel->setItem(m_insertFCTModel->rowCount(), 0, new QStandardItem(QString(it->getName().c_str())));   
     33                it->isParameterized()? m_insertFCTModel->setItem(m_insertFCTModel->rowCount()-1, 1, new QStandardItem(QString("oui"))) : m_insertFCTModel->setItem(m_insertFCTModel->rowCount()-1, 1, new QStandardItem(QString("non"))); 
     34        } 
     35 
     36         
     37         
    3138        connect(m_insertFCTAddButton, SIGNAL(clicked()), this, SLOT(addInsertRow())); /*!< To add rows in the tableview after clicking on the button "Add"*/ 
    3239        connect(m_insertFCTDelButton, SIGNAL(clicked()), this, SLOT(deleteRowFCT())); /*!< This slot delete a row after a click on the button "Supprimer" */ 
  • trunk/yao/src/interface/src/InstructionWindow.cpp

    r442 r443  
    1515 
    1616using namespace std; 
    17 //using namespace yao; 
     17using namespace yao; 
    1818 
    1919 
     
    2222 
    2323/*********************************************************************************************************************************/ 
    24 InstructionWindow::InstructionWindow(/*yao::Table <yao::Function> *aFunctionTable,*/ QWidget *parent) : QWidget(parent) { 
     24InstructionWindow::InstructionWindow(Table <Function> *aFunctionTable, QWidget *parent) : QWidget(parent) { 
    2525 
    2626        setupUi(this); 
     27         
     28        localFunctionTable      = aFunctionTable;        
     29 
    2730        m_rightButton->setIcon(QIcon("Images/icons/rightarrow2.png")); 
    2831        m_instructionLeftModel = new QStandardItemModel(0, 1);//Model in one column whitch contained the possibles functions used in the process of generation of the instruction file.  
     
    8184        user_functions = new QStandardItem("Fonction(s) de l'utilisateur."); 
    8285                m_instructionLeftModel->appendRow(user_functions); 
    83                 for (int i = 0; i< 4; i++) 
    84                 user_functions->appendRow(new QStandardItem("Par défaut")); 
     86                for (Table<Function>::iterator it = localFunctionTable->begin(); it != localFunctionTable->end(); it++) { 
     87                        user_functions->appendRow(new QStandardItem(QString(it->getName().c_str()))); 
     88                } 
     89 
    8590 
    8691        m_instructionLeftModel->setHorizontalHeaderLabels(QStringList() << "Fonctions proposées"); 
     
    9196        m_choosedParametersTableView->setModel(m_instructionRightModel);         
    9297        m_choosedParametersTableView->resizeColumnsToContents(); 
     98         
    9399        connect(m_proposedParametersListView, SIGNAL(clicked(QModelIndex )), this, SLOT(selectedFunction(QModelIndex ))); 
    94100        connect(m_rightButton, SIGNAL(clicked()), this, SLOT(addInstructionRow())); 
     
    97103/********************************* Implementation of the selectedFunction(QModelIndex index) method  ***********************************/ 
    98104void InstructionWindow::selectedFunction(QModelIndex index) { 
     105         
     106        QString tampon; 
    99107 
    100108        QItemSelectionModel *selection = m_proposedParametersListView->selectionModel(); 
     
    102110        QVariant element = m_instructionLeftModel->data(index, Qt::DisplayRole); 
    103111        QString chaine = element.toString();//.toStdString(); 
    104         m_fonctionNameLineEdit->setText(chaine); 
     112 
     113        for (int i = 0; i < 8 ; i++) { 
     114            
     115                 tampon.append(chaine.at(i));// To extract the nine first characteres from the string (which will be compared with "Fonctions").     
     116                  
     117         } 
     118         
     119        if (tampon.compare("Fonction", Qt::CaseSensitive) == 0)  
     120                return; 
     121        else { 
     122                 
     123                m_fonctionNameLineEdit->setText(chaine); 
     124        } 
     125                         
     126 
    105127        //QMessageBox::about(this, "Avis", chaine); 
    106128        //int r = index.row(); 
     
    114136        QString val  = m_fonctionParameterLineEdit->text(); 
    115137         
     138        /*QString tampon; 
     139         
     140        for (int i = 0; i < 8 ; i++) { 
     141                 
     142                tampon.append(nom.at(i));// To extract the nine first characteres from the string (which will be compared with "Fonctions").     
     143                                 
     144        }*/ 
    116145        if (nom.isEmpty()){  
    117146   
     
    125154                    //      Constant localConstant (Nom.toStdString(), Val.toStdString()); 
    126155                    //              m_localConstantTable->push_back(localConstant); 
    127                         m_instructionRightModel->setItem(m_instructionRightModel->rowCount(), 0, new QStandardItem(nom)); 
    128                         m_instructionRightModel->setItem(m_instructionRightModel->rowCount()-1, 1, new QStandardItem(val)); 
     156                         
     157                                m_instructionRightModel->setItem(m_instructionRightModel->rowCount(), 0, new QStandardItem(nom)); 
     158                                m_instructionRightModel->setItem(m_instructionRightModel->rowCount()-1, 1, new QStandardItem(val)); 
    129159                                 
    130                         m_fonctionNameLineEdit->setText(""); 
    131                         m_fonctionParameterLineEdit->setText(""); 
     160                                m_fonctionNameLineEdit->setText(""); 
     161                                m_fonctionParameterLineEdit->setText(""); 
    132162                  } 
    133163 
  • trunk/yao/src/interface/src/MainWindow.cpp

    r442 r443  
    928928 
    929929         
    930         InstructionWindow *iw = new InstructionWindow(/*&theFunctionTable*/) ; 
     930        InstructionWindow *iw = new InstructionWindow(&theFunctionTable) ; 
    931931        espace.addWindow(iw)->move(0, 0);  
    932932        iw->show();      
  • trunk/yao/src/interface/src/include/InstructionWindow.hpp

    r442 r443  
    1313#include <QMessageBox>  
    1414#include "../../ui_instructionwindow.h" 
     15#include "../../../YAOObjects/Table.hpp" 
    1516#include "../../../YAOObjects/Function.hpp" 
    1617 
     
    2223 
    2324        public : 
    24                 InstructionWindow(/*yao::Table <yao::Function> *aFunctionTable,*/ QWidget *parent=0); 
     25                InstructionWindow(yao::Table <yao::Function> *aFunctionTable, QWidget *parent=0); 
    2526 
    2627        private slots: 
     
    4344                QStandardItem *execution;  
    4445                QStandardItem *user_functions;  
     46                 
     47                yao::Table <yao::Function>  *localFunctionTable; 
    4548                 //QStandardItemModel *m_orderModel; 
    4649}; 
  • trunk/yao/src/interface/src/ui_/modinspace.ui

    r441 r443  
    88    <y>0</y> 
    99    <width>620</width> 
    10     <height>458</height> 
     10    <height>419</height> 
    1111   </rect> 
    1212  </property> 
     
    2020     <y>50</y> 
    2121     <width>321</width> 
    22      <height>401</height> 
     22     <height>361</height> 
    2323    </rect> 
    2424   </property> 
     
    4747      <x>20</x> 
    4848      <y>90</y> 
    49       <width>78</width> 
     49      <width>91</width> 
    5050      <height>27</height> 
    5151     </rect> 
     
    6969     <rect> 
    7070      <x>20</x> 
    71       <y>200</y> 
     71      <y>190</y> 
    7272      <width>59</width> 
    7373      <height>17</height> 
     
    8282     <rect> 
    8383      <x>20</x> 
    84       <y>290</y> 
    85       <width>78</width> 
     84      <y>260</y> 
     85      <width>91</width> 
    8686      <height>27</height> 
    8787     </rect> 
     
    9191    <property name="geometry"> 
    9292     <rect> 
    93       <x>120</x> 
    94       <y>290</y> 
     93      <x>130</x> 
     94      <y>260</y> 
    9595      <width>26</width> 
    9696      <height>25</height> 
     
    120120      <y>30</y> 
    121121      <width>131</width> 
    122       <height>361</height> 
     122      <height>321</height> 
    123123     </rect> 
    124124    </property> 
     
    152152     <y>10</y> 
    153153     <width>271</width> 
    154      <height>441</height> 
     154     <height>401</height> 
    155155    </rect> 
    156156   </property> 
     
    167167      <y>40</y> 
    168168      <width>251</width> 
    169       <height>391</height> 
     169      <height>351</height> 
    170170     </rect> 
    171171    </property> 
  • trunk/yao/src/interface/src/ui_/orderwindow.ui

    r441 r443  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>649</width> 
    10     <height>578</height> 
     9    <width>639</width> 
     10    <height>536</height> 
    1111   </rect> 
    1212  </property> 
     
    1919     <x>10</x> 
    2020     <y>60</y> 
    21      <width>631</width> 
    22      <height>461</height> 
     21     <width>621</width> 
     22     <height>431</height> 
    2323    </rect> 
    2424   </property> 
     
    5656    <rect> 
    5757     <x>10</x> 
    58      <y>530</y> 
    59      <width>631</width> 
     58     <y>500</y> 
     59     <width>621</width> 
    6060     <height>29</height> 
    6161    </rect> 
  • trunk/yao/src/interface/src/ui_/spaceintraj.ui

    r441 r443  
    88    <y>0</y> 
    99    <width>618</width> 
    10     <height>460</height> 
     10    <height>417</height> 
    1111   </rect> 
    1212  </property> 
     
    2020     <y>80</y> 
    2121     <width>301</width> 
    22      <height>371</height> 
     22     <height>331</height> 
    2323    </rect> 
    2424   </property> 
     
    3333     <rect> 
    3434      <x>10</x> 
    35       <y>170</y> 
    36       <width>91</width> 
     35      <y>160</y> 
     36      <width>101</width> 
    3737      <height>27</height> 
    3838     </rect> 
     
    4343     <rect> 
    4444      <x>120</x> 
    45       <y>170</y> 
     45      <y>160</y> 
    4646      <width>26</width> 
    4747      <height>25</height> 
     
    5656     <rect> 
    5757      <x>160</x> 
    58       <y>10</y> 
     58      <y>90</y> 
    5959      <width>131</width> 
    60       <height>341</height> 
     60      <height>171</height> 
    6161     </rect> 
    6262    </property> 
     
    6969     <y>10</y> 
    7070     <width>291</width> 
    71      <height>441</height> 
     71     <height>401</height> 
    7272    </rect> 
    7373   </property> 
     
    8484      <y>40</y> 
    8585      <width>271</width> 
    86       <height>391</height> 
     86      <height>351</height> 
    8787     </rect> 
    8888    </property> 
  • trunk/yao/src/interface/ui_newprojectwindow.h

    r442 r443  
    22** Form generated from reading UI file 'newprojectwindow.ui' 
    33** 
    4 ** Created: Thu Oct 7 14:11:53 2010 
     4** Created: Thu Oct 7 18:17:25 2010 
    55**      by: Qt User Interface Compiler version 4.6.3 
    66** 
Note: See TracChangeset for help on using the changeset viewer.