Menu

[465617]: / src / constantgainchangedialog.cpp  Maximize  Restore  History

Download this file

44 lines (36 with data), 1.9 kB

 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
#include "constantgainchangedialog.h"
#include "mainwindow.h"
#include "mymessagebox.h"
ConstantGainChangeDialog::ConstantGainChangeDialog(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
setWindowTitle(windowTitle().arg(MainWindow::getAppTitle()));
connect(horizontalSlider_constGainChange, SIGNAL(valueChanged(int)), this, SLOT(updateLineEdit_constGainChange(int)));
connect(groupBox_onlyOneChannel, SIGNAL(toggled(bool)), this, SLOT(groupBox_onlyOneChannel_toggled(bool)));
updateLineEdit_constGainChange(horizontalSlider_constGainChange->value());
}
ConstantGainChangeDialog::~ConstantGainChangeDialog(){
}
void ConstantGainChangeDialog::updateLineEdit_constGainChange(int value){
lineEdit_constGainChange->setText(QString("%1").arg((double)value*1.5, 0, 'f', 1));
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(value!=0);
}
void ConstantGainChangeDialog::groupBox_onlyOneChannel_toggled(bool isOn){
if (isOn){
MainWindow* mainWindow = qobject_cast<MainWindow*>(this->parent());
mainWindow->getSettings()->beginGroup("logOptionsDialog");
bool isConfirmSuppressed = mainWindow->getSettings()->value("groupBox_onlyOneChannel_ConfirmSuppressed", false).toBool();
if (!isConfirmSuppressed){
MyMessageBox::warning(this, MainWindow::getAppTitle()+QString(" - ")+tr("Warning"),
tr("This function will only work if the mp3 is encoded as "
"stereo or dual channel, NOT joint-stereo or mono."),
tr("Don't show this warning again"),
isConfirmSuppressed);
if (isConfirmSuppressed){
mainWindow->getSettings()->setValue("groupBox_onlyOneChannel_ConfirmSuppressed", true);
}
}
mainWindow->getSettings()->endGroup();
}
}
MongoDB Logo MongoDB