| 54 LDDocument::setCurrent (null); |
54 LDDocument::setCurrent (null); |
| 55 |
55 |
| 56 // Load or create the configuration |
56 // Load or create the configuration |
| 57 if (!Config::load()) |
57 if (!Config::load()) |
| 58 { |
58 { |
| 59 log ("Creating configuration file...\n"); |
59 print ("Creating configuration file...\n"); |
| 60 |
60 |
| 61 if (Config::save()) |
61 if (Config::save()) |
| 62 log ("Configuration file successfully created.\n"); |
62 print ("Configuration file successfully created.\n"); |
| 63 else |
63 else |
| 64 log ("failed to create configuration file!\n"); |
64 critical ("Failed to create configuration file!\n"); |
| 65 } |
65 } |
| 66 |
66 |
| 67 LDPaths::initPaths(); |
67 LDPaths::initPaths(); |
| 68 initColors(); |
68 initColors(); |
| 69 MainWindow* win = new MainWindow; |
69 MainWindow* win = new MainWindow; |
| 80 } |
80 } |
| 81 |
81 |
| 82 loadPrimitives(); |
82 loadPrimitives(); |
| 83 return app.exec(); |
83 return app.exec(); |
| 84 } |
84 } |
| 85 |
|
| 86 // ============================================================================= |
|
| 87 // |
|
| 88 void doPrint (QFile& f, QList<StringFormatArg> args) |
|
| 89 { |
|
| 90 QString msg = DoFormat (args); |
|
| 91 f.write (msg.toUtf8()); |
|
| 92 f.flush(); |
|
| 93 } |
|
| 94 |
|
| 95 // ============================================================================= |
|
| 96 // |
|
| 97 void doPrint (FILE* fp, QList<StringFormatArg> args) |
|
| 98 { |
|
| 99 QString msg = DoFormat (args); |
|
| 100 fwrite (msg.toStdString().c_str(), 1, msg.length(), fp); |
|
| 101 fflush (fp); |
|
| 102 } |
|