/[xlog]/xlog/src/preferences.c
ViewVC logotype

Diff of /xlog/src/preferences.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by pa4tu, Sat Mar 5 20:19:53 2005 UTC revision 1.39 by pa4tu, Mon May 16 08:01:13 2005 UTC
# Line 33  Line 33 
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)
# Line 60  static void make_default_preferences (vo Line 60  static void make_default_preferences (vo
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;
# Line 259  parseloadpreferences (xmlDocPtr p, xmlNo Line 259  parseloadpreferences (xmlDocPtr p, xmlNo
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")))
# Line 741  void parsesavepreferences (xmlNodePtr cu Line 741  void parsesavepreferences (xmlNodePtr cu
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                  }                  }
# Line 1129  newsavepreferences (xmlNodePtr cur) Line 1129  newsavepreferences (xmlNodePtr cur)
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);
# Line 1401  savepreferences (void) Line 1401  savepreferences (void)
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          }          }

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26