Back to index

fet  5.18.0
activitiesform.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                           activitiesform.cpp  -  description
00003                              -------------------
00004     begin                : Wed Apr 23 2003
00005     copyright            : (C) 2003 by Lalescu Liviu
00006     email                : Please see http://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address)
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "timetable_defs.h"
00019 #include "fet.h"
00020 #include "timetable.h"
00021 
00022 #include "studentsset.h"
00023 
00024 #include "activitiesform.h"
00025 #include "addactivityform.h"
00026 #include "modifyactivityform.h"
00027 
00028 #include "activityplanningform.h"
00029 
00030 #include <QString>
00031 #include <QMessageBox>
00032 
00033 #include <QListWidget>
00034 #include <QScrollBar>
00035 #include <QAbstractItemView>
00036 
00037 #include "longtextmessagebox.h"
00038 
00039 #include <QBrush>
00040 #include <QPalette>
00041 
00042 #include <QSplitter>
00043 #include <QSettings>
00044 #include <QObject>
00045 #include <QMetaObject>
00046 
00047 extern const QString COMPANY;
00048 extern const QString PROGRAM;
00049 
00050 ActivitiesForm::ActivitiesForm(QWidget* parent, const QString& teacherName, const QString& studentsSetName, const QString& subjectName, const QString& activityTagName): QDialog(parent)
00051 {
00052        setupUi(this);
00053        
00054        activityTextEdit->setReadOnly(true);
00055 
00056        modifyActivityPushButton->setDefault(true);
00057 
00058        activitiesListWidget->setSelectionMode(QAbstractItemView::SingleSelection);
00059 
00060        connect(activitiesListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(activityChanged()));
00061        connect(addActivityPushButton, SIGNAL(clicked()), this, SLOT(addActivity()));
00062        connect(removeActivityPushButton, SIGNAL(clicked()), this, SLOT(removeActivity()));
00063        connect(closePushButton, SIGNAL(clicked()), this, SLOT(close()));
00064        connect(teachersComboBox, SIGNAL(activated(QString)), this, SLOT(filterChanged()));
00065        connect(studentsComboBox, SIGNAL(activated(QString)), this, SLOT(studentsFilterChanged()));
00066        connect(subjectsComboBox, SIGNAL(activated(QString)), this, SLOT(filterChanged()));
00067        connect(modifyActivityPushButton, SIGNAL(clicked()), this, SLOT(modifyActivity()));
00068        connect(activityTagsComboBox, SIGNAL(activated(QString)), this, SLOT(filterChanged()));
00069        connect(activitiesListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(modifyActivity()));
00070        connect(recursiveCheckBox, SIGNAL(toggled(bool)), this, SLOT(studentsFilterChanged()));
00071        connect(helpPushButton, SIGNAL(clicked()), this, SLOT(help()));
00072        connect(commentsPushButton, SIGNAL(clicked()), this, SLOT(activityComments()));
00073 
00074        centerWidgetOnScreen(this);
00075        restoreFETDialogGeometry(this);
00076        //restore splitter state
00077        QSettings settings(COMPANY, PROGRAM);
00078        if(settings.contains(this->metaObject()->className()+QString("/splitter-state")))
00079               splitter->restoreState(settings.value(this->metaObject()->className()+QString("/splitter-state")).toByteArray());
00080        
00081        QSize tmp1=teachersComboBox->minimumSizeHint();
00082        Q_UNUSED(tmp1);
00083        QSize tmp2=studentsComboBox->minimumSizeHint();
00084        Q_UNUSED(tmp2);
00085        QSize tmp3=subjectsComboBox->minimumSizeHint();
00086        Q_UNUSED(tmp3);
00087        QSize tmp4=activityTagsComboBox->minimumSizeHint();
00088        Q_UNUSED(tmp4);
00089 
00090        teachersComboBox->addItem("");
00091        int cit=0;
00092        for(int i=0; i<gt.rules.teachersList.size(); i++){
00093               Teacher* tch=gt.rules.teachersList[i];
00094               teachersComboBox->addItem(tch->name);
00095               if(tch->name==teacherName)
00096                      cit=i+1;
00097        }
00098        teachersComboBox->setCurrentIndex(cit);
00099 
00100        subjectsComboBox->addItem("");
00101        int cisu=0;
00102        for(int i=0; i<gt.rules.subjectsList.size(); i++){
00103               Subject* sb=gt.rules.subjectsList[i];
00104               subjectsComboBox->addItem(sb->name);
00105               if(sb->name==subjectName)
00106                      cisu=i+1;
00107        }
00108        subjectsComboBox->setCurrentIndex(cisu);
00109 
00110        activityTagsComboBox->addItem("");
00111        int ciat=0;
00112        for(int i=0; i<gt.rules.activityTagsList.size(); i++){
00113               ActivityTag* st=gt.rules.activityTagsList[i];
00114               activityTagsComboBox->addItem(st->name);
00115               if(st->name==activityTagName)
00116                      ciat=i+1;
00117        }
00118        activityTagsComboBox->setCurrentIndex(ciat);
00119 
00120        studentsComboBox->addItem("");
00121        int cist=0;
00122        int currentID=0;
00123        for(int i=0; i<gt.rules.yearsList.size(); i++){
00124               StudentsYear* sty=gt.rules.yearsList[i];
00125               studentsComboBox->addItem(sty->name);
00126               currentID++;
00127               if(sty->name==studentsSetName)
00128                      cist=currentID;
00129               for(int j=0; j<sty->groupsList.size(); j++){
00130                      StudentsGroup* stg=sty->groupsList[j];
00131                      studentsComboBox->addItem(stg->name);
00132                      currentID++;
00133                      if(stg->name==studentsSetName)
00134                             cist=currentID;
00135                      for(int k=0; k<stg->subgroupsList.size(); k++){
00136                             StudentsSubgroup* sts=stg->subgroupsList[k];
00137                             studentsComboBox->addItem(sts->name);
00138                             currentID++;
00139                             if(sts->name==studentsSetName)
00140                                    cist=currentID;
00141                      }
00142               }
00143        }
00144        studentsComboBox->setCurrentIndex(cist);
00145        
00146        if(studentsSetName!=""){
00147               this->studentsFilterChanged();
00148        }
00149        else{
00150               showedStudents.clear();
00151               showedStudents.insert("");
00152        
00153               filterChanged();
00154        }
00155 }
00156 
00157 ActivitiesForm::~ActivitiesForm()
00158 {
00159        saveFETDialogGeometry(this);
00160        //save splitter state
00161        QSettings settings(COMPANY, PROGRAM);
00162        settings.setValue(this->metaObject()->className()+QString("/splitter-state"), splitter->saveState());
00163 }
00164 
00165 bool ActivitiesForm::filterOk(Activity* act)
00166 {
00167        QString tn=teachersComboBox->currentText();
00168        QString stn=studentsComboBox->currentText();
00169        QString sbn=subjectsComboBox->currentText();
00170        QString sbtn=activityTagsComboBox->currentText();
00171        int ok=true;
00172 
00173        //teacher
00174        if(tn!=""){
00175               bool ok2=false;
00176               for(QStringList::Iterator it=act->teachersNames.begin(); it!=act->teachersNames.end(); it++)
00177                      if(*it == tn){
00178                             ok2=true;
00179                             break;
00180                      }
00181               if(!ok2)
00182                      ok=false;
00183        }
00184 
00185        //subject
00186        if(sbn!="" && sbn!=act->subjectName)
00187               ok=false;
00188               
00189        //activity tag
00190        if(sbtn!="" && !act->activityTagsNames.contains(sbtn))
00191               ok=false;
00192               
00193        //students
00194        if(stn!=""){
00195               bool ok2=false;
00196               for(QStringList::Iterator it=act->studentsNames.begin(); it!=act->studentsNames.end(); it++)
00197                      //if(*it == stn){
00198                      if(showedStudents.contains(*it)){
00199                             ok2=true;
00200                             break;
00201                      }
00202               if(!ok2)
00203                      ok=false;
00204        }
00205        else{
00206               assert(showedStudents.count()==1);
00207               assert(showedStudents.contains(""));
00208        }
00209        
00210        return ok;
00211 }
00212 
00213 void ActivitiesForm::studentsFilterChanged()
00214 {
00215        bool showContained=recursiveCheckBox->isChecked();
00216        
00217        showedStudents.clear();
00218        
00219        if(!showContained){
00220               showedStudents.insert(studentsComboBox->currentText());
00221        }
00222        else{
00223               if(studentsComboBox->currentText()=="")
00224                      showedStudents.insert("");
00225               else{
00226                      //down
00227                      StudentsSet* set=gt.rules.searchStudentsSet(studentsComboBox->currentText());
00228                      assert(set!=NULL);
00229                      if(set->type==STUDENTS_YEAR){
00230                             StudentsYear* year=(StudentsYear*)set;
00231                             showedStudents.insert(year->name);
00232                             foreach(StudentsGroup* group, year->groupsList){
00233                                    showedStudents.insert(group->name);
00234                                    foreach(StudentsSubgroup* subgroup, group->subgroupsList)
00235                                           showedStudents.insert(subgroup->name);
00236                             }
00237                      }
00238                      else if(set->type==STUDENTS_GROUP){
00239                             StudentsGroup* group=(StudentsGroup*) set;
00240                             showedStudents.insert(group->name);
00241                             foreach(StudentsSubgroup* subgroup, group->subgroupsList)
00242                                    showedStudents.insert(subgroup->name);
00243                      }
00244                      else if(set->type==STUDENTS_SUBGROUP){
00245                             StudentsSubgroup* subgroup=(StudentsSubgroup*) set;
00246                             showedStudents.insert(subgroup->name);
00247                      }
00248                      else
00249                             assert(0);
00250                             
00251                      //up
00252                      QString crt=studentsComboBox->currentText();
00253                      foreach(StudentsYear* year, gt.rules.yearsList){
00254                             foreach(StudentsGroup* group, year->groupsList){
00255                                    if(group->name==crt){
00256                                           showedStudents.insert(year->name);
00257                                    }
00258                                    foreach(StudentsSubgroup* subgroup, group->subgroupsList){
00259                                           if(subgroup->name==crt){
00260                                                  showedStudents.insert(year->name);
00261                                                  showedStudents.insert(group->name);
00262                                           }
00263                                    }
00264                             }
00265                      }
00266               }
00267        }
00268        
00269        filterChanged();
00270 }
00271 
00272 void ActivitiesForm::filterChanged()
00273 {
00274        int nacts=0, nsubacts=0, nh=0;
00275        int ninact=0, ninacth=0;
00276 
00277        QString s;
00278        activitiesListWidget->clear();
00279        visibleActivitiesList.clear();
00280        
00281        int k=0;
00282        for(int i=0; i<gt.rules.activitiesList.size(); i++){
00283               Activity* act=gt.rules.activitiesList[i];
00284               if(this->filterOk(act)){
00285                      s=act->getDescription(gt.rules);
00286                      visibleActivitiesList.append(act);
00287                      activitiesListWidget->addItem(s);
00288                      k++;
00289                      
00290                      if(USE_GUI_COLORS && !act->active)
00291                             activitiesListWidget->item(k-1)->setBackground(activitiesListWidget->palette().alternateBase());
00292                      
00293                      if(act->id==act->activityGroupId || act->activityGroupId==0)
00294                             nacts++;
00295                      nsubacts++;
00296                      
00297                      nh+=act->duration;
00298                      
00299                      if(!act->active){
00300                             ninact++;
00301                             ninacth+=act->duration;
00302                      }
00303               }
00304        }
00305        
00306        assert(nsubacts-ninact>=0);
00307        assert(nh-ninacth>=0);
00308        activeTextLabel->setText(tr("No: %1 / %2", "No means number, %1 is the number of active activities, %2 is the number of total activities."
00309               " Please leave spaces between fields, so that they are better visible").arg(nsubacts-ninact).arg(nsubacts));
00310        totalTextLabel->setText(tr("Dur: %1 / %2", "Dur means duration, %1 is the duration of active activities, %2 is the duration of total activities."
00311               " Please leave spaces between fields, so that they are better visible").arg(nh-ninacth).arg(nh));
00312        
00313        if(activitiesListWidget->count()>0)
00314               activitiesListWidget->setCurrentRow(0);
00315        else
00316               activityTextEdit->setPlainText(QString(""));
00317 }
00318 
00319 void ActivitiesForm::addActivity()
00320 {
00321        int nInitialActs=gt.rules.activitiesList.count();
00322 
00323        QString tn=teachersComboBox->currentText();
00324        QString stn=studentsComboBox->currentText();
00325        QString sn=subjectsComboBox->currentText();
00326        QString atn=activityTagsComboBox->currentText();
00327        
00328        AddActivityForm addActivityForm(this, tn, stn, sn, atn);
00329        setParentAndOtherThings(&addActivityForm, this);
00330        addActivityForm.exec();
00331 
00332        if(gt.rules.activitiesList.count()!=nInitialActs){
00333               assert(gt.rules.activitiesList.count()>nInitialActs);
00334 
00335               //rebuild the activities list box
00336               filterChanged();
00337        
00338               int ind=activitiesListWidget->count()-1;
00339               if(ind>=0)
00340                      activitiesListWidget->setCurrentRow(ind);
00341        }
00342 }
00343 
00344 void ActivitiesForm::modifyActivity()
00345 {
00346        int ind=activitiesListWidget->currentRow();
00347        if(ind<0){
00348               QMessageBox::information(this, tr("FET information"), tr("Invalid selected activity"));
00349               return;
00350        }
00351        
00352        assert(ind<visibleActivitiesList.count());
00353        
00354        int valv=activitiesListWidget->verticalScrollBar()->value();
00355        int valh=activitiesListWidget->horizontalScrollBar()->value();
00356 
00357        Activity* act=visibleActivitiesList[ind];
00358        assert(act!=NULL);
00359        
00360        QStringList teachers=act->teachersNames;
00361        bool diffTeachers=false;
00362        
00363        QString subject=act->subjectName;
00364        bool diffSubject=false;
00365        
00366        QStringList activityTags=act->activityTagsNames;
00367        bool diffActivityTags=false;
00368        
00369        QStringList students=act->studentsNames;
00370        bool diffStudents=false;
00371        
00372        int nTotalStudents=act->nTotalStudents;
00373        bool diffNTotalStudents=false;
00374        
00375        bool computeNTotalStudents=act->computeNTotalStudents;
00376        bool diffComputeNTotalStudents=false;
00377        
00378        if(act->isSplit()){
00379               int nSplit=0;
00380               for(int i=0; i<gt.rules.activitiesList.size(); i++){
00381                      Activity* act2=gt.rules.activitiesList[i];
00382                      if(act2->activityGroupId==act->activityGroupId){
00383                             nSplit++;
00384                             
00385                             if(teachers!=act2->teachersNames)
00386                                    diffTeachers=true;
00387                             if(subject!=act2->subjectName)
00388                                    diffSubject=true;
00389                             if(activityTags!=act2->activityTagsNames)
00390                                    diffActivityTags=true;
00391                             if(students!=act2->studentsNames)
00392                                    diffStudents=true;
00393                             if( /* !computeNTotalStudents && !act2->computeNTotalStudents && */ nTotalStudents!=act2->nTotalStudents )
00394                                    diffNTotalStudents=true;
00395                             if(computeNTotalStudents!=act2->computeNTotalStudents)
00396                                    diffComputeNTotalStudents=true;
00397                      }
00398                      if(nSplit>MAX_SPLIT_OF_AN_ACTIVITY){
00399                             QMessageBox::warning(this, tr("FET information"),
00400                              tr("Cannot modify this large activity, because it contains more than %1 activities.")
00401                              .arg(MAX_SPLIT_OF_AN_ACTIVITY));
00402                             return;
00403                      }
00404               }
00405               
00406               if(diffTeachers || diffSubject || diffActivityTags || diffStudents || diffNTotalStudents || diffComputeNTotalStudents){
00407                      QStringList s;
00408                      if(diffTeachers)
00409                             s.append(tr("different teachers"));
00410                      if(diffSubject)
00411                             s.append(tr("different subject"));
00412                      if(diffActivityTags)
00413                             s.append(tr("different activity tags"));
00414                      if(diffStudents)
00415                             s.append(tr("different students"));
00416                      if(diffComputeNTotalStudents)
00417                             s.append(tr("different boolean variable 'must compute n total students'"));
00418                      if(diffNTotalStudents)
00419                             s.append(tr("different number of students"));
00420                             
00421                      QString s2;
00422                      s2+=tr("The current split activity has subactivities which were individually modified. It is recommended to abort now"
00423                       " and modify individual subactivities from the corresponding menu. Otherwise you will modify the fields for all the subactivities"
00424                       " from this larger split activity.");
00425                      s2+="\n\n";
00426                      s2+=tr("The fields which are different are: %1").arg(s.join(", "));
00427                             
00428                      int t=QMessageBox::warning(this, tr("FET warning"), s2, tr("Abort"), tr("Continue"), QString(), 1, 0);
00429                      
00430                      if(t==0)
00431                             return;
00432               }
00433        }
00434        
00435        ModifyActivityForm modifyActivityForm(this, act->id, act->activityGroupId);
00436        int t;
00437        setParentAndOtherThings(&modifyActivityForm, this);
00438        t=modifyActivityForm.exec();
00439        
00440        if(t==QDialog::Accepted){
00441               filterChanged();
00442        
00443               activitiesListWidget->verticalScrollBar()->setValue(valv);
00444               activitiesListWidget->horizontalScrollBar()->setValue(valh);
00445 
00446               if(ind >= activitiesListWidget->count())
00447                      ind = activitiesListWidget->count()-1;
00448               if(ind>=0)
00449                      activitiesListWidget->setCurrentRow(ind);
00450        }
00451        else{
00452               assert(t==QDialog::Rejected);
00453        }
00454 }
00455 
00456 void ActivitiesForm::removeActivity()
00457 {
00458        int ind=activitiesListWidget->currentRow();
00459        if(ind<0){
00460               QMessageBox::information(this, tr("FET information"), tr("Invalid selected activity"));
00461               return;
00462        }
00463        
00464        assert(ind<visibleActivitiesList.count());
00465 
00466        int valv=activitiesListWidget->verticalScrollBar()->value();
00467        int valh=activitiesListWidget->horizontalScrollBar()->value();
00468 
00469        Activity* act=visibleActivitiesList[ind];
00470        assert(act!=NULL);
00471 
00472        QString s;
00473        s=tr("Remove activity?");
00474        s+="\n";
00475        if(act->isSplit())
00476               s+=tr("There will also be removed the related activities from the same larger split activity");
00477        s+="\n\n";
00478        s+=act->getDetailedDescription(gt.rules);
00479        s+="\n";
00480 
00481        switch( LongTextMessageBox::confirmation( this, tr("FET confirmation"),
00482        s, tr("Yes"), tr("No"), 0, 0, 1 ) ){
00483        case 0: // The user clicked the OK button or pressed Enter
00484               gt.rules.removeActivity(act->id, act->activityGroupId);
00485               PlanningChanged::increasePlanningCommunicationSpinBox();
00486               filterChanged();
00487               break;
00488        case 1: // The user clicked the Cancel or pressed Escape
00489               break;
00490        }
00491 
00492        activitiesListWidget->verticalScrollBar()->setValue(valv);
00493        activitiesListWidget->horizontalScrollBar()->setValue(valh);
00494 
00495        if(ind >= activitiesListWidget->count())
00496               ind = activitiesListWidget->count()-1;
00497        if(ind>=0)
00498               activitiesListWidget->setCurrentRow(ind);
00499 }
00500 
00501 void ActivitiesForm::activityChanged()
00502 {
00503        int index=activitiesListWidget->currentRow();
00504        
00505        if(index<0){
00506               activityTextEdit->setPlainText(QString(""));
00507               return;
00508        }
00509        if(index>=visibleActivitiesList.count()){
00510               activityTextEdit->setPlainText(tr("Invalid activity"));
00511               return;
00512        }
00513 
00514        QString s;
00515        Activity* act=visibleActivitiesList[index];
00516 
00517        assert(act!=NULL);
00518        s=act->getDetailedDescriptionWithConstraints(gt.rules);
00519        activityTextEdit->setPlainText(s);
00520 }
00521 
00522 void ActivitiesForm::help()
00523 {
00524        QString s;
00525        
00526        s+=tr("Useful instructions/tips:");
00527        s+="\n\n";
00528        
00529        s+=tr("Above the (sub)activities list, we have 2 labels, containing 4 numbers. The first label contains text: No: a / b. The first number a is the"
00530               " number of active (sub)activities (we number each individual subactivity as 1), while the second number b is the number of total (sub)activities."
00531               " The second label contains text: Dur: c / d. The third number c is the duration of active (sub)activities, in periods"
00532               " (or FET hours), while the fourth number d is the duration of total (sub)activities, in periods (or FET hours)."
00533               " So, No means number and Dur means duration.");
00534        s+="\n\n";
00535        s+=tr("Example: No: 100 / 102, Dur: 114 / 117. They represent: 100 - the number of active (sub)activities,"
00536               " then 102 - the number of total (sub)activities,"
00537               " 114 - the duration of active activities (in periods or FET hours) and 117 - the duration of total activities"
00538               " (in periods or FET hours). In this example we have 2 inactive activities with their combined duration being 3 periods.");
00539        
00540        s+="\n\n";
00541        s+=tr("Explanation of the short description of an activity: first comes the id."
00542               " If the activity is inactive, an X follows. Then the duration. Then, if the activity is split, a slash and the total duration."
00543               " Then teachers, subject, activity tag (if it is not void) and students. Then the number of students (if specified).");
00544        s+="\n\n";
00545        s+=tr("The activities which are inactive:", "This is the help for activities which are inactive, after this field there come explanations for how inactive activities are displayed.");
00546        s+="\n";
00547        s+=" -";
00548        s+=tr("have an X mark after the id.", "It refers to inactive activities, which have this mark after the id.");
00549        s+="\n";
00550        s+=" -";
00551        s+=tr("if you use colors in interface (see Settings/Interface menu), they will appear with different background color.", "It refers to inactive activities");
00552        s+="\n\n";
00553        s+=tr("To modify an activity, you can also double click it.");
00554        s+="\n\n";
00555        s+=tr("Show related: if you select this, there will be listed activities for groups and subgroups contained also in the current set (if the current set"
00556               " is a year or a group) and also higher ranked year or group (if the current set is a group or a subgroup).");
00557        
00558        LongTextMessageBox::largeInformation(this, tr("FET Help"), s);
00559 }
00560 
00561 void ActivitiesForm::activityComments()
00562 {
00563        int ind=activitiesListWidget->currentRow();
00564        if(ind<0){
00565               QMessageBox::information(this, tr("FET information"), tr("Invalid selected activity"));
00566               return;
00567        }
00568        
00569        assert(ind<visibleActivitiesList.count());
00570 
00571        Activity* act=visibleActivitiesList[ind];
00572        assert(act!=NULL);
00573 
00574        QDialog getCommentsDialog(this);
00575        
00576        getCommentsDialog.setWindowTitle(tr("Activity comments"));
00577        
00578        QPushButton* okPB=new QPushButton(tr("OK"));
00579        okPB->setDefault(true);
00580        QPushButton* cancelPB=new QPushButton(tr("Cancel"));
00581        
00582        connect(okPB, SIGNAL(clicked()), &getCommentsDialog, SLOT(accept()));
00583        connect(cancelPB, SIGNAL(clicked()), &getCommentsDialog, SLOT(reject()));
00584 
00585        QHBoxLayout* hl=new QHBoxLayout();
00586        hl->addStretch();
00587        hl->addWidget(okPB);
00588        hl->addWidget(cancelPB);
00589        
00590        QVBoxLayout* vl=new QVBoxLayout();
00591        
00592        QPlainTextEdit* commentsPT=new QPlainTextEdit();
00593        commentsPT->setPlainText(act->comments);
00594        commentsPT->selectAll();
00595        commentsPT->setFocus();
00596        
00597        vl->addWidget(commentsPT);
00598        vl->addLayout(hl);
00599        
00600        getCommentsDialog.setLayout(vl);
00601        
00602        const QString settingsName=QString("ActivityCommentsDialog");
00603        
00604        getCommentsDialog.resize(500, 320);
00605        centerWidgetOnScreen(&getCommentsDialog);
00606        restoreFETDialogGeometry(&getCommentsDialog, settingsName);
00607        
00608        int t=getCommentsDialog.exec();
00609        saveFETDialogGeometry(&getCommentsDialog, settingsName);
00610        
00611        if(t==QDialog::Accepted){
00612               act->comments=commentsPT->toPlainText();
00613        
00614               gt.rules.internalStructureComputed=false;
00615               setRulesModifiedAndOtherThings(&gt.rules);
00616 
00617               activitiesListWidget->currentItem()->setText(act->getDescription(gt.rules));
00618               activityChanged();
00619        }
00620 }