From a857d02bd764caa3b6f34177a272d09a3c2b955b Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 8 Jun 2006 01:31:40 +0000 Subject: [PATCH] minor ui label tweaks The end users wanted more explanatory text on the browser and slightly different menu text. --- qui/MussaWindow.cpp | 8 ++--- qui/ThresholdWidget.cpp | 34 +++++++------------ qui/ThresholdWidget.hpp | 6 ++-- qui/ZoomWidget.cpp | 1 + qui/mussa_setup_dialog/MussaSetupWidget.cpp | 4 +-- .../SequenceSetupWidget.cpp | 2 +- 6 files changed, 23 insertions(+), 32 deletions(-) diff --git a/qui/MussaWindow.cpp b/qui/MussaWindow.cpp index d12e982..04fe617 100644 --- a/qui/MussaWindow.cpp +++ b/qui/MussaWindow.cpp @@ -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); diff --git a/qui/ThresholdWidget.cpp b/qui/ThresholdWidget.cpp index 62cc1e1..120a349 100644 --- a/qui/ThresholdWidget.cpp +++ b/qui/ThresholdWidget.cpp @@ -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 diff --git a/qui/ThresholdWidget.hpp b/qui/ThresholdWidget.hpp index 1e00c12..61d8900 100644 --- a/qui/ThresholdWidget.hpp +++ b/qui/ThresholdWidget.hpp @@ -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; diff --git a/qui/ZoomWidget.cpp b/qui/ZoomWidget.cpp index c646df1..b32efea 100644 --- a/qui/ZoomWidget.cpp +++ b/qui/ZoomWidget.cpp @@ -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")); diff --git a/qui/mussa_setup_dialog/MussaSetupWidget.cpp b/qui/mussa_setup_dialog/MussaSetupWidget.cpp index 11f53b7..764bda2 100644 --- a/qui/mussa_setup_dialog/MussaSetupWidget.cpp +++ b/qui/mussa_setup_dialog/MussaSetupWidget.cpp @@ -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 diff --git a/qui/mussa_setup_dialog/SequenceSetupWidget.cpp b/qui/mussa_setup_dialog/SequenceSetupWidget.cpp index d16350c..4a80277 100644 --- a/qui/mussa_setup_dialog/SequenceSetupWidget.cpp +++ b/qui/mussa_setup_dialog/SequenceSetupWidget.cpp @@ -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; -- 2.30.2