-
Notifications
You must be signed in to change notification settings - Fork 21
/
romaligndialog.cpp
50 lines (38 loc) · 1.17 KB
/
romaligndialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "romaligndialog.h"
#include "ui_romaligndialog.h"
#include "maskromtool.h"
RomAlignDialog::RomAlignDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::RomAlignDialog){
ui->setupUi(this);
}
RomAlignDialog::~RomAlignDialog(){
delete ui;
}
void RomAlignDialog::setMaskRomTool(MaskRomTool* parent){
this->mrt=parent;
static uint32_t threshold;
mrt->getAlignSkipCountThreshold(threshold);
ui->editMaxSkip->setText(QString::number(threshold));
if(ui->comboBox->count()==0){ //Only update the first time.
foreach(RomAligner* aligner, mrt->aligners){
ui->comboBox->addItem(aligner->name);
}
}
ui->comboBox->setCurrentText(mrt->aligner->name);
}
//Called whenever the text changes.
void RomAlignDialog::on_editMaxSkip_textChanged(const QString &arg1){
mrt->markUndoPoint();
bool ok;
uint32_t threshold=arg1.toInt(&ok, 10);
if(ok){
mrt->setAlignSkipCountThreshold(threshold);
}else{
qDebug()<<"Illegal threshold number: "<<arg1;
}
}
void RomAlignDialog::on_comboBox_activated(int index){
mrt->markUndoPoint();
mrt->chooseAligner(ui->comboBox->itemText(index));
}