]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
radiant: make restart notification a question
authorThomas Debesse <dev@illwieckz.net>
Sun, 14 Jul 2019 06:19:51 +0000 (08:19 +0200)
committerThomas Debesse <dev@illwieckz.net>
Mon, 22 Jul 2019 02:09:24 +0000 (04:09 +0200)
thanks to latched variable mechanism
people can chose to not restart immediately

radiant/preferences.cpp

index 11d569a20ff364b3b563e1a46e76f70cd8931e0f..8e2e0268f8ec882132528af56cc110fffcecc330 100644 (file)
@@ -919,10 +919,15 @@ void PreferencesDialog_showDialog(){
                                message << ( *i ) << '\n';
                        }
 
-                       ui::alert( MainFrame_getWindow(), message.c_str() );
+                       message << "\nRestart now?";
+
+                       auto ret = ui::alert( MainFrame_getWindow(), message.c_str(), "Restart " RADIANT_NAME "?", ui::alert_type::YESNO, ui::alert_icon::Question );
+
                        g_restart_required.clear();
 
-                       Radiant_Restart();
+                       if ( ret == ui::alert_response::YES ) {
+                               Radiant_Restart();
+                       }
                }
        }
 }