]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/multimon.cpp
Introduce Property<T> to simplify preferences system
[xonotic/netradiant.git] / radiant / multimon.cpp
index 6fd4100372c20ea39bbaf7b04c38878dce46a1d2..38ed3f302ce3a657e2f8571af44eec25b94bc2f4 100644 (file)
 
 multimon_globals_t g_multimon_globals;
 
-LatchedBool g_Multimon_enableSysMenuPopups( false, "Floating windows sysmenu icons" );
+LatchedValue<bool> g_Multimon_enableSysMenuPopups( false, "Floating windows sysmenu icons" );
 
 void MultiMonitor_constructPreferences( PreferencesPage& page ){
        ui::CheckButton primary_monitor = page.appendCheckBox( "Multi Monitor", "Start on Primary Monitor", g_multimon_globals.m_bStartOnPrimMon );
        ui::CheckButton popup = page.appendCheckBox(
                "", "Disable system menu on popup windows",
-               LatchedBoolImportCaller( g_Multimon_enableSysMenuPopups ),
-               BoolExportCaller( g_Multimon_enableSysMenuPopups.m_latched )
+               mkImportExportCallback( g_Multimon_enableSysMenuPopups )
                );
        Widget_connectToggleDependency( popup, primary_monitor );
 }
@@ -87,12 +86,12 @@ void MultiMon_Construct(){
                g_multimon_globals.m_bStartOnPrimMon = true;
        }
 
-       GlobalPreferenceSystem().registerPreference( "StartOnPrimMon", BoolImportStringCaller( g_multimon_globals.m_bStartOnPrimMon ), BoolExportStringCaller( g_multimon_globals.m_bStartOnPrimMon ) );
-       GlobalPreferenceSystem().registerPreference( "NoSysMenuPopups", BoolImportStringCaller( g_Multimon_enableSysMenuPopups.m_latched ), BoolExportStringCaller( g_Multimon_enableSysMenuPopups.m_latched ) );
+       GlobalPreferenceSystem().registerPreference( "StartOnPrimMon", make_property_string( g_multimon_globals.m_bStartOnPrimMon ) );
+       GlobalPreferenceSystem().registerPreference( "NoSysMenuPopups", make_property_string( g_Multimon_enableSysMenuPopups.m_latched ) );
 
        g_Multimon_enableSysMenuPopups.useLatched();
 
-       PreferencesDialog_addInterfacePreferences( FreeCaller1<PreferencesPage&, MultiMonitor_constructPreferences>() );
+       PreferencesDialog_addInterfacePreferences( makeCallbackF(MultiMonitor_constructPreferences) );
 }
 void MultiMon_Destroy(){
 }