From b623f5953691b2a0614e6f1f4def86bdbb9a4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Aug 2020 11:53:00 +0200 Subject: New upstream version 5.2.0Beta2.1 --- app/bin/appdefaults.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'app/bin/appdefaults.c') diff --git a/app/bin/appdefaults.c b/app/bin/appdefaults.c index a2dd885..55a2201 100644 --- a/app/bin/appdefaults.c +++ b/app/bin/appdefaults.c @@ -82,7 +82,10 @@ static char *GetParamPrototype(struct appDefault *ptrDefault, */ struct appDefault xtcDefaults[] = { - { "DialogItem.cmdopt-preselect", 0, INTEGERCONSTANT,{ .intValue = 1 } }, /**< default command is select */ + { "DialogItem.cmdopt-preselect", 0, INTEGERCONSTANT,{ .intValue = 1 } }, /**< default command is select */ + { "DialogItem.cmdopt-rightclickmode", 0, INTEGERCONSTANT,{ .intValue = 1 } }, /**< swap default to context */ + { "DialogItem.cmdopt-selectmode", 0, INTEGERCONSTANT,{ .intValue = 0 } }, /**< 'Only' mode */ + { "DialogItem.cmdopt-selectzero", 0, INTEGERCONSTANT,{ .intValue = 1 } }, /**< 'On' mode */ { "DialogItem.grid-horzenable", 0, INTEGERCONSTANT, { .intValue = 0 }}, { "DialogItem.grid-vertenable", 0, INTEGERCONSTANT,{ .intValue = 0 } }, { "DialogItem.pref-dstfmt", 0, INTEGERFUNCTION,{ .intFunction = GetLocalDistanceFormat } }, /**< number format for distances */ @@ -226,6 +229,14 @@ InitializeRegionCode(void) #endif } +/** + * Use Metric measures everywhere except United States and Canada\ + */ +static bool UseMetric() +{ + return ( strcmp( regionCode, "US" ) != 0 && + strcmp( regionCode, "CA" ) != 0 ); +} /** * For the US the classical 4x8 sheet is used as default size. in the metric world 1,25x2,0m is used. */ @@ -234,11 +245,11 @@ static double GetLocalRoomSize(struct appDefault *ptrDefault, void *data) { if (!strcmp(ptrDefault->defaultKey, "draw.roomsizeY")) { - return (strcmp(regionCode, "US") ? 125.0/2.54 : 48); + return (UseMetric() ? 125.0/2.54 : 48); } if (!strcmp(ptrDefault->defaultKey, "draw.roomsizeX")) { - return (strcmp(regionCode, "US") ? 200.0 / 2.54 : 96); + return (UseMetric() ? 200.0 / 2.54 : 96); } return (0.0); // should never get here @@ -255,21 +266,21 @@ GetLocalPopularScale(struct appDefault *ptrDefault, void *data) } /** - * The measurement system is english for the US and metric elsewhere + * The measurement system is english for the US and Canada and metric elsewhere */ static int GetLocalMeasureSystem(struct appDefault *ptrDefault, void *data) { - return (strcmp(regionCode, "US") ? 1 : 0); + return (UseMetric() ? 1 : 0); } /** -* The distance format is 999.9 cm for metric and ?? for english +* The distance format is 999.9 cm for metric and 999.99 for english */ static int GetLocalDistanceFormat(struct appDefault *ptrDefault, void *data) { - return (strcmp(regionCode, "US") ? 8 : 5); + return (UseMetric() ? 8 : 4); } /** -- cgit v1.2.3