- visible_cols.cylinder = gconf_client_get_bool(gconf, GCONF_NAME(CYLINDER), NULL);
- visible_cols.temperature = gconf_client_get_bool(gconf, GCONF_NAME(TEMPERATURE), NULL);
- visible_cols.nitrox = gconf_client_get_bool(gconf, GCONF_NAME(NITROX), NULL);
- visible_cols.otu = gconf_client_get_bool(gconf, GCONF_NAME(OTU), NULL);
- visible_cols.sac = gconf_client_get_bool(gconf, GCONF_NAME(SAC), NULL);
-
- divelist_font = gconf_client_get_string(gconf, GCONF_NAME(divelist_font), NULL);
-#else
- DWORD len = 4;
- LONG success;
- HKEY hkey;
-
- success = RegOpenKeyEx( HKEY_CURRENT_USER, TEXT("Software\\subsurface"), 0,
- KEY_QUERY_VALUE, &hkey);
-
- output_units.length = get_from_registry(hkey, "feet");
- output_units.pressure = get_from_registry(hkey, "psi");
- output_units.volume = get_from_registry(hkey, "cuft");
- output_units.temperature = get_from_registry(hkey, "fahrenheit");
- visible_cols.temperature = get_from_registry(hkey, "temperature");
- visible_cols.cylinder = get_from_registry(hkey, "cylinder");
- visible_cols.nitrox = get_from_registry(hkey, "nitrox");
- visible_cols.sac = get_from_registry(hkey, "sac");
- visible_cols.otu = get_from_registry(hkey, "otu");
-
- divelist_font = malloc(80);
- len = 80;
- success = RegQueryValueEx(hkey, TEXT("divelist_font"), NULL, NULL,
- (LPBYTE) divelist_font, &len );
- if (success != ERROR_SUCCESS) {
- /* that's what happens the first time we start - just use the default */
- free(divelist_font);
- divelist_font = NULL;
- }
- RegCloseKey(hkey);
+ visible_cols.cylinder = PTR_TO_BOOL(subsurface_get_conf("CYLINDER", PREF_BOOL));
+ visible_cols.temperature = PTR_TO_BOOL(subsurface_get_conf("TEMPERATURE", PREF_BOOL));
+ visible_cols.nitrox = PTR_TO_BOOL(subsurface_get_conf("NITROX", PREF_BOOL));
+ visible_cols.otu = PTR_TO_BOOL(subsurface_get_conf("OTU", PREF_BOOL));
+ visible_cols.sac = PTR_TO_BOOL(subsurface_get_conf("SAC", PREF_BOOL));
+
+ divelist_font = subsurface_get_conf("divelist_font", PREF_STRING);