]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/preferences.cpp
radiant: make restart notification a question
[xonotic/netradiant.git] / radiant / preferences.cpp
index e31bc0487f063b6a33a97f380a53d539f56b3b52..8e2e0268f8ec882132528af56cc110fffcecc330 100644 (file)
@@ -281,7 +281,11 @@ void CGameDialog::GameFileImport( int value ){
        {
                ++iGame;
        }
-       m_sGameFile = ( *iGame )->mGameFile;
+
+       if ( ( *iGame )->mGameFile != m_sGameFile ) {
+               m_sGameFile = ( *iGame )->mGameFile;
+               PreferencesDialog_restartRequired( "Selected Game" );
+       }
 }
 
 void CGameDialog::GameFileExport( const Callback<void(int)> & importCallback ) const {
@@ -915,8 +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();
+
+                       if ( ret == ui::alert_response::YES ) {
+                               Radiant_Restart();
+                       }
                }
        }
 }