mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-14 19:00:01 +01:00
added max to options
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
OptionsWindow::OptionsWindow(QWidget *parent) : QDialog(parent) {
|
OptionsWindow::OptionsWindow(QWidget *parent) : QDialog(parent) {
|
||||||
setFixedSize(170, 175);
|
setFixedSize(170, 150);
|
||||||
createControls();
|
createControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,28 +15,37 @@ void OptionsWindow::createControls() {
|
|||||||
label_y->setGeometry(10, 40, 100, 25);
|
label_y->setGeometry(10, 40, 100, 25);
|
||||||
op_intensity = new QLineEdit("55", this);
|
op_intensity = new QLineEdit("55", this);
|
||||||
op_intensity->setGeometry(110, 40, 50, 25);
|
op_intensity->setGeometry(110, 40, 50, 25);
|
||||||
|
QLabel *label_z = new QLabel(tr("Max Frames: "), this);
|
||||||
|
label_z->setGeometry(10, 70, 100, 25);
|
||||||
|
op_max_frames = new QLineEdit("1500", this);
|
||||||
|
op_max_frames->setGeometry(110,70, 50, 25);
|
||||||
op_setpref = new QPushButton(tr("Set"), this);
|
op_setpref = new QPushButton(tr("Set"), this);
|
||||||
op_setpref->setGeometry(10, 135, 100, 25);
|
op_setpref->setGeometry(10, 110, 100, 25);
|
||||||
connect(op_setpref, SIGNAL(clicked()), this, SLOT(setValues()));
|
connect(op_setpref, SIGNAL(clicked()), this, SLOT(setValues()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsWindow::setValues() {
|
void OptionsWindow::setValues() {
|
||||||
|
|
||||||
int thread_count = atoi(op_thread->text().toStdString().c_str());
|
int thread_count = atoi(op_thread->text().toStdString().c_str());
|
||||||
if(thread_count <= 0) {
|
if(thread_count <= 0) {
|
||||||
QMessageBox::information(this, "Error require valid thread count", "Requires Valid Thread Count...");
|
QMessageBox::information(this, tr("Error require valid thread count"),tr( "Requires Valid Thread Count..."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int intensity = atoi(op_intensity->text().toStdString().c_str());
|
int intensity = atoi(op_intensity->text().toStdString().c_str());
|
||||||
if(intensity <= 0) {
|
if(intensity <= 0) {
|
||||||
QMessageBox::information(this, "Error requires valid intensity", "To set the value you must provide a valid intensity");
|
QMessageBox::information(this, tr("Error requires valid intensity"), tr("To set the value you must provide a valid intensity"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int max_frames = atoi(op_max_frames->text().toStdString().c_str());
|
||||||
playback->setPref(thread_count, intensity);
|
playback->setPref(thread_count, intensity);
|
||||||
|
if(max_frames < 300) {
|
||||||
|
QMessageBox::information(this, tr("Error Requires Max"), tr("Required Max Frames must be greater than 300"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ac::setMaxAllocated(max_frames);
|
||||||
QString text;
|
QString text;
|
||||||
QTextStream stream(&text);
|
QTextStream stream(&text);
|
||||||
stream << "Thread Count set to: " << thread_count << " and Intensity set to: " << intensity;
|
stream << tr("Thread Count set to: ") << thread_count << tr(" and Intensity set to: ") << intensity << tr("\nMaximum Stored Frames: ") << max_frames << tr("\n");
|
||||||
QMessageBox::information(this, "Pref Value Set", text);
|
QMessageBox::information(this, tr("Pref Value Set"), text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsWindow::setPlayback(Playback *p) {
|
void OptionsWindow::setPlayback(Playback *p) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ private:
|
|||||||
QLineEdit *op_intensity;
|
QLineEdit *op_intensity;
|
||||||
QPushButton *op_setpref;
|
QPushButton *op_setpref;
|
||||||
Playback *playback;
|
Playback *playback;
|
||||||
|
QLineEdit *op_max_frames;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user