File tree Expand file tree Collapse file tree 1 file changed +24
-6
lines changed
Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -187,12 +187,30 @@ void PythonInstallDialog::OnPackagesInstalled() {
187187 progressBar->setValue (100 );
188188 statusLabel->setText (tr (" Installation complete! AI Processing is now ready." ));
189189
190- QMessageBox::information (
191- this ,
192- tr (" Success" ),
193- tr (" Python and all required packages have been installed successfully.\n\n "
194- " You can now use AI Processing features." )
195- );
190+ QMessageBox msgBox (this );
191+ msgBox.setIcon (QMessageBox::Information);
192+ msgBox.setWindowTitle (tr (" Installation Complete" ));
193+ msgBox.setText (tr (
194+ " Python and all required packages have been installed successfully.\n\n "
195+ " A restart is required to enable AI Processing features."
196+ ));
197+
198+ QPushButton *restartButton =
199+ msgBox.addButton (tr (" Restart Now" ), QMessageBox::AcceptRole);
200+ QPushButton *laterButton =
201+ msgBox.addButton (tr (" Restart Later" ), QMessageBox::RejectRole);
202+
203+ msgBox.exec ();
204+
205+ if (msgBox.clickedButton () == restartButton) {
206+ // Relaunch the application
207+ const QString program = QCoreApplication::applicationFilePath ();
208+ const QStringList arguments = QCoreApplication::arguments ();
209+
210+ QProcess::startDetached (program, arguments);
211+ QCoreApplication::quit ();
212+ return ;
213+ }
196214
197215 accept ();
198216}
You can’t perform that action at this time.
0 commit comments