MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / OnErrorValue

Method OnErrorValue

vkconfig_gui/widget_setting_frames.cpp:91–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void WidgetSettingFrames::OnErrorValue() {
92 QPalette palette;
93 palette.setColor(QPalette::Base, QColor(255, 192, 192));
94 this->field->setPalette(palette);
95
96 Configurator& configurator = Configurator::Get();
97
98 if (!configurator.Get(HIDE_MESSAGE_WIDGET_SETTING_FRAMES)) {
99 const std::string text =
100 format("The setting input '%s' is invalid. Use list of comma separated integer ranges. Example: '0-2,16'.",
101 this->data().GetValue());
102 const std::string info =
103 format("Do you want to reset to the setting default value? '%s'", this->meta.default_value.c_str());
104
105 QMessageBox alert;
106 alert.setWindowTitle(format("Invalid '%s' setting value", meta.label.c_str()).c_str());
107 alert.setText(text.c_str());
108 alert.setInformativeText(info.c_str());
109 alert.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
110 alert.setDefaultButton(QMessageBox::Yes);
111 alert.setIcon(QMessageBox::Critical);
112 alert.setCheckBox(new QCheckBox("Do not show again."));
113 if (alert.exec() == QMessageBox::Yes) {
114 this->data().SetValue(this->meta.default_value.c_str());
115 this->field->setText(this->meta.default_value.c_str());
116 this->field->setPalette(default_palette);
117 this->Resize();
118 }
119 if (alert.checkBox()->isChecked()) {
120 configurator.Set(HIDE_MESSAGE_WIDGET_SETTING_FRAMES);
121 }
122 }
123
124 this->timer_error->stop();
125
126 emit refreshEnableOnly();
127}
128
129void WidgetSettingFrames::OnValidValue() {
130 emit refreshEnableOnly();

Callers

nothing calls this directly

Calls 8

ResizeMethod · 0.95
GetFunction · 0.85
setColorMethod · 0.80
GetMethod · 0.80
GetValueMethod · 0.80
SetMethod · 0.80
formatFunction · 0.50
SetValueMethod · 0.45

Tested by

no test coverage detected