mirror of
https://github.com/gtalent/sc9k.git
synced 2025-04-20 03:18:03 -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;
|
||||
}
|
||||
|
||||
void SettingsDialog::handleApply() {
|
||||
int SettingsDialog::handleApply() {
|
||||
QSettings settings;
|
||||
QVector<View> views;
|
||||
auto const viewsErr = collectViews(views);
|
||||
if (viewsErr) {
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
setViews(settings, views);
|
||||
setCameraConnectionData(settings, {
|
||||
@ -227,11 +227,13 @@ void SettingsDialog::handleApply() {
|
||||
});
|
||||
collectVideoConfig();
|
||||
setVideoConfig(settings, m_videoConfig);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SettingsDialog::handleOK() {
|
||||
handleApply();
|
||||
accept();
|
||||
if (handleApply() == 0) {
|
||||
accept();
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::setupViewRow(int row, View const&view) {
|
||||
|
@ -38,7 +38,8 @@ class SettingsDialog: public QDialog {
|
||||
QWidget *setupViewConfig(QWidget *parent);
|
||||
QWidget *setupImageConfig(QWidget *parent);
|
||||
QWidget *setupButtons(QWidget *parent);
|
||||
void handleApply();
|
||||
[[nodiscard]]
|
||||
int handleApply();
|
||||
void handleOK();
|
||||
void setupViewRow(int row, View const&view = {});
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user