33 |
|
|
34 |
preferencestype preferences; |
preferencestype preferences; |
35 |
extern gchar *xlogdir; |
extern gchar *xlogdir; |
36 |
#define PREFERENCES_VERSION 4 |
#define PREFERENCES_VERSION 5 |
37 |
gboolean newprefsfile = FALSE; |
gboolean newprefsfile = FALSE; |
38 |
|
|
39 |
static void make_default_preferences (void) |
static void make_default_preferences (void) |
60 |
preferences.printorientation = 0; |
preferences.printorientation = 0; |
61 |
preferences.printdestination = 0; |
preferences.printdestination = 0; |
62 |
preferences.hamlib = 0; |
preferences.hamlib = 0; |
63 |
preferences.radio = g_strdup ("Dummy"); |
preferences.rigid = 1; |
64 |
preferences.device = g_strdup ("/dev/ttyS1"); |
preferences.device = g_strdup ("/dev/ttyS1"); |
65 |
preferences.rigconf = g_strdup ("?"); |
preferences.rigconf = g_strdup ("?"); |
66 |
preferences.round = 3; |
preferences.round = 3; |
259 |
preferences.hamlib = atoi (key); |
preferences.hamlib = atoi (key); |
260 |
free (key); |
free (key); |
261 |
} |
} |
262 |
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"radio"))) |
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"rigid"))) |
263 |
{ |
{ |
264 |
key = xmlNodeListGetString (p, cur->xmlChildrenNode, 1); |
key = xmlNodeListGetString (p, cur->xmlChildrenNode, 1); |
265 |
preferences.radio = g_strdup (key); |
preferences.rigid = atoi (key); |
266 |
free (key); |
free (key); |
267 |
} |
} |
268 |
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"device"))) |
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"device"))) |
741 |
} |
} |
742 |
else if (!strcmp (node->name, "radio")) |
else if (!strcmp (node->name, "radio")) |
743 |
{ |
{ |
744 |
key = g_strdup (preferences.radio); |
key = g_strdup_printf ("%d", preferences.rigid); |
745 |
xmlNodeSetContent (node, key); |
xmlNodeSetContent (node, key); |
746 |
g_free (key); |
g_free (key); |
747 |
} |
} |
1129 |
xmlNewTextChild (cur, NULL, "printdestination", key); |
xmlNewTextChild (cur, NULL, "printdestination", key); |
1130 |
key = g_strdup_printf ("%d", preferences.hamlib); |
key = g_strdup_printf ("%d", preferences.hamlib); |
1131 |
xmlNewTextChild (cur, NULL, "hamlib", key); |
xmlNewTextChild (cur, NULL, "hamlib", key); |
1132 |
key = g_strdup_printf ("%s", preferences.radio); |
key = g_strdup_printf ("%d", preferences.rigid); |
1133 |
xmlNewTextChild (cur, NULL, "radio", key); |
xmlNewTextChild (cur, NULL, "rigid", key); |
1134 |
key = g_strdup_printf ("%s", preferences.device); |
key = g_strdup_printf ("%s", preferences.device); |
1135 |
xmlNewTextChild (cur, NULL, "device", key); |
xmlNewTextChild (cur, NULL, "device", key); |
1136 |
key = g_strdup_printf ("%s", preferences.rigconf); |
key = g_strdup_printf ("%s", preferences.rigconf); |
1401 |
xmlNewTextChild (cur, NULL, "fcc", key); |
xmlNewTextChild (cur, NULL, "fcc", key); |
1402 |
g_free (key); |
g_free (key); |
1403 |
} |
} |
1404 |
|
if (!newprefsfile && (preferences.version < 5)) |
1405 |
|
{ |
1406 |
|
/* introduced in xlog version 1.3 */ |
1407 |
|
key = g_strdup_printf ("%d", preferences.rigid); |
1408 |
|
xmlNewTextChild (cur, NULL, "rigid", key); |
1409 |
|
g_free (key); |
1410 |
|
} |
1411 |
} |
} |
1412 |
cur = cur->next; |
cur = cur->next; |
1413 |
} |
} |