mirror of
https://github.com/gtalent/sc9k.git
synced 2025-04-21 14:08:34 -05:00
Fix SettingsDialog to do validity check when OK is pressed
This commit is contained in:
parent
2e9b37f3b4
commit
af07f8853a
@ -205,12 +205,12 @@ QWidget *SettingsDialog::setupButtons(QWidget *parent) {
|
|||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::handleApply() {
|
int SettingsDialog::handleApply() {
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
QVector<View> views;
|
QVector<View> views;
|
||||||
auto const viewsErr = collectViews(views);
|
auto const viewsErr = collectViews(views);
|
||||||
if (viewsErr) {
|
if (viewsErr) {
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
setViews(settings, views);
|
setViews(settings, views);
|
||||||
setCameraConnectionData(settings, {
|
setCameraConnectionData(settings, {
|
||||||
@ -227,11 +227,13 @@ void SettingsDialog::handleApply() {
|
|||||||
});
|
});
|
||||||
collectVideoConfig();
|
collectVideoConfig();
|
||||||
setVideoConfig(settings, m_videoConfig);
|
setVideoConfig(settings, m_videoConfig);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::handleOK() {
|
void SettingsDialog::handleOK() {
|
||||||
handleApply();
|
if (handleApply() == 0) {
|
||||||
accept();
|
accept();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::setupViewRow(int row, View const&view) {
|
void SettingsDialog::setupViewRow(int row, View const&view) {
|
||||||
|
@ -38,7 +38,8 @@ class SettingsDialog: public QDialog {
|
|||||||
QWidget *setupViewConfig(QWidget *parent);
|
QWidget *setupViewConfig(QWidget *parent);
|
||||||
QWidget *setupImageConfig(QWidget *parent);
|
QWidget *setupImageConfig(QWidget *parent);
|
||||||
QWidget *setupButtons(QWidget *parent);
|
QWidget *setupButtons(QWidget *parent);
|
||||||
void handleApply();
|
[[nodiscard]]
|
||||||
|
int handleApply();
|
||||||
void handleOK();
|
void handleOK();
|
||||||
void setupViewRow(int row, View const&view = {});
|
void setupViewRow(int row, View const&view = {});
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user