MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / askForStartupSkip

Function askForStartupSkip

lib/utils/crash-handler.cpp:130–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130static void askForStartupSkip()
131{
132 auto mainWindow =
133 static_cast<QMainWindow *>(obs_frontend_get_main_window());
134 auto dialog = new QDialog(mainWindow);
135 dialog->setWindowTitle(obs_module_text("AdvSceneSwitcher.windowTitle"));
136 dialog->setWindowFlags(dialog->windowFlags() &
137 ~Qt::WindowContextHelpButtonHint);
138
139 auto layout = new QVBoxLayout(dialog);
140 auto label = new QLabel(
141 obs_module_text("AdvSceneSwitcher.crashDetected"), dialog);
142 label->setWordWrap(true);
143 layout->addWidget(label);
144
145 auto checkbox = new QCheckBox(
146 obs_module_text(
147 "AdvSceneSwitcher.crashDetected.suppressCheckbox"),
148 dialog);
149 layout->addWidget(checkbox);
150
151 auto buttonbox = new QDialogButtonBox(
152 QDialogButtonBox::Yes | QDialogButtonBox::No, dialog);
153 QObject::connect(buttonbox, &QDialogButtonBox::accepted, dialog,
154 &QDialog::accept);
155 QObject::connect(buttonbox, &QDialogButtonBox::rejected, dialog,
156 &QDialog::reject);
157 layout->addWidget(buttonbox);
158
159 dialog->setLayout(layout);
160
161 bool skipStart = dialog->exec() == QDialog::Accepted;
162 suppressCrashDialog = checkbox->isChecked();
163 dialog->deleteLater();
164
165 if (!skipStart) {
166 StartPlugin();
167 }
168}
169
170bool ShouldSkipPluginStartOnUncleanShutdown()
171{

Calls 3

obs_module_textFunction · 0.85
isCheckedMethod · 0.80
StartPluginFunction · 0.70

Tested by

no test coverage detected