X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fpreferences.h;h=a7739d4dce474fa6bdae9165e85422097c68d153;hb=b697f9ada5c6ef01411552d9ddbd2e47ecb243a3;hp=59dd60daaa0c6e42633932892511d91fa594429c;hpb=1b43d194324664a27b2639b326ae55ec996a4c01;p=xonotic%2Fnetradiant.git diff --git a/radiant/preferences.h b/radiant/preferences.h index 59dd60da..a7739d4d 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -71,6 +71,12 @@ void appendRadioIcons( const char* name, StringArrayRange icons, Property c void appendRadioIcons( const char* name, int& data, StringArrayRange icons ){ m_dialog.addRadioIcons( m_vbox, name, data, icons ); } +ui::Widget appendSpacer( int dimension ){ + return m_dialog.addSpacer( m_vbox, dimension ); +} +ui::Widget appendLabel( const char* name, const char* text ){ + return m_dialog.addLabel( m_vbox, name, text ); +} ui::Widget appendEntry( const char* name, Property const &cb ){ return m_dialog.addIntEntry( m_vbox, name, cb ); } @@ -123,6 +129,7 @@ void PreferencesDialog_addDisplayPage( const PreferenceGroupCallback& callback ) void PreferencesDialog_addSettingsPreferences( const PreferencesPageCallback& callback ); void PreferencesDialog_addSettingsPage( const PreferenceGroupCallback& callback ); +bool PreferencesDialog_isRestartRequired(); void PreferencesDialog_restartRequired( const char* staticName ); template @@ -222,6 +229,11 @@ mutable int m_nComboSelect; ///< intermediate int value for combo in dialog bo public: +/*! + used to no ask for restart when switching game from Gobal Preferences window displayed on startup +*/ + +bool onStartup; /*! those settings are saved in the global prefs file I'm too lazy to wrap behind protected access, not sure this needs to be public @@ -238,6 +250,12 @@ CopiedString m_sGameFile; prompt which game to load on startup */ bool m_bGamePrompt; +/*! + when if m_bGamePrompt is true + do not prompt at startup which game to load this time, but prompt the next times + this is used to not uselessly prompt game after having restarted because user switched game + */ +bool m_bSkipGamePromptOnce; /*! log console to radiant.log m_bForceLogConsole is an obscure forced latching situation @@ -253,6 +271,7 @@ std::list mGames; CGameDialog() : m_sGameFile( "" ), m_bGamePrompt( true ), + m_bSkipGamePromptOnce( false ), m_bForceLogConsole( false ){ } virtual ~CGameDialog(); @@ -338,9 +357,13 @@ public: ui::Widget m_notebook{ui::null}; -virtual ~PrefsDlg(){ - g_string_free( m_rc_path, true ); - g_string_free( m_inipath, true ); +virtual ~PrefsDlg() { + if (m_rc_path) { + g_string_free( m_rc_path, true ); + } + if (m_inipath) { + g_string_free( m_inipath, true ); + } } /*! @@ -392,6 +415,8 @@ extern preferences_globals_t g_preferences_globals; void PreferencesDialog_constructWindow( ui::Window main_window ); void PreferencesDialog_destroyWindow(); + +void PreferencesDialog_restartIfRequired(); void PreferencesDialog_showDialog(); void GlobalPreferences_Init();