insilmaril@366: #include insilmaril@366: #include insilmaril@0: insilmaril@0: #include "settings.h" insilmaril@0: #include "options.h" insilmaril@0: #include "mainwindow.h" insilmaril@0: #include "flagrowobj.h" insilmaril@0: insilmaril@0: // Global variables insilmaril@0: TextEditor *textEditor; // used in Constr. of LinkableMapObj insilmaril@0: // initialized in mainwindow insilmaril@0: insilmaril@0: Main *mainWindow; // used in BranchObj::select() insilmaril@164: QString tmpVymDir; // All temp files go there, created in mainwindow insilmaril@166: QString clipboardDir; // Clipboard used in all mapEditors insilmaril@215: QDir vymBaseDir; // Containing all styles, scripts, images, ... insilmaril@366: QDir lastImageDir; insilmaril@366: QDir lastFileDir; insilmaril@269: QString iconPath; // Pointing to icons used for toolbars insilmaril@269: QString flagsPath; // Pointing to flags insilmaril@166: bool clipboardEmpty; insilmaril@0: FlagRowObj *systemFlagsDefault; // used to copy from in LinkableMapObj insilmaril@0: FlagRowObj *standardFlagsDefault; insilmaril@0: insilmaril@366: insilmaril@366: Settings settings ("InSilmaril","vym"); // Organization, Application name insilmaril@366: insilmaril@0: Options options; insilmaril@366: ImageIO imageIO; insilmaril@0: insilmaril@0: int statusbarTime=3500; insilmaril@0: insilmaril@394: int main(int argc, char* argv[]) insilmaril@0: { insilmaril@394: //Q_INIT_RESOURCE (application); insilmaril@366: insilmaril@0: QApplication app(argc,argv); insilmaril@0: insilmaril@0: insilmaril@0: // Reading and initializing options commandline options insilmaril@0: options.add ("version", SwitchOption, "v","version"); insilmaril@243: options.add ("local", SwitchOption, "l", "local"); insilmaril@0: options.add ("help", SwitchOption, "h", "help"); insilmaril@0: options.add ("quit", SwitchOption, "q", "quit"); insilmaril@0: options.add ("test", StringOption, "t", "test"); insilmaril@0: options.setHelpText ( insilmaril@0: "VYM - View Your Mind\n" insilmaril@0: "--------------------\n\n" insilmaril@0: "Information about vym can be found in vym.pdf,\n" insilmaril@0: "which should be part of the vym package.\n" insilmaril@0: "It is also available at the project homepage:\n\n" insilmaril@0: "http://www.InSilmaril.de/vym\n"); insilmaril@0: if (options.parse()) insilmaril@0: { insilmaril@366: cout << endl << options.getHelpText().ascii()<setIcon (QPixmap (iconPath+"vym-editor.png")); insilmaril@0: if (textEditor->showWithMain()) textEditor->show(); insilmaril@0: insilmaril@166: // Initialize mainwindow insilmaril@0: Main m; insilmaril@0: //m.resize(m.sizeHint()); insilmaril@269: m.setIcon (QPixmap (iconPath+"vym-48x48.png")); insilmaril@0: m.show(); insilmaril@0: m.fileNew(); insilmaril@0: m.loadCmdLine(); insilmaril@0: insilmaril@0: // For benchmarking we may want to quit immediatly after drawing insilmaril@0: if (options.isOn ("quit")) insilmaril@0: { insilmaril@0: return 0; insilmaril@0: } insilmaril@0: insilmaril@0: QObject::connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) ); insilmaril@0: insilmaril@0: return app.exec(); insilmaril@0: } insilmaril@0: