summaryrefslogtreecommitdiff
path: root/app/bin/appdefaults.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/bin/appdefaults.c')
-rw-r--r--app/bin/appdefaults.c25
1 files changed, 18 insertions, 7 deletions
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 */
@@ -227,6 +230,14 @@ InitializeRegionCode(void)
}
/**
+ * 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);
}
/**