-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreferencesdialog.cpp
73 lines (56 loc) · 1.66 KB
/
preferencesdialog.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "preferencesdialog.h"
#include "ui_preferencesdialog.h"
#include <QFileDialog>
PreferencesDialog::PreferencesDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::PreferencesDialog)
{
ui->setupUi(this);
connect( ui->butBrowseFijiPath, SIGNAL(clicked()), this, SLOT(browseFijiPathClicked()) );
connect( ui->spinMaxVox, SIGNAL(valueChanged(int)), this, SLOT( spinMaxVoxValueChanged(int) ) );
}
PreferencesDialog::~PreferencesDialog()
{
delete ui;
}
QString PreferencesDialog::getFijiExePath()
{
return ui->lineEdit->text();
}
void PreferencesDialog::setFijiExePath( const QString &str )
{
ui->lineEdit->setText( str );
}
unsigned PreferencesDialog::getMaxVoxelsForSV() const
{
return ((unsigned int)ui->spinMaxVox->value()) * 1000000U;
}
void PreferencesDialog::setMaxVoxelsForSV( unsigned val )
{
ui->spinMaxVox->setValue( val / 1000000U );
}
unsigned PreferencesDialog::getSliceJump() const
{
return ((unsigned int)ui->spinSliceJump->value());
}
void PreferencesDialog::setSliceJump( unsigned val )
{
ui->spinMaxVox->setValue( val );
}
void PreferencesDialog::on_spinSliceJump_valueChanged(int val)
{
setSliceJump((unsigned)val);
}
void PreferencesDialog::browseFijiPathClicked()
{
QString fName = QFileDialog::getOpenFileName( this, "Browse for Fiji executable" );
if ( fName.isEmpty() )
return;
ui->lineEdit->setText(fName);
}
void PreferencesDialog::spinMaxVoxValueChanged(int newVal)
{
const unsigned Mult = 16; // empirically found :(
const unsigned maxRAM = ((unsigned) newVal) * Mult;
ui->labelMaxVox->setText( QString("(approx. max %1 MB of RAM needed)").arg( maxRAM ) );
}