X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=radiant%2Fpreferences.cpp;h=7372a74a0adc30167b185f54f9a0b745cdef52ce;hb=HEAD;hp=30758606c0ce174a93f8dd4a312536e3b871e9f0;hpb=db0e95d2c3d6f175fcdfec306676c735a128c26f;p=xonotic%2Fnetradiant.git diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 30758606..53e3fa80 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 1999-2006 Id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. @@ -58,24 +58,16 @@ void Global_constructPreferences( PreferencesPage& page ){ } void Interface_constructPreferences( PreferencesPage& page ){ -#if GDEF_OS_WINDOWS - page.appendCheckBox( "", "External Shader Editor", g_TextEditor_useWin32Editor ); -#else - { - ui::CheckButton use_custom = page.appendCheckBox( "Text Editor", "Custom", g_TextEditor_useCustomEditor ); - ui::Widget custom_editor = page.appendPathEntry( "Text Editor Command", g_TextEditor_editorCommand, true ); - Widget_connectToggleDependency( custom_editor, use_custom ); - } -#endif + page.appendPathEntry( "Shader Editor Command", g_TextEditor_editorCommand, false ); } void Mouse_constructPreferences( PreferencesPage& page ){ - { - const char* buttons[] = { "2 button", "3 button", }; - page.appendRadio( "Mouse Type", g_glwindow_globals.m_nMouseType, STRING_ARRAY_RANGE( buttons ) ); - } - page.appendCheckBox( "Right Button", "Activates Context Menu", g_xywindow_globals.m_bRightClick ); - page.appendCheckBox( "", "Improved mousewheel zoom", g_xywindow_globals.m_bImprovedWheelZoom ); +// { +// const char* buttons[] = { "2 button", "3 button", }; +// page.appendRadio( "Mouse Type", g_glwindow_globals.m_nMouseType, STRING_ARRAY_RANGE( buttons ) ); +// } +// page.appendCheckBox( "Right Button", "Activates Context Menu", g_xywindow_globals.m_bRightClick ); + page.appendCheckBox( "", "Zoom to mouse pointer", g_xywindow_globals.m_bZoomInToPointer ); } void Mouse_constructPage( PreferenceGroup& group ){ PreferencesPage page( group.createPage( "Mouse", "Mouse Preferences" ) ); @@ -107,7 +99,7 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const CopiedString& gameFile // read the user-friendly game name xmlNodePtr pNode = pDoc->children; - while ( strcmp( (const char*)pNode->name, "game" ) && pNode != 0 ) + while ( pNode != 0 && strcmp( (const char*)pNode->name, "game" ) ) { pNode = pNode->next; } @@ -727,7 +719,7 @@ PreferencesPage createPage( const char* treeName, const char* frameName ){ ui::Window PrefsDlg::BuildDialog(){ PreferencesDialog_addInterfacePreferences( makeCallbackF(Interface_constructPreferences) ); - Mouse_registerPreferencesPage(); + //Mouse_registerPreferencesPage(); ui::Window dialog = ui::Window(create_floating_window( RADIANT_NAME " Preferences", m_parent )); @@ -966,20 +958,20 @@ bool PreferencesDialog_isRestartRequired(){ } void PreferencesDialog_restartIfRequired(){ - if ( !g_restart_required.empty() ) { - StringOutputStream message( 256 ); + if ( !g_restart_required.empty() ) { + StringOutputStream message( 256 ); message << "Preference changes require a restart:\n\n"; - for ( std::vector::iterator i = g_restart_required.begin(); i != g_restart_required.end(); ++i ) - { - message << ( *i ) << '\n'; - } + for ( std::vector::iterator i = g_restart_required.begin(); i != g_restart_required.end(); ++i ) + { + message << ( *i ) << '\n'; + } 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(); + g_restart_required.clear(); if ( ret == ui::alert_response::YES ) { g_GamesDialog.m_bSkipGamePromptOnce = true; @@ -1015,12 +1007,7 @@ struct GameMode { }; void RegisterPreferences( PreferenceSystem& preferences ){ -#if GDEF_OS_WINDOWS - preferences.registerPreference( "UseCustomShaderEditor", make_property_string( g_TextEditor_useWin32Editor ) ); -#else - preferences.registerPreference( "UseCustomShaderEditor", make_property_string( g_TextEditor_useCustomEditor ) ); preferences.registerPreference( "CustomShaderEditorCommand", make_property_string( g_TextEditor_editorCommand ) ); -#endif preferences.registerPreference( "GameName", make_property() ); preferences.registerPreference( "GameMode", make_property() );