X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmainapp%2Fmain.cpp;h=c205e292d476b6185f5244e0f50a5a32c8d03b4f;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=9e7bc7ef51464e7902e0b1f7786a461afd8b1771;hpb=3b479913b79032e514ce8c74ba915c6c91ab0f15;p=architektonas diff --git a/src/mainapp/main.cpp b/src/mainapp/main.cpp index 9e7bc7e..c205e29 100644 --- a/src/mainapp/main.cpp +++ b/src/mainapp/main.cpp @@ -3,7 +3,9 @@ // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software +// Portions copyright (C) 2001-2003 RibbonSoft +// Copyright (C) 2010 Underground Software +// See the README and GPLv2 files for licensing and warranty information // // JLH = James L. Hammons // @@ -22,27 +24,27 @@ QSplashScreen * splash = 0; -#ifdef RS_SCRIPTING +#ifdef SCRIPTING #include #endif -#include "rs_fontlist.h" -#include "rs_patternlist.h" -#include "rs_scriptlist.h" +#include "fontlist.h" +#include "patternlist.h" +#include "scriptlist.h" #include "settings.h" -#include "rs_system.h" -#include "rs_fileio.h" -#include "rs_filtercxf.h" -#include "rs_filterdxf.h" -#include "rs_filterdxf1.h" +#include "system.h" +#include "fileio.h" +#include "filtercxf.h" +#include "filterdxf.h" +#include "filterdxf1.h" #include "dlginitial.h" #include "applicationwindow.h" #ifdef RS_CAM -# include "rs_filtercam.h" -# include "rs_camdialog.h" +# include "filtercam.h" +# include "camdialog.h" #endif //#ifdef RS_CAM @@ -74,8 +76,8 @@ int main(int argc, char * argv[]) // Init compiled-in resources Q_INIT_RESOURCE(architektonas); - RS_DEBUG->setLevel(RS_Debug::D_WARNING); - RS_DEBUG->print("param 0: %s", argv[0]); + DEBUG->setLevel(Debug::D_WARNING); + DEBUG->print("param 0: %s", argv[0]); // avoid . / , confusion on German environments setlocale(LC_ALL, "C"); @@ -84,19 +86,19 @@ int main(int argc, char * argv[]) for(int i=0; isetLevel(RS_Debug::D_DEBUGGING); + DEBUG->setLevel(Debug::D_DEBUGGING); QFileInfo prgInfo(QFile::decodeName(argv[0])); QString prgDir(prgInfo.absolutePath()); -//fail RS_SYSTEM->init(QC_APPNAME, QC_VERSION, QC_APPDIR, prgDir); -// RS_SYSTEM->init("Architektonas", QC_VERSION, "qcad", prgDir); - RS_SYSTEM->init("Architektonas", QC_VERSION, "architektonas", prgDir); +//fail SYSTEM->init(QC_APPNAME, QC_VERSION, QC_APPDIR, prgDir); +// SYSTEM->init("Architektonas", QC_VERSION, "qcad", prgDir); + SYSTEM->init("Architektonas", QC_VERSION, "architektonas", prgDir); - RS_FILEIO->registerFilter(new RS_FilterCXF()); - RS_FILEIO->registerFilter(new RS_FilterDXF()); - RS_FILEIO->registerFilter(new RS_FilterDXF1()); + FILEIO->registerFilter(new FilterCXF()); + FILEIO->registerFilter(new FilterDXF()); + FILEIO->registerFilter(new FilterDXF1()); #ifdef RS_OPT_CAM - RS_FILEIO->registerFilter(new RS_FilterCAM()); + FILEIO->registerFilter(new FilterCAM()); #endif // parse command line arguments that might not need a launched program: @@ -117,7 +119,7 @@ int main(int argc, char * argv[]) // show initial config dialog: if (unit == "Invalid") { - RS_DEBUG->print("main: show initial config dialog.."); + DEBUG->print("main: show initial config dialog.."); DlgInitial di(NULL); di.setText("Welcome to Architektonas" "
" @@ -135,11 +137,11 @@ int main(int argc, char * argv[]) settings.endGroup(); } - RS_DEBUG->print("main: show initial config dialog: OK"); + DEBUG->print("main: show initial config dialog: OK"); } #ifdef QSPLASHSCREEN_H - RS_DEBUG->print("main: splashscreen.."); + DEBUG->print("main: splashscreen.."); //# ifdef QC_CUSTOM_SPLASH // QPixmap * pixmap = new QPixmap(qPixmapFromMimeSource(QC_CUSTOM_SPLASH)); @@ -154,23 +156,23 @@ int main(int argc, char * argv[]) splash->show(); splash->message(app.tr("Loading.."), Qt::AlignRight|Qt::AlignBottom, QC_SPLASH_TXTCOL); - RS_DEBUG->print("main: splashscreen: OK"); + DEBUG->print("main: splashscreen: OK"); */ #endif - RS_DEBUG->print("main: init fontlist.."); - RS_FONTLIST->init(); - RS_DEBUG->print("main: init fontlist: OK"); + DEBUG->print("main: init fontlist.."); + FONTLIST->init(); + DEBUG->print("main: init fontlist: OK"); - RS_DEBUG->print("main: init patternlist.."); - RS_PATTERNLIST->init(); - RS_DEBUG->print("main: init patternlist: OK"); + DEBUG->print("main: init patternlist.."); + PATTERNLIST->init(); + DEBUG->print("main: init patternlist: OK"); - RS_DEBUG->print("main: init scriptlist.."); - RS_SCRIPTLIST->init(); - RS_DEBUG->print("main: init scriptlist: OK"); + DEBUG->print("main: init scriptlist.."); + SCRIPTLIST->init(); + DEBUG->print("main: init scriptlist: OK"); - RS_DEBUG->print("main: loading translation.."); + DEBUG->print("main: loading translation.."); settings.beginGroup("Appearance"); #ifdef QC_PREDEFINED_LOCALE lang = settings.value("Language", "").toString(); @@ -194,15 +196,15 @@ int main(int argc, char * argv[]) #endif settings.endGroup(); - RS_SYSTEM->loadTranslation(lang, langCmd); - RS_DEBUG->print("main: loading translation: OK"); + SYSTEM->loadTranslation(lang, langCmd); + DEBUG->print("main: loading translation: OK"); #ifdef QSPLASHSCREEN_H splash = new QSplashScreen(*pixmap); splash->show(); // splash->message(QObject::tr("Loading.."), Qt::AlignRight | Qt::AlignBottom, QC_SPLASH_TXTCOL); splash->showMessage(QObject::tr("Loading..."), Qt::AlignRight | Qt::AlignBottom, QC_SPLASH_TXTCOL); - RS_DEBUG->print("main: splashscreen: OK"); + DEBUG->print("main: splashscreen: OK"); #endif //QApplication::setStyle(new QWindowsStyle()); @@ -212,35 +214,35 @@ int main(int argc, char * argv[]) #endif #ifdef QC_BUILTIN_STYLE //js: - RS_DEBUG->print("main: applying built in style.."); + DEBUG->print("main: applying built in style.."); applyBuiltinStyle(); #endif - RS_DEBUG->print("main: creating main window.."); + DEBUG->print("main: creating main window.."); ApplicationWindow * appWin = new ApplicationWindow(); - RS_DEBUG->print("main: setting caption"); + DEBUG->print("main: setting caption"); appWin->setWindowTitle("Architektonas"); - RS_DEBUG->print("main: show main window"); + DEBUG->print("main: show main window"); appWin->show(); - RS_DEBUG->print("main: set focus"); + DEBUG->print("main: set focus"); appWin->setFocus(); - RS_DEBUG->print("main: creating main window: OK"); + DEBUG->print("main: creating main window: OK"); #ifdef QSPLASHSCREEN_H if (splash) { - RS_DEBUG->print("main: updating splash.."); + DEBUG->print("main: updating splash.."); // splash->message(QObject::tr("Loading Library Paths.."), splash->showMessage(QObject::tr("Loading Library Paths.."), Qt::AlignRight | Qt::AlignBottom, QC_SPLASH_TXTCOL); - RS_DEBUG->print("main: processing events"); + DEBUG->print("main: processing events"); qApp->processEvents(); - RS_DEBUG->print("main: updating splash: OK"); + DEBUG->print("main: updating splash: OK"); } #endif // loading files: - RS_DEBUG->print("main: loading files.."); + DEBUG->print("main: loading files.."); bool files_loaded = false; for(QStringList::Iterator it=fileList.begin(); it!=fileList.end(); ++it) @@ -258,7 +260,7 @@ int main(int argc, char * argv[]) files_loaded = true; } - RS_DEBUG->print("main: loading files: OK"); + DEBUG->print("main: loading files: OK"); //none of this demo shit //#ifdef RS_DEMO @@ -283,7 +285,7 @@ int main(int argc, char * argv[]) //setlocale(LC_NUMERIC, "C"); setlocale(LC_ALL, "C"); - RS_DEBUG->print("main: app.exec()"); + DEBUG->print("main: app.exec()"); if (!files_loaded) appWin->slotFileNew(); @@ -294,7 +296,7 @@ int main(int argc, char * argv[]) delete appWin; - RS_DEBUG->print("main: finished"); + DEBUG->print("main: finished"); return r; } @@ -306,7 +308,7 @@ int main(int argc, char * argv[]) */ QStringList handleArgs(int argc, char * argv[]) { - RS_DEBUG->print("main: handling args.."); + DEBUG->print("main: handling args.."); QStringList ret; bool doexit = false; @@ -335,7 +337,7 @@ QStringList handleArgs(int argc, char * argv[]) machine = QString(argv[i]); else { - RS_DEBUG->print(RS_Debug::D_WARNING, "No machine configuration given after --convert. Aborting.."); + DEBUG->print(Debug::D_WARNING, "No machine configuration given after --convert. Aborting.."); exit(1); } @@ -345,7 +347,7 @@ QStringList handleArgs(int argc, char * argv[]) input = QString(argv[i]); else { - RS_DEBUG->print(RS_Debug::D_WARNING, "No input given after --convert. Aborting.."); + DEBUG->print(Debug::D_WARNING, "No input given after --convert. Aborting.."); exit(1); } @@ -355,7 +357,7 @@ QStringList handleArgs(int argc, char * argv[]) output = QString(argv[i]); else { - RS_DEBUG->print(RS_Debug::D_WARNING, "No output given after --convert. Aborting.."); + DEBUG->print(Debug::D_WARNING, "No output given after --convert. Aborting.."); exit(1); } } @@ -366,9 +368,9 @@ QStringList handleArgs(int argc, char * argv[]) // auto cam convert if (machine.isEmpty() == false && input.isEmpty() == false && output.isEmpty() == false) { - RS_FilterCAM fc; + FilterCAM fc; Drawing gr; - RS_FILEIO->fileImport(gr, input, RS2::FormatUnknown); + FILEIO->fileImport(gr, input, RS2::FormatUnknown); RS_CamDialog dlg(gr, NULL); dlg.activateMachineGenerator(machine); dlg.externalOK(); @@ -380,6 +382,6 @@ QStringList handleArgs(int argc, char * argv[]) if (doexit) exit(0); - RS_DEBUG->print("main: handling args: OK"); + DEBUG->print("main: handling args: OK"); return ret; }