33 |
|
|
34 |
preferencestype preferences; |
preferencestype preferences; |
35 |
extern gchar *xlogdir; |
extern gchar *xlogdir; |
36 |
#define PREFERENCES_VERSION 1 |
#define PREFERENCES_VERSION 2 |
37 |
gboolean newprefsfile = FALSE; |
gboolean newprefsfile = FALSE; |
38 |
|
|
39 |
static void make_default_preferences (void) |
static void make_default_preferences (void) |
100 |
preferences.b4y = 30; |
preferences.b4y = 30; |
101 |
preferences.b4width = 500; |
preferences.b4width = 500; |
102 |
preferences.b4height = 300; |
preferences.b4height = 300; |
103 |
|
preferences.saveasadif = 0; |
104 |
|
preferences.saveaslabels = 0; |
105 |
} |
} |
106 |
|
|
107 |
void |
void |
453 |
preferences.b4height = atoi (key); |
preferences.b4height = atoi (key); |
454 |
xmlFree (key); |
xmlFree (key); |
455 |
} |
} |
456 |
|
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"saveasadif"))) |
457 |
|
{ |
458 |
|
key = xmlNodeListGetString (p, cur->xmlChildrenNode, 1); |
459 |
|
preferences.saveasadif = atoi (key); |
460 |
|
xmlFree (key); |
461 |
|
} |
462 |
|
else if ((!xmlStrcmp(cur->name, (const xmlChar *)"saveaslabels"))) |
463 |
|
{ |
464 |
|
key = xmlNodeListGetString (p, cur->xmlChildrenNode, 1); |
465 |
|
preferences.saveaslabels = atoi (key); |
466 |
|
xmlFree (key); |
467 |
|
} |
468 |
cur = cur->next; |
cur = cur->next; |
469 |
} |
} |
470 |
return; |
return; |
819 |
xmlNodeSetContent (node, key); |
xmlNodeSetContent (node, key); |
820 |
g_free (key); |
g_free (key); |
821 |
} |
} |
822 |
|
else if (!strcmp (node->name, "saveasadif")) |
823 |
|
{ |
824 |
|
key = g_strdup_printf ("%d", preferences.saveasadif); |
825 |
|
xmlNodeSetContent (node, key); |
826 |
|
g_free (key); |
827 |
|
} |
828 |
|
else if (!strcmp (node->name, "saveaslabels")) |
829 |
|
{ |
830 |
|
key = g_strdup_printf ("%d", preferences.saveaslabels); |
831 |
|
xmlNodeSetContent (node, key); |
832 |
|
g_free (key); |
833 |
|
} |
834 |
} |
} |
835 |
} |
} |
836 |
|
|
955 |
xmlNewTextChild (cur, NULL, "b4width", key); |
xmlNewTextChild (cur, NULL, "b4width", key); |
956 |
key = g_strdup_printf ("%d", preferences.b4height); |
key = g_strdup_printf ("%d", preferences.b4height); |
957 |
xmlNewTextChild (cur, NULL, "b4height", key); |
xmlNewTextChild (cur, NULL, "b4height", key); |
958 |
|
key = g_strdup_printf ("%d", preferences.saveasadif); |
959 |
|
xmlNewTextChild (cur, NULL, "saveasadif", key); |
960 |
|
key = g_strdup_printf ("%d", preferences.saveaslabels); |
961 |
|
xmlNewTextChild (cur, NULL, "saveaslabels", key); |
962 |
g_free (key); |
g_free (key); |
963 |
} |
} |
964 |
|
|
1062 |
xmlNewTextChild (cur, NULL, "logcwidths", key); |
xmlNewTextChild (cur, NULL, "logcwidths", key); |
1063 |
g_free (key); |
g_free (key); |
1064 |
} |
} |
1065 |
|
if (!newprefsfile && (preferences.version < 2)) |
1066 |
|
{ |
1067 |
|
/* introduced in xlog version 0.9.10 */ |
1068 |
|
key = g_strdup_printf ("%d", preferences.saveasadif); |
1069 |
|
xmlNewTextChild (cur, NULL, "saveasadif", key); |
1070 |
|
key = g_strdup_printf ("%d", preferences.saveaslabels); |
1071 |
|
xmlNewTextChild (cur, NULL, "saveaslabels", key); |
1072 |
|
g_free (key); |
1073 |
|
} |
1074 |
} |
} |
1075 |
cur = cur->next; |
cur = cur->next; |
1076 |
} |
} |