Changeset - 4d5a298af6e9
[Not reviewed]
default
0 4 0
Michael Guravage - 14 years ago 2011-01-12 15:00:04
michael.guravage@cwi.nl
Rework Transporters dialog and About message. See ChangeLog for more details.

user: Michael Guravage <michael.guravage@cwi.nl>
branch 'default'
changed src/ChangeLog
changed src/canvas.cpp
changed src/transporterdialog.cpp
changed src/wallitem.cpp
4 files changed with 64 insertions and 18 deletions:
0 comments (0 inline, 0 general)
src/ChangeLog
Show inline comments
 
2011-01-12    <guravage@petitdru.sen.cwi.nl>
 

	
 
	* transporterdialog.cpp (TransporterDialog): Add a proper title to
 
	the dialog, and place the cell and wall pairs in a seperate labe.
 

	
 
2011-01-10    <guravage@petitdru.sen.cwi.nl>
 

	
 
	* transporterdialog.cpp (TransporterDialog): Start numbering Transporter fields at zero.
 
	Resolves issue #1: http://code.google.com/p/virtualleaf/issues/detail?id=1.
 

	
 
	* wallitem.cpp (OnClick): Change dialog modality to Qt::WindowModal.
 
	Resolves issue #2: http://code.google.com/p/virtualleaf/issues/detail?id=2.
 

	
 
	* canvas.cpp (about): Add link to Plant Physiology paper.
 
	Resolves issue #3: http://code.google.com/p/virtualleaf/issues/detail?id=3.
 

	
 
2010-11-30    <guravage@petitdru.sen.cwi.nl>
 

	
 
	* canvas.cpp (snapshot): Preface each image format extension with
 
	an asterisk so files with those extensions to appear in the file
 
	dialogue.
 
	(snapshot): Forgot to add asterisk before our own pdf format.
 

	
 
	* VirtualLeaf-install-windows.nsi: Include imageformats folder
 
	alongside executable.
 

	
 
	* canvas.cpp (snapshot): PNG is the default image format.
 

	
src/canvas.cpp
Show inline comments
 
@@ -1012,36 +1012,57 @@ void Main::readStateXML()
 
}
 

	
 

	
 
void Main::clear()
 
{
 
  editor->clear();
 
}
 

	
 
void Main::about()
 
{
 
  static QMessageBox* about = new QMessageBox
 
    ( "VirtualLeaf V1.0",
 
      "<h3>VirtualLeaf V1.0</h3>"
 
      "<p>"
 
      "An Open Source framework for cell-based modeling of plant tissue growth and development <br>"
 
      "(c) 2005-2008, Roeland Merks <i>et al.</i><br>"
 
      "    <a href=\"http://www.psb.vib-ugent.be\">VIB Department Plant Systems Biology</a>, "
 
      "Ghent, Belgium <br>"
 
      "(c) 2008-2010, <a href=\"http://www.cwi.nl/~merks\">Roeland Merks <i>et al.</i></a> <br>"
 
      "    <a href=\"http://www.cwi.nl\">Centrum Wiskunde & Informatica</a> and <a href=\"http://www.ncsb.nl\">Netherlands Consortium for Systems Biology</a>, Amsterdam, Netherlands <br>"
 
"<br>VirtualLeaf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br>"
 
      "<br>If you use this code for your projects, please cite our paper:"
 
"<br>Merks, Guravage, Inze, and Beemster. An Open Source framework for cell-based modeling of plant tissue growth and development. <i>Plant Physiology,</i> submitted.<br> . <br>"
 
      "<br>Please share your model plugins and extensions at <a href=\"http://virtualleaf.googlecode.com\">http://virtualleaf.googlecode.com</a>.", 
 
      "<h3>VirtualLeaf V1.0</h3>\
 
       <p>\
 
         An Open Source framework for cell-based modeling of plant\
 
         tissue growth and development.\
 
       </p>\
 
       <p>(c) 2005-2008, Roeland Merks <i>et al.</i>\
 
         <a href=\"http://www.psb.vib-ugent.be\">VIB Department Plant Systems Biology</a>,\
 
         Ghent, Belgium.\
 
       </p>\
 
       <p>(c) 2008-2010,\
 
         <a href=\"http://www.cwi.nl/~merks\">Roeland Merks <i>et al.</i></a>\
 
         <a href=\"http://www.cwi.nl\">Centrum Wiskunde & Informatica (CWI)</a> and\
 
         <a href=\"http://www.ncsb.nl\"> Netherlands Consortium for Systems Biology (NCSB)</a>,\
 
         Amsterdam, the Netherlands.\
 
       </p>\
 
       <p>\
 
         VirtualLeaf is free software: you can redistribute it and/or\
 
         modify it under the terms of the GNU General Public License as\
 
         published by the Free Software Foundation, either version 3 of the\
 
         License, or (at your option) any later version.\
 
       </p>\
 
       <p>\
 
         If you use this code for your projects, please cite our paper in\
 
         <a href=\"http://www.plantphysiol.org\">Plant Physiology</a>, &lsquo;\
 
         Roeland M. H. Merks, Michael Guravage, Dirk Inze, and Gerrit T.S. Beemster,\
 
         <a href=\"http://www.plantphysiol.org/cgi/content/short/pp.110.167619?keytype=ref&ijkey=YTmfxrHG5QCsa8k\">\
 
         VirtualLeaf: an Open Source framework for cell-based modeling of plant tissue growth and development</a>,<br>\
 
         Plant Physiology 2010: pp.110.167619v1-pp.110.167619.\
 
       </p>\
 
       <p>\
 
         Please share your model plugins and extensions at\
 
         <a href=\"http://virtualleaf.googlecode.com\">http://virtualleaf.googlecode.com</a>.\
 
       </p>",
 
      QMessageBox::Information, 1, 0, 0, this, 0, FALSE );
 
  about->setButtonText( 1, "Dismiss" );
 
  about->show();
 
}
 

	
 

	
 
void Main::gpl()
 
{
 
  static QMessageBox* gpl = new QMessageBox ( "GPL License", "", 
 
      QMessageBox::Information, 1, 0, 0, this, 0, FALSE );
 

	
 
  QDir docDir(QApplication::applicationDirPath());
src/transporterdialog.cpp
Show inline comments
 
@@ -25,75 +25,83 @@
 
#include "canvas.h"
 
#include "transporterdialog.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
TransporterDialog::TransporterDialog(Wall *w, CellBase *c, int wn, QWidget *parent)
 
  :  QDialog(parent), wall(w), cell(c), wall_num(wn)
 
{
 
  int frameStyle = QFrame::Plain | QFrame::NoFrame;
 
  QPushButton *ok = new QPushButton(tr("Ok"));
 
  QPushButton *cancel = new QPushButton(tr("Cancel"));
 
  QGridLayout *t_grid = new QGridLayout; // transporter grid
 
  QGridLayout *c_grid = new QGridLayout; // context grid
 

	
 
  // connect the slots
 
  connect(ok, SIGNAL(clicked()), this, SLOT(setTransporterValues()));
 
  connect(cancel, SIGNAL(clicked()), this, SLOT(close()));
 

	
 
  // compose a label for the dialog box
 
  std::stringstream label_text; 
 
  label_text << "C("<< wall->C1()->Index() << "," << wall->C2()->Index() << "), N(" 
 
	     << wall->N1()->Index() << "," << wall->N2()->Index() << ")";
 
  // compose a label describing the cells and nodes associated with this wall
 
  std::stringstream desc; 
 
  desc << "between cells "<< wall->C1()->Index() << " and " << wall->C2()->Index() << ", and" << endl <<
 
          "connecting nodes " << wall->N1()->Index() << " and " << wall->N2()->Index();
 

	
 
  // description label
 
  label = new QLabel;
 
  label->setFrameStyle(frameStyle);
 
  label->setText(tr(desc.str().c_str()));
 
  c_grid->addWidget(label, 0, 0);
 

	
 
  // retrieve the current transporters
 
  QVector <double> transporters;  // transporter vector
 
  ntransporters = cell->NChem(); // size of transporter vector
 
  for (int i=0; i<ntransporters; ++i){
 
    transporters << ((wall_num == 1) ? wall->Transporters1(i) : wall->Transporters2(i)); // dependent on the wall number of course.
 
  }
 

	
 
  // iterate over the vector of transporter values making a label/edit line for each
 
  for (int i=0; i<transporters.size(); ++i) {
 

	
 
    // label
 
    label = new QLabel;
 
    label->setFrameStyle(frameStyle);
 
    label->setText(QString("%1").arg(i+1)); // cardinal numbering
 
    label->setText(QString("%1").arg(i)); // cardinal numbering, i.e. starts at zero.
 

	
 
    // line editor
 
    QLineEdit *editor = new QLineEdit();
 
    editors << editor;
 
    editor->setValidator(new QDoubleValidator(editor)); // validator settings
 

	
 
    // assign the current transporter value
 
    QString n;
 
    editor->setText(n.setNum(transporters[i]));
 

	
 
    // insert the label and editor into the transporter grid
 
    t_grid->addWidget(label, i, 0);
 
    t_grid->addWidget(editor, i, 1);
 
  }
 

	
 
  // add OK and Cancel buttons
 
  QGridLayout *b_grid = new QGridLayout; // button grid
 
  b_grid->addWidget(ok, 0, 0);
 
  b_grid->addWidget(cancel, 0, 1);
 

	
 
  // add both transporter and button grids to the box layout widget
 
  QVBoxLayout *layout = new QVBoxLayout;
 
  layout->addLayout(c_grid);
 
  layout->addLayout(t_grid);
 
  layout->addLayout(b_grid);
 
  setLayout(layout);
 

	
 
  setWindowTitle(tr(label_text.str().c_str()));
 
  setWindowTitle(QString("Edit Transporters"));
 
}
 

	
 
void TransporterDialog::setTransporterValues()
 
{
 
  // iterate over the editor widgets soliciting their values and setting the wall's transporters accordingly.
 
  for (int i=0; i<ntransporters; ++i){
 
#ifdef QDEBUG  
 
    qDebug() << "Transporter(" << i << "): " << editors[i]->text().toDouble() << endl;
 
#endif
 
    if (wall_num == 1)
 
      wall->setTransporters1(i, editors[i]->text().toDouble());
 
    else 
src/wallitem.cpp
Show inline comments
 
@@ -119,24 +119,25 @@ void WallItem::OnClick(QMouseEvent *e) {
 
	  if (e->modifiers() == Qt::ShiftModifier) {
 
	    wn==1?w->setTransporters1(1,0):w->setTransporters2(1,0);					
 

	
 
	  } else {
 
	    // set high amount of PIN1
 
	    //cerr << "Setting PIN1\n";
 
	    wn==1?w->setTransporters1(1,10):w->setTransporters2(1,10);
 
	  }
 
	}
 
	setColor();
 
      } else {
 
	TransporterDialog dialog(w, c, wn);
 
	dialog.setWindowModality(Qt::WindowModal);
 
	dialog.exec();
 
      }
 

	
 
    }
 
 
 
  }
 
  setColor();
 
  update(boundingRect());
 

	
 
}
 

	
 
  /* finis */
0 comments (0 inline, 0 general)