75
75
openOrInitialize (&fullPath, &defaultLaunchers);
77
if (!doc.Load (fullPath))
77
if (!doc.Load (fullPath)) {
82
81
// start processing the XML file
83
if (doc.GetRoot ()->GetName () != wxT (XML_PROGRAM))
85
cout << "invalid xml file" << endl;
82
if (doc.GetRoot ()->GetName () != wxT (XML_PROGRAM)) {
83
cout << "invalid xml file" << endl;
89
87
wxXmlNode *program = doc.GetRoot ()->GetChildren ();
94
if (program->GetName () == wxT (XML_SIMDOCK))
96
wxXmlNode *child = program->GetChildren ();
98
wxString path, icon, descr, name;
101
if (child->GetName () == wxT (XML_PATH))
102
path = child->GetNodeContent ();
103
if (child->GetName () == wxT (XML_ICON))
104
icon = child->GetNodeContent ();
105
if (child->GetName () == wxT (XML_DESCR))
106
descr = child->GetNodeContent ();
107
if (child->GetName () == wxT (XML_NAME))
108
name = child->GetNodeContent ();
109
child = child->GetNext ();
111
if (!path.IsEmpty () && !icon.IsEmpty ())
114
if (!img.LoadFile (icon))
116
img.LoadFile(questionPath);
91
if (program->GetName () == wxT (XML_SIMDOCK)) {
92
wxXmlNode *child = program->GetChildren ();
94
wxString path, icon, descr, name;
96
if (child->GetName () == wxT (XML_PATH))
97
path = child->GetNodeContent ();
98
if (child->GetName () == wxT (XML_ICON))
99
icon = child->GetNodeContent ();
100
if (child->GetName () == wxT (XML_DESCR))
101
descr = child->GetNodeContent ();
102
if (child->GetName () == wxT (XML_NAME))
103
name = child->GetNodeContent ();
104
child = child->GetNext ();
106
if (!path.IsEmpty () && !icon.IsEmpty ()) {
109
if (icon.EndsWith(".svg")) {
110
// we use the questionPath as placeholder for the constructor
111
img.LoadFile(questionPath);
113
if (!img.LoadFile (icon)) {
114
img.LoadFile(questionPath);
118
117
simImage *sim = new simImage (img,
124
123
sim->w = settings->ICONW;
125
124
sim->h = settings->ICONH;
126
sim->y = (settings->MAXSIZE + settings->BOTTOM_BORDER) - settings->ICONH - settings->BOTTOM_BORDER; // I
125
sim->y = (settings->MAXSIZE + settings->BOTTOM_BORDER) - settings->ICONH - settings->BOTTOM_BORDER;
126
if (icon.EndsWith(".svg")) {
127
sim->loadImage(icon);
132
131
#ifdef SIMDOCK_DEBUG
133
132
cout << id << ":" << wx2std (name) << endl;
137
136
program = program->GetNext ();