Fix the new analysis dialog so it starts at a good size on os x
[mussa.git] / qui / mussa_setup_dialog / SequenceSetupWidget.cpp
index aa47bbd27b6c789939af76165565d9427beff48f..464cc61b65e61302ad17e8f9eb94e99a270ce18b 100644 (file)
@@ -8,6 +8,8 @@
 #include "qui/mussa_setup_dialog/SequenceSetupWidget.hpp"
 #include "qui/mussa_setup_dialog/SequenceSetupFrame.hpp"
 
+#include <cassert>
+
 SequenceSetupWidget::SequenceSetupWidget(SequenceSetupFrame *setupFrame_,
                                          QWidget *parent) :
   QWidget(parent),
@@ -19,62 +21,77 @@ SequenceSetupWidget::SequenceSetupWidget(SequenceSetupFrame *setupFrame_,
   seqStopLineEdit(0),
   setupFrame(setupFrame_)
 {
-  // we really need the setupFrame, so lets declair that requirement
+  // we really need the setupFrame, so lets declare that requirement
   assert(setupFrame != 0);
 
-  sequenceNameEdit = new QLineEdit;
+  // Name line
+  sequenceNameEdit = new QLineEdit();
+  sequenceNameEdit->setWhatsThis(tr("Name of input sequence"));
   QLabel *sequenceNameLabel = new QLabel(tr("Sequence name:"));
   sequenceNameLabel->setBuddy(sequenceNameEdit);
+  sequenceNameLabel->setWhatsThis(tr("Name of input sequence"));
 
-  // Sequence row
-  sequenceLineEdit = new QLineEdit;
+  // Sequence file location line
+  sequenceLineEdit = new QLineEdit();
+  sequenceLineEdit->setWhatsThis(tr("File path to input sequence"));
   //const IsFileValidator *fileValidator = new IsFileValidator(this);
   //sequenceLineEdit->setValidator(fileValidator);
   QLabel *sequenceLabel = new QLabel("Sequence Filename:");
   sequenceLabel->setBuddy(sequenceLineEdit);
+  sequenceLabel->setWhatsThis(tr("File path to input sequence"));
   
-  QPushButton *sequenceButton = new QPushButton("Browse...");
+  QPushButton *sequenceButton = new QPushButton(tr("Browse..."));
+  sequenceButton->setWhatsThis(tr("Browse for input sequence"));
   connect(sequenceButton, SIGNAL(clicked()), 
          this, SLOT(promptForFastaFile()));
 
   // Annotation row
-  annotLineEdit = new QLineEdit;
+  annotLineEdit = new QLineEdit();
+  annotLineEdit->setWhatsThis(tr("Annotation file path for above input sequence"));
   //const IsFileValidator *fileValidator2 = new IsFileValidator(this);
   //annotLineEdit->setValidator(fileValidator2);
-  QLabel *annotLabel = new QLabel("Annotation Filename:");
+  QLabel *annotLabel = new QLabel(tr("Annotation Filename:"));
   annotLabel->setBuddy(annotLineEdit);
+  annotLabel->setWhatsThis(tr("Annotation file path for above input sequence"));
 
-  QPushButton *annotButton = new QPushButton("Browse...");
+  QPushButton *annotButton = new QPushButton(tr("Browse..."));
+  annotButton->setWhatsThis(tr("Browse for annotation file for above input sequence"));
   connect(annotButton, SIGNAL(clicked()),
          this, SLOT(promptForAnnotFile()));
 
   // Index row
-  fastaIndexLineEdit = new QLineEdit;
+  fastaIndexLineEdit = new QLineEdit();
+  fastaIndexLineEdit->setWhatsThis(tr("When a FASTA file contains more then one FASTA record, provide a 1 based index (first record is index 1) to select which one to use."));
   //fastaIndexLineEdit->setMaximumWidth(100);
 
-  QLabel *fastaIndexLabel = new QLabel("Fasta Index:");
+  QLabel *fastaIndexLabel = new QLabel(tr("Fasta Index:"));
   fastaIndexLabel->setBuddy(fastaIndexLineEdit);
+  fastaIndexLabel->setWhatsThis(tr("When a FASTA file contains more then one FASTA record, provide a 1 based index (first record is index 1) to select which one to use."));
 
-  seqStartLineEdit = new QLineEdit;
+  seqStartLineEdit = new QLineEdit();
+  seqStartLineEdit->setWhatsThis(tr("Start base pair in input sequence (0 based: 1st base pair is 0)"));
   //seqStartLineEdit->setMinimumWidth(60);
   //seqStartLineEdit->setMaximumWidth(80);
 
-  QLabel *seqStartLabel = new QLabel("Sequence Start:");
+  QLabel *seqStartLabel = new QLabel(tr("Sequence Start:"));
+  seqStartLabel->setWhatsThis(tr("Start base pair in input sequence (0 based: 1st base pair is 0)"));
   seqStartLabel->setBuddy(seqStartLineEdit);
   
-  seqStopLineEdit = new QLineEdit;
+  seqStopLineEdit = new QLineEdit();
+  seqStopLineEdit->setWhatsThis(tr("Stop base pair in input sequence (0 based: 1st base pair is 0) 0 means all of remaining sequence."));
   //seqStopLineEdit->setMinimumWidth(40);
   //seqStopLineEdit->setMaximumWidth(60);
 
-  QLabel *seqStopLabel = new QLabel("Sequence Stop:");
+  QLabel *seqStopLabel = new QLabel(tr("Sequence Stop:"));
+  seqStopLabel->setWhatsThis(tr("Stop base pair in input sequence (0 based: 1st base pair is 0) 0 means all of remaining sequence."));
   seqStopLabel->setBuddy(seqStopLineEdit);
 
   // Layout
+  QVBoxLayout *mainLayout = new QVBoxLayout;
   QHBoxLayout *sequenceNameLayout = new QHBoxLayout;
   QHBoxLayout *sequenceRowLayout = new QHBoxLayout;
   QHBoxLayout *annotRowLayout = new QHBoxLayout;
   QHBoxLayout *indexRowLayout = new QHBoxLayout;
-  QVBoxLayout *mainLayout = new QVBoxLayout;
 
   sequenceNameLayout->addWidget(sequenceNameLabel);
   sequenceNameLayout->addWidget(sequenceNameEdit);