minor ui label tweaks
authorDiane Trout <diane@caltech.edu>
Thu, 8 Jun 2006 01:31:40 +0000 (01:31 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 8 Jun 2006 01:31:40 +0000 (01:31 +0000)
The end users wanted more explanatory text on the browser and slightly
different menu text.

qui/MussaWindow.cpp
qui/ThresholdWidget.cpp
qui/ThresholdWidget.hpp
qui/ZoomWidget.cpp
qui/mussa_setup_dialog/MussaSetupWidget.cpp
qui/mussa_setup_dialog/SequenceSetupWidget.cpp

index d12e982d8061326cd83d32fcbb821c41ed1a6746..04fe61705d1189dd5a7c7f26cf47ddec25c093d7 100644 (file)
@@ -143,7 +143,7 @@ void MussaWindow::setupActions()
   connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
   closeAction->setIcon(QIcon(":/icons/exit.png"));
   
-  createNewAnalysisAction = new QAction(tr("Define Analysis"), this);
+  createNewAnalysisAction = new QAction(tr("Create Analysis"), this);
   connect(createNewAnalysisAction, SIGNAL(triggered()), 
           this, SLOT(createNewAnalysis()));
   createNewAnalysisAction->setIcon(QIcon(":/icons/filenew.png"));
@@ -160,12 +160,12 @@ void MussaWindow::setupActions()
           this, SLOT(loadMotifList()));
   loadMotifListAction->setIcon(QIcon(":/icons/fileopen.png"));
   
-  loadMupaAction = new QAction(tr("Load Mussa Parameters"), this);
+  loadMupaAction = new QAction(tr("Create Analysis from File"), this);
   connect(loadMupaAction, SIGNAL(triggered()), 
           this, SLOT(loadMupa()));
   loadMupaAction->setIcon(QIcon(":/icons/fileopen.png"));
 
-  loadSavedAnalysisAction = new QAction(tr("Load &Analysis"), this);
+  loadSavedAnalysisAction = new QAction(tr("Load Existing &Analysis"), this);
   connect(loadSavedAnalysisAction, SIGNAL(triggered()), 
           this, SLOT(loadSavedAnalysis()));
   loadSavedAnalysisAction->setIcon(QIcon(":/icons/fileopen.png"));
@@ -544,7 +544,6 @@ MussaWindow::updateProgress(const string& description, int current, int max)
 {  
   // if we're done  
   if (current == max) {
-    cout << "done with dialog" << endl;
     if (progress_dialog != 0) {
       progress_dialog->hide();
       delete progress_dialog;
@@ -553,7 +552,6 @@ MussaWindow::updateProgress(const string& description, int current, int max)
   } else {
     // if we're starting, create the dialog
     if (progress_dialog == 0) {
-      cout << "creating dialog" << endl;
       QString desc(description.c_str());
       QString cancel("Cancel");
       progress_dialog = new QProgressDialog(desc, cancel, current, max, this);
index 62cc1e1880fd9e003dc5238e205bc6307f613445..120a349b96c63607dcaeeb3db746b215dd56b781 100644 (file)
@@ -17,16 +17,15 @@ ThresholdWidget::ThresholdWidget(QWidget *parent, int min, int max)
 
   connect(&basepair_spinner, SIGNAL(valueChanged(int)), 
           this, SLOT(setBasepairThreshold(int)));
-  connect(&percent_spinner, SIGNAL(valueChanged(int)),
-          this, SLOT(setPercentThreshold(int)));
 
   basepair_spinner.setValue(min);
+  updatePercentThreshold();
 
   QHBoxLayout *layout = new QHBoxLayout;
+  layout->addWidget(new QLabel("Threshold"));
   layout->addWidget(&basepair_spinner);
   layout->addWidget(&window_size_label);
-  layout->addWidget(&percent_spinner);
-  layout->addWidget(new QLabel("%"));
+  layout->addWidget(&percent_label);
   setLayout(layout);
 }
 
@@ -39,13 +38,7 @@ void ThresholdWidget::setRange(int min, int max)
   QString num;
   num.setNum(max);
   window_size_label.setText("/"+num);
-  int min_percent =(int)fmaxl(0.0, roundl(min_ratio()*100));
-  cur_percent_threshold = min_percent;
-  percent_spinner.setRange( min_percent, 100);
-  if (min_percent != 0.0) {
-    percent_spinner.setSingleStep((int)(roundl(1.0/(double)(max)*100.0)));
-  }
-  percent_spinner.setValue(min_percent);
+  updatePercentThreshold();
 }
 
 double ThresholdWidget::min_ratio() const
@@ -68,22 +61,19 @@ void ThresholdWidget::setBasepairThreshold(int threshold)
     cur_bp_threshold = threshold;
     cur_percent_threshold = (int)(roundl(ratio() * 100));
     basepair_spinner.setValue(threshold);
-    percent_spinner.setValue(cur_percent_threshold);
+    updatePercentThreshold();
     emit thresholdChanged(threshold);
   }
 }
 
-void ThresholdWidget::setPercentThreshold(int percent_threshold)
+void ThresholdWidget::updatePercentThreshold()
 {
-  if (cur_percent_threshold != percent_threshold)
-  {
-    cur_percent_threshold = percent_threshold;
-    long t=lround(basepair_spinner.maximum()*((float)percent_threshold/100.0));
-    cur_bp_threshold = (int)t;
-    percent_spinner.setValue(percent_threshold);
-    basepair_spinner.setValue(cur_bp_threshold);
-    emit thresholdChanged(cur_bp_threshold);
-  }
+  std::cout << "update percent" << std::endl;
+  int min_percent = (int)fmaxl(0.0, roundl(ratio()*100));
+  QString label;
+  label.setNum(min_percent);
+  label += "%";
+  percent_label.setText(label);
 }
 
 int ThresholdWidget::threshold() const
index 1e00c12b8dd4c0ed734e7c8a00d7702efeaf6750..61d890042dc213f7d4694791d27e7ffdc9c4038d 100644 (file)
@@ -18,10 +18,12 @@ public:
   double ratio() const;
   //! return our current threshold
   int threshold() const;
+  //! update percent threshold
+  void updatePercentThreshold();
 
 public slots:
   void setBasepairThreshold(int threshold);
-  void setPercentThreshold(int percent_threshold);
+  //void setPercentThreshold(int percent_threshold);
   //! set the min and max base pair range
   void setRange(int min, int max);
 
@@ -32,7 +34,7 @@ signals:
 protected:
   QSpinBox basepair_spinner;
   QLabel window_size_label;
-  QSpinBox percent_spinner;
+  QLabel percent_label;
 
   int cur_bp_threshold;
   int cur_percent_threshold;
index c646df199ed8598ad888272524cffa82a7704469..b32efeafda798b9a8e7cbdc5056c5492ddec9e35 100644 (file)
@@ -19,6 +19,7 @@ ZoomWidget::ZoomWidget(QWidget *parent)
   QHBoxLayout *layout = new QHBoxLayout;
   layout->addWidget(zoomLabel);
   layout->addWidget(&zoom);
+  layout->addWidget(new QLabel("bp/pix"));
   setLayout(layout);
 
   setToolTip(tr("Zoom"));
index 11f53b79eaa5d088fbde8f94c4d34f3d042ad0b3..764bda204f401705bfb1a0458d8512f30b910352 100644 (file)
@@ -32,11 +32,11 @@ MussaSetupWidget::MussaSetupWidget(QWidget *parent)
   analysisNameLabel->setBuddy(&analysisNameLineEdit);
 
   // Window
-  QLabel *windowLabel = new QLabel(tr("Window"));
+  QLabel *windowLabel = new QLabel(tr("Window (nt)"));
   windowLabel->setBuddy(&windowLineEdit);
 
   // Threshold
-  QLabel *thresholdLabel = new QLabel(tr("Threshold"));
+  QLabel *thresholdLabel = new QLabel(tr("Threshold (nt)"));
   thresholdLabel->setBuddy(&thresholdLineEdit);
 
   // Number of sequences
index d16350c3667175bc0ac7824ddebe2fac6289e126..4a80277e13ccb00a78deabf61f47fb1976760e63 100644 (file)
@@ -122,7 +122,7 @@ void SequenceSetupWidget::promptForAnnotFile()
   QString annotFilePath = QFileDialog::getOpenFileName(this,
                                               "Choose a annotation file",
                                               ".",
-                                              "Annot (*.txt)");
+                                              "Annot (*.txt *.annot)");
   if (annotFilePath.isEmpty())
     return;