core: sort struct preferences

sort prefs, making it possible to find variables
add a few missing variables

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-06-13 16:45:19 +02:00 committed by Dirk Hohndel
parent facfdbfc82
commit 36d7f6eafb

View file

@ -59,106 +59,147 @@ typedef struct {
int download_mode; int download_mode;
} dive_computer_prefs_t; } dive_computer_prefs_t;
// ********** PREFERENCES **********
// This struct is kept global for all of ssrf
// most of the fields are loaded from git as
// part of the dives, but some fields are loaded
// from local storage (QSettings)
// The struct is divided in groups (sorted)
// and elements within the group is sorted
//
// When adding items to this list, please keep
// the list sorted (easier to find something)
struct preferences { struct preferences {
const char *divelist_font; // ********** Animations **********
const char *default_filename; int animation_speed;
const char *default_cylinder;
// ********** CloudStorage **********
const char *cloud_base_url; const char *cloud_base_url;
const char *cloud_git_url; const char *cloud_git_url;
const char *time_format; const char *cloud_storage_email;
const char *date_format; const char *cloud_storage_email_encoded;
const char *date_format_short; const char *cloud_storage_newpassword;
bool time_format_override; const char *cloud_storage_password;
bool date_format_override; const char *cloud_storage_pin;
double font_size; short cloud_timeout;
partial_pressure_graphs_t pp_graphs; short cloud_verification_status;
bool mod; bool git_local_only;
double modpO2; bool save_password_local;
bool ead;
bool dcceiling;
bool redceiling;
bool calcceiling;
bool calcceiling3m;
bool calcalltissues;
bool calcndltts;
short gflow;
short gfhigh;
int animation_speed;
bool gf_low_at_maxdepth;
bool show_ccr_setpoint;
bool show_ccr_sensors;
bool show_scr_ocpo2;
bool display_invalid_dives;
short unit_system;
struct units units;
bool coordinates_traditional;
bool show_sac;
bool display_unused_tanks;
bool show_average_depth;
bool show_icd;
bool zoomed_plot;
bool hrgraph;
bool percentagegraph;
bool rulergraph;
bool tankbar;
bool save_userid_local; bool save_userid_local;
const char *userid; const char *userid;
int ascrate75; // All rates in mm / sec
int ascrate50; // ********** DiveComputer **********
int ascratestops; dive_computer_prefs_t dive_computer;
int ascratelast6m;
int descrate; // ********** Display **********
int sacfactor; bool display_invalid_dives;
int problemsolvingtime; const char *divelist_font;
int bottompo2; double font_size;
int decopo2; bool showDeveloper;
enum deco_mode display_deco_mode; const char *theme;
depth_t bestmixend;
int proxy_type; // ********** Facebook **********
facebook_prefs_t facebook;
// ********** General **********
bool auto_recalculate_thumbnails;
int defaultsetpoint; // default setpoint in mbar
const char *default_cylinder;
const char *default_filename;
short default_file_behavior;
int o2consumption; // ml per min
int pscr_ratio; // dump ratio times 1000
bool use_default_file;
// ********** Geocoding **********
geocoding_prefs_t geocoding;
// ********** Language **********
const char * date_format;
bool date_format_override;
const char * date_format_short;
locale_prefs_t locale; //: TODO: move the rest of locale based info here.
const char * time_format;
bool time_format_override;
// ********** LocationService **********
int time_threshold;
int distance_threshold;
// ********** Network **********
bool proxy_auth;
const char *proxy_host; const char *proxy_host;
int proxy_port; int proxy_port;
bool proxy_auth; int proxy_type;
const char *proxy_user; const char *proxy_user;
const char *proxy_pass; const char *proxy_pass;
// ********** Planner **********
int ascratelast6m;
int ascratestops;
int ascrate50;
int ascrate75; // All rates in mm / sec
depth_t bestmixend;
int bottompo2;
int bottomsac;
int decopo2;
int decosac;
int descrate;
bool display_duration;
bool display_runtime;
bool display_transitions;
bool display_variations;
bool doo2breaks; bool doo2breaks;
bool drop_stone_mode; bool drop_stone_mode;
bool last_stop; // At 6m? bool last_stop; // At 6m?
bool verbatim_plan; int min_switch_duration; // seconds
bool display_runtime; enum deco_mode planner_deco_mode;
bool display_duration; int problemsolvingtime;
bool display_transitions; int reserve_gas;
bool display_variations; int sacfactor;
bool safetystop; bool safetystop;
bool switch_at_req_stop; bool switch_at_req_stop;
int reserve_gas; bool verbatim_plan;
int min_switch_duration; // seconds
int bottomsac; // ********** TecDetails **********
int decosac; bool calcalltissues;
int o2consumption; // ml per min bool calcceiling;
int pscr_ratio; // dump ratio times 1000 bool calcceiling3m;
int defaultsetpoint; // default setpoint in mbar bool calcndltts;
bool dcceiling;
enum deco_mode display_deco_mode;
bool display_unused_tanks;
bool ead;
short gfhigh;
short gflow;
bool gf_low_at_maxdepth;
bool hrgraph;
bool mod;
double modpO2;
bool percentagegraph;
partial_pressure_graphs_t pp_graphs;
bool redceiling;
bool rulergraph;
bool show_average_depth;
bool show_ccr_sensors;
bool show_ccr_setpoint;
bool show_icd;
bool show_pictures_in_profile; bool show_pictures_in_profile;
bool use_default_file; bool show_sac;
short default_file_behavior; bool show_scr_ocpo2;
facebook_prefs_t facebook; bool tankbar;
const char *cloud_storage_password;
const char *cloud_storage_newpassword;
const char *cloud_storage_email;
const char *cloud_storage_email_encoded;
bool save_password_local;
short cloud_verification_status;
geocoding_prefs_t geocoding;
enum deco_mode planner_deco_mode;
short vpmb_conservatism; short vpmb_conservatism;
int time_threshold; bool zoomed_plot;
int distance_threshold;
bool git_local_only; // ********** Units **********
short cloud_timeout; bool coordinates_traditional;
bool auto_recalculate_thumbnails; short unit_system;
locale_prefs_t locale; //: TODO: move the rest of locale based info here. struct units units;
// ********** UpdateManager **********
update_manager_prefs_t update_manager; update_manager_prefs_t update_manager;
dive_computer_prefs_t dive_computer;
}; };
enum unit_system_values { enum unit_system_values {
METRIC, METRIC,
IMPERIAL, IMPERIAL,