Sun, 27 Jul 2014 03:14:27 +0300
- changed configuration entry name from minuscule camelCase to majuscule CamelCase. reasoning for this being that these variables are globals.
--- a/src/actions.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/actions.cc Sun Jul 27 03:14:27 2014 +0300 @@ -39,16 +39,16 @@ #include "ui_newpart.h" #include "editmodes/abstractEditMode.h" -EXTERN_CFGENTRY (Bool, drawWireframe); -EXTERN_CFGENTRY (Bool, bfcRedGreenView); -EXTERN_CFGENTRY (String, defaultName); -EXTERN_CFGENTRY (String, defaultUser); -EXTERN_CFGENTRY (Bool, UseCALicense); -EXTERN_CFGENTRY (Bool, drawAngles); -EXTERN_CFGENTRY (Bool, randomColors) -EXTERN_CFGENTRY (Bool, drawSurfaces) -EXTERN_CFGENTRY (Bool, drawEdgeLines) -EXTERN_CFGENTRY (Bool, drawConditionalLines) +EXTERN_CFGENTRY (Bool, DrawWireframe); +EXTERN_CFGENTRY (Bool, BfcRedGreenView); +EXTERN_CFGENTRY (String, DefaultName); +EXTERN_CFGENTRY (String, DefaultUser); +EXTERN_CFGENTRY (Bool, UseCALicense); +EXTERN_CFGENTRY (Bool, DrawAngles); +EXTERN_CFGENTRY (Bool, RandomColors) +EXTERN_CFGENTRY (Bool, DrawSurfaces) +EXTERN_CFGENTRY (Bool, DrawEdgeLines) +EXTERN_CFGENTRY (Bool, DrawConditionalLines) // ============================================================================= // @@ -58,10 +58,10 @@ Ui::NewPartUI ui; ui.setupUi (dlg); - QString authortext = cfg::defaultName; + QString authortext = cfg::DefaultName; - if (not cfg::defaultUser.isEmpty()) - authortext.append (format (" [%1]", cfg::defaultUser)); + if (not cfg::DefaultUser.isEmpty()) + authortext.append (format (" [%1]", cfg::DefaultUser)); ui.le_author->setText (authortext); ui.caLicense->setChecked (cfg::UseCALicense); @@ -344,19 +344,19 @@ // void MainWindow::slot_actionGridCoarse() { - cfg::grid = Grid::Coarse; + cfg::Grid = Grid::Coarse; updateGridToolBar(); } void MainWindow::slot_actionGridMedium() { - cfg::grid = Grid::Medium; + cfg::Grid = Grid::Medium; updateGridToolBar(); } void MainWindow::slot_actionGridFine() { - cfg::grid = Grid::Fine; + cfg::Grid = Grid::Fine; updateGridToolBar(); } @@ -495,10 +495,10 @@ // ============================================================================= // -EXTERN_CFGENTRY (Bool, drawAxes); +EXTERN_CFGENTRY (Bool, DrawAxes); void MainWindow::slot_actionAxes() { - cfg::drawAxes = not cfg::drawAxes; + cfg::DrawAxes = not cfg::DrawAxes; updateActions(); R()->update(); } @@ -536,7 +536,7 @@ // void MainWindow::slot_actionWireframe() { - cfg::drawWireframe = not cfg::drawWireframe; + cfg::DrawWireframe = not cfg::DrawWireframe; R()->refresh(); } @@ -599,7 +599,7 @@ // void MainWindow::slot_actionDrawAngles() { - cfg::drawAngles = not cfg::drawAngles; + cfg::DrawAngles = not cfg::DrawAngles; R()->refresh(); } @@ -679,10 +679,10 @@ // void MainWindow::slot_actionBFCView() { - cfg::bfcRedGreenView = not cfg::bfcRedGreenView; + cfg::BfcRedGreenView = not cfg::BfcRedGreenView; - if (cfg::bfcRedGreenView) - cfg::randomColors = false; + if (cfg::BfcRedGreenView) + cfg::RandomColors = false; updateActions(); R()->refresh(); @@ -834,7 +834,7 @@ LDObjectList objs; objs << spawn<LDComment> (subtitle); objs << spawn<LDComment> ("Name: "); // This gets filled in when the subfile is saved - objs << spawn<LDComment> (format ("Author: %1 [%2]", cfg::defaultName, cfg::defaultUser)); + objs << spawn<LDComment> (format ("Author: %1 [%2]", cfg::DefaultName, cfg::DefaultUser)); objs << spawn<LDComment> ("!LDRAW_ORG Unofficial_Subpart"); if (not license.isEmpty()) @@ -882,10 +882,10 @@ void MainWindow::slot_actionRandomColors() { - cfg::randomColors = not cfg::randomColors; + cfg::RandomColors = not cfg::RandomColors; - if (cfg::randomColors) - cfg::bfcRedGreenView = false; + if (cfg::RandomColors) + cfg::BfcRedGreenView = false; updateActions(); R()->refresh(); @@ -906,21 +906,21 @@ void MainWindow::slot_actionDrawSurfaces() { - cfg::drawSurfaces = not cfg::drawSurfaces; + cfg::DrawSurfaces = not cfg::DrawSurfaces; updateActions(); update(); } void MainWindow::slot_actionDrawEdgeLines() { - cfg::drawEdgeLines = not cfg::drawEdgeLines; + cfg::DrawEdgeLines = not cfg::DrawEdgeLines; updateActions(); update(); } void MainWindow::slot_actionDrawConditionalLines() { - cfg::drawConditionalLines = not cfg::drawConditionalLines; + cfg::DrawConditionalLines = not cfg::DrawConditionalLines; updateActions(); update(); }
--- a/src/actionsEdit.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/actionsEdit.cc Sun Jul 27 03:14:27 2014 +0300 @@ -36,11 +36,11 @@ #include "ui_flip.h" #include "ui_addhistoryline.h" -EXTERN_CFGENTRY (String, defaultUser) +EXTERN_CFGENTRY (String, DefaultUser) -CFGENTRY (Int, roundPosition, 3) -CFGENTRY (Int, roundMatrix, 4) -CFGENTRY (Int, splitLinesSegments, 5) +CFGENTRY (Int, RoundPosition, 3) +CFGENTRY (Int, RoundMatrix, 4) +CFGENTRY (Int, SplitLinesSegments, 5) // ============================================================================= // @@ -531,8 +531,8 @@ Matrix t = mo->transform(); // Note: matrix values are to be rounded to 4 decimals. - v.apply ([](Axis, double& a) { roundToDecimals (a, cfg::roundPosition); }); - applyToMatrix (t, [](int, double& a) { roundToDecimals (a, cfg::roundMatrix); }); + v.apply ([](Axis, double& a) { roundToDecimals (a, cfg::RoundPosition); }); + applyToMatrix (t, [](int, double& a) { roundToDecimals (a, cfg::RoundMatrix); }); mo->setPosition (v); mo->setTransform (t); @@ -543,7 +543,7 @@ for (int i = 0; i < obj->numVertices(); ++i) { Vertex v = obj->vertex (i); - v.apply ([](Axis, double& a) { roundToDecimals (a, cfg::roundPosition); }); + v.apply ([](Axis, double& a) { roundToDecimals (a, cfg::RoundPosition); }); obj->setVertex (i, v); num += 3; } @@ -734,7 +734,7 @@ QDialog* dlg = new QDialog; Ui_AddHistoryLine* ui = new Ui_AddHistoryLine; ui->setupUi (dlg); - ui->m_username->setText (cfg::defaultUser); + ui->m_username->setText (cfg::DefaultUser); ui->m_date->setDate (QDate::currentDate()); ui->m_comment->setFocus(); @@ -784,13 +784,13 @@ void MainWindow::slot_actionSplitLines() { bool ok; - int segments = QInputDialog::getInt (g_win, APPNAME, "Amount of segments:", cfg::splitLinesSegments, 0, + int segments = QInputDialog::getInt (g_win, APPNAME, "Amount of segments:", cfg::SplitLinesSegments, 0, std::numeric_limits<int>::max(), 1, &ok); if (not ok) return; - cfg::splitLinesSegments = segments; + cfg::SplitLinesSegments = segments; for (LDObjectPtr obj : selection()) {
--- a/src/colorSelector.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/colorSelector.cc Sun Jul 27 03:14:27 2014 +0300 @@ -35,8 +35,8 @@ static const int g_numColumns = 16; static const int g_squareSize = 32; -EXTERN_CFGENTRY (String, mainColor); -EXTERN_CFGENTRY (Float, mainColorAlpha); +EXTERN_CFGENTRY (String, MainColor); +EXTERN_CFGENTRY (Float, MainColorAlpha); // ============================================================================= // @@ -109,8 +109,8 @@ if (i == mainColorIndex) { // Use the user preferences for main color here - col = QColor (cfg::mainColor); - col.setAlpha (cfg::mainColorAlpha * 255.0f); + col = QColor (cfg::MainColor); + col.setAlpha (cfg::MainColorAlpha * 255.0f); } QPen pen (info.edgeColor(), penWidth, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
--- a/src/configDialog.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/configDialog.cc Sun Jul 27 03:14:27 2014 +0300 @@ -39,46 +39,46 @@ #include "glRenderer.h" #include "ui_config.h" -EXTERN_CFGENTRY (String, backgroundColor); -EXTERN_CFGENTRY (String, mainColor); -EXTERN_CFGENTRY (Bool, colorizeObjectsList); -EXTERN_CFGENTRY (Bool, bfcRedGreenView); -EXTERN_CFGENTRY (Float, mainColorAlpha); -EXTERN_CFGENTRY (Int, lineThickness); -EXTERN_CFGENTRY (String, quickColorToolbar); -EXTERN_CFGENTRY (Bool, blackEdges); -EXTERN_CFGENTRY (Bool, antiAliasedLines); -EXTERN_CFGENTRY (Bool, listImplicitFiles); -EXTERN_CFGENTRY (String, downloadFilePath); -EXTERN_CFGENTRY (Bool, guessDownloadPaths); -EXTERN_CFGENTRY (Bool, autoCloseDownloadDialog); -EXTERN_CFGENTRY (Bool, useLogoStuds); -EXTERN_CFGENTRY (Bool, drawLineLengths); -EXTERN_CFGENTRY (String, defaultName); -EXTERN_CFGENTRY (String, defaultUser); +EXTERN_CFGENTRY (String, BackgroundColor); +EXTERN_CFGENTRY (String, MainColor); +EXTERN_CFGENTRY (Bool, ColorizeObjectsList); +EXTERN_CFGENTRY (Bool, BfcRedGreenView); +EXTERN_CFGENTRY (Float, MainColorAlpha); +EXTERN_CFGENTRY (Int, LineThickness); +EXTERN_CFGENTRY (String, QuickColorToolbar); +EXTERN_CFGENTRY (Bool, BlackEdges); +EXTERN_CFGENTRY (Bool, AntiAliasedLines); +EXTERN_CFGENTRY (Bool, ListImplicitFiles); +EXTERN_CFGENTRY (String, DownloadFilePath); +EXTERN_CFGENTRY (Bool, GuessDownloadPaths); +EXTERN_CFGENTRY (Bool, AutoCloseDownloadDialog); +EXTERN_CFGENTRY (Bool, UseLogoStuds); +EXTERN_CFGENTRY (Bool, DrawLineLengths); +EXTERN_CFGENTRY (String, DefaultName); +EXTERN_CFGENTRY (String, DefaultUser); EXTERN_CFGENTRY (Bool, UseCALicense); -EXTERN_CFGENTRY (String, selectColorBlend); -EXTERN_CFGENTRY (String, ytruderPath); -EXTERN_CFGENTRY (String, rectifierPath); -EXTERN_CFGENTRY (String, intersectorPath); -EXTERN_CFGENTRY (String, covererPath); -EXTERN_CFGENTRY (String, isecalcPath); -EXTERN_CFGENTRY (String, edger2Path); -EXTERN_CFGENTRY (Bool, ytruderUsesWine); -EXTERN_CFGENTRY (Bool, rectifierUsesWine); -EXTERN_CFGENTRY (Bool, intersectorUsesWine); -EXTERN_CFGENTRY (Bool, covererUsesWine); -EXTERN_CFGENTRY (Bool, isecalcUsesWine); -EXTERN_CFGENTRY (Bool, edger2UsesWine); -EXTERN_CFGENTRY (Float, gridCoarseCoordinateSnap); -EXTERN_CFGENTRY (Float, gridCoarseAngleSnap); -EXTERN_CFGENTRY (Float, gridMediumCoordinateSnap); -EXTERN_CFGENTRY (Float, gridMediumAngleSnap); -EXTERN_CFGENTRY (Float, gridFineCoordinateSnap); -EXTERN_CFGENTRY (Float, gridFineAngleSnap); -EXTERN_CFGENTRY (Bool, highlightObjectBelowCursor) -EXTERN_CFGENTRY (Int, roundPosition) -EXTERN_CFGENTRY (Int, roundMatrix) +EXTERN_CFGENTRY (String, SelectColorBlend); +EXTERN_CFGENTRY (String, YtruderPath); +EXTERN_CFGENTRY (String, RectifierPath); +EXTERN_CFGENTRY (String, IntersectorPath); +EXTERN_CFGENTRY (String, CovererPath); +EXTERN_CFGENTRY (String, IsecalcPath); +EXTERN_CFGENTRY (String, Edger2Path); +EXTERN_CFGENTRY (Bool, YtruderUsesWine); +EXTERN_CFGENTRY (Bool, RectifierUsesWine); +EXTERN_CFGENTRY (Bool, IntersectorUsesWine); +EXTERN_CFGENTRY (Bool, CovererUsesWine); +EXTERN_CFGENTRY (Bool, IsecalcUsesWine); +EXTERN_CFGENTRY (Bool, Edger2UsesWine); +EXTERN_CFGENTRY (Float, GridCoarseCoordinateSnap); +EXTERN_CFGENTRY (Float, GridCoarseAngleSnap); +EXTERN_CFGENTRY (Float, GridMediumCoordinateSnap); +EXTERN_CFGENTRY (Float, GridMediumAngleSnap); +EXTERN_CFGENTRY (Float, GridFineCoordinateSnap); +EXTERN_CFGENTRY (Float, GridFineAngleSnap); +EXTERN_CFGENTRY (Bool, HighlightObjectBelowCursor) +EXTERN_CFGENTRY (Int, RoundPosition) +EXTERN_CFGENTRY (Int, RoundMatrix) const char* g_extProgPathFilter = #ifdef _WIN32 @@ -100,9 +100,10 @@ } g_LDExtProgInfo[] = { #ifndef _WIN32 -# define EXTPROG(NAME, LOWNAME) { #NAME, #LOWNAME, &cfg::LOWNAME##Path, null, null, &cfg::LOWNAME##UsesWine, null }, +# define EXTPROG(NAME, LOWNAME) { #NAME, #LOWNAME, &cfg::NAME##Path, null, null, \ + &cfg::NAME##UsesWine, null }, #else -# define EXTPROG(NAME, LOWNAME) { #NAME, #LOWNAME, &cfg::LOWNAME##Path, null, null, null, null }, +# define EXTPROG(NAME, LOWNAME) { #NAME, #LOWNAME, &cfg::NAME##Path, null, null, null, null }, #endif EXTPROG (Ytruder, ytruder) EXTPROG (Rectifier, rectifier) @@ -123,30 +124,30 @@ ui->setupUi (this); // Interface tab - setButtonBackground (ui->backgroundColorButton, cfg::backgroundColor); + setButtonBackground (ui->backgroundColorButton, cfg::BackgroundColor); connect (ui->backgroundColorButton, SIGNAL (clicked()), this, SLOT (slot_setGLBackground())); - setButtonBackground (ui->mainColorButton, cfg::mainColor); + setButtonBackground (ui->mainColorButton, cfg::MainColor); connect (ui->mainColorButton, SIGNAL (clicked()), this, SLOT (slot_setGLForeground())); - setButtonBackground (ui->selColorButton, cfg::selectColorBlend); + setButtonBackground (ui->selColorButton, cfg::SelectColorBlend); connect (ui->selColorButton, SIGNAL (clicked()), this, SLOT (slot_setGLSelectColor())); - ui->mainColorAlpha->setValue (cfg::mainColorAlpha * 10.0f); - ui->lineThickness->setValue (cfg::lineThickness); - ui->colorizeObjects->setChecked (cfg::colorizeObjectsList); - ui->colorBFC->setChecked (cfg::bfcRedGreenView); - ui->blackEdges->setChecked (cfg::blackEdges); - ui->m_aa->setChecked (cfg::antiAliasedLines); - ui->implicitFiles->setChecked (cfg::listImplicitFiles); - ui->m_logostuds->setChecked (cfg::useLogoStuds); - ui->linelengths->setChecked (cfg::drawLineLengths); + ui->mainColorAlpha->setValue (cfg::MainColorAlpha * 10.0f); + ui->lineThickness->setValue (cfg::LineThickness); + ui->colorizeObjects->setChecked (cfg::ColorizeObjectsList); + ui->colorBFC->setChecked (cfg::BfcRedGreenView); + ui->blackEdges->setChecked (cfg::BlackEdges); + ui->m_aa->setChecked (cfg::AntiAliasedLines); + ui->implicitFiles->setChecked (cfg::ListImplicitFiles); + ui->m_logostuds->setChecked (cfg::UseLogoStuds); + ui->linelengths->setChecked (cfg::DrawLineLengths); - ui->roundPosition->setValue (cfg::roundPosition); - ui->roundMatrix->setValue (cfg::roundMatrix); + ui->roundPosition->setValue (cfg::RoundPosition); + ui->roundMatrix->setValue (cfg::RoundMatrix); g_win->applyToActions ([&](QAction* act) { @@ -171,21 +172,21 @@ connect (ui->quickColor_moveDown, SIGNAL (clicked()), this, SLOT (slot_moveColor())); connect (ui->quickColor_clear, SIGNAL (clicked()), this, SLOT (slot_clearColors())); - ui->downloadPath->setText (cfg::downloadFilePath); - ui->guessNetPaths->setChecked (cfg::guessDownloadPaths); - ui->autoCloseNetPrompt->setChecked (cfg::autoCloseDownloadDialog); + ui->downloadPath->setText (cfg::DownloadFilePath); + ui->guessNetPaths->setChecked (cfg::GuessDownloadPaths); + ui->autoCloseNetPrompt->setChecked (cfg::AutoCloseDownloadDialog); connect (ui->findDownloadPath, SIGNAL (clicked (bool)), this, SLOT (slot_findDownloadFolder())); - ui->m_profileName->setText (cfg::defaultName); - ui->m_profileUsername->setText (cfg::defaultUser); + ui->m_profileName->setText (cfg::DefaultName); + ui->m_profileUsername->setText (cfg::DefaultUser); ui->UseCALicense->setChecked (cfg::UseCALicense); - ui->gridCoarseCoordinateSnap->setValue (cfg::gridCoarseCoordinateSnap); - ui->gridCoarseAngleSnap->setValue (cfg::gridCoarseAngleSnap); - ui->gridMediumCoordinateSnap->setValue (cfg::gridMediumCoordinateSnap); - ui->gridMediumAngleSnap->setValue (cfg::gridMediumAngleSnap); - ui->gridFineCoordinateSnap->setValue (cfg::gridFineCoordinateSnap); - ui->gridFineAngleSnap->setValue (cfg::gridFineAngleSnap); - ui->highlightObjectBelowCursor->setChecked (cfg::highlightObjectBelowCursor); + ui->gridCoarseCoordinateSnap->setValue (cfg::GridCoarseCoordinateSnap); + ui->gridCoarseAngleSnap->setValue (cfg::GridCoarseAngleSnap); + ui->gridMediumCoordinateSnap->setValue (cfg::GridMediumCoordinateSnap); + ui->gridMediumAngleSnap->setValue (cfg::GridMediumAngleSnap); + ui->gridFineCoordinateSnap->setValue (cfg::GridFineCoordinateSnap); + ui->gridFineAngleSnap->setValue (cfg::GridFineAngleSnap); + ui->highlightObjectBelowCursor->setChecked (cfg::HighlightObjectBelowCursor); initExtProgs(); selectPage (deftab); @@ -282,36 +283,36 @@ void ConfigDialog::applySettings() { // Apply configuration - cfg::colorizeObjectsList = ui->colorizeObjects->isChecked(); - cfg::bfcRedGreenView = ui->colorBFC->isChecked(); - cfg::blackEdges = ui->blackEdges->isChecked(); - cfg::mainColorAlpha = ((double) ui->mainColorAlpha->value()) / 10.0; - cfg::lineThickness = ui->lineThickness->value(); - cfg::listImplicitFiles = ui->implicitFiles->isChecked(); - cfg::downloadFilePath = ui->downloadPath->text(); - cfg::guessDownloadPaths = ui->guessNetPaths->isChecked(); - cfg::autoCloseDownloadDialog = ui->autoCloseNetPrompt->isChecked(); - cfg::useLogoStuds = ui->m_logostuds->isChecked(); - cfg::drawLineLengths = ui->linelengths->isChecked(); - cfg::defaultUser = ui->m_profileUsername->text(); - cfg::defaultName = ui->m_profileName->text(); + cfg::ColorizeObjectsList = ui->colorizeObjects->isChecked(); + cfg::BfcRedGreenView = ui->colorBFC->isChecked(); + cfg::BlackEdges = ui->blackEdges->isChecked(); + cfg::MainColorAlpha = ((double) ui->mainColorAlpha->value()) / 10.0; + cfg::LineThickness = ui->lineThickness->value(); + cfg::ListImplicitFiles = ui->implicitFiles->isChecked(); + cfg::DownloadFilePath = ui->downloadPath->text(); + cfg::GuessDownloadPaths = ui->guessNetPaths->isChecked(); + cfg::AutoCloseDownloadDialog = ui->autoCloseNetPrompt->isChecked(); + cfg::UseLogoStuds = ui->m_logostuds->isChecked(); + cfg::DrawLineLengths = ui->linelengths->isChecked(); + cfg::DefaultUser = ui->m_profileUsername->text(); + cfg::DefaultName = ui->m_profileName->text(); cfg::UseCALicense = ui->UseCALicense->isChecked(); - cfg::antiAliasedLines = ui->m_aa->isChecked(); - cfg::highlightObjectBelowCursor = ui->highlightObjectBelowCursor->isChecked(); - cfg::roundPosition = ui->roundPosition->value(); - cfg::roundMatrix = ui->roundMatrix->value(); + cfg::AntiAliasedLines = ui->m_aa->isChecked(); + cfg::HighlightObjectBelowCursor = ui->highlightObjectBelowCursor->isChecked(); + cfg::RoundPosition = ui->roundPosition->value(); + cfg::RoundMatrix = ui->roundMatrix->value(); // Rebuild the quick color toolbar g_win->setQuickColors (quickColors); - cfg::quickColorToolbar = quickColorString(); + cfg::QuickColorToolbar = quickColorString(); // Set the grid settings - cfg::gridCoarseCoordinateSnap = ui->gridCoarseCoordinateSnap->value(); - cfg::gridCoarseAngleSnap = ui->gridCoarseAngleSnap->value(); - cfg::gridMediumCoordinateSnap = ui->gridMediumCoordinateSnap->value(); - cfg::gridMediumAngleSnap = ui->gridMediumAngleSnap->value(); - cfg::gridFineCoordinateSnap = ui->gridFineCoordinateSnap->value(); - cfg::gridFineAngleSnap = ui->gridFineAngleSnap->value(); + cfg::GridCoarseCoordinateSnap = ui->gridCoarseCoordinateSnap->value(); + cfg::GridCoarseAngleSnap = ui->gridCoarseAngleSnap->value(); + cfg::GridMediumCoordinateSnap = ui->gridMediumCoordinateSnap->value(); + cfg::GridMediumAngleSnap = ui->gridMediumAngleSnap->value(); + cfg::GridFineCoordinateSnap = ui->gridFineCoordinateSnap->value(); + cfg::GridFineAngleSnap = ui->gridFineAngleSnap->value(); // Ext program settings for (const LDExtProgInfo& info : g_LDExtProgInfo) @@ -532,21 +533,21 @@ // void ConfigDialog::slot_setGLBackground() { - pickColor (cfg::backgroundColor, ui->backgroundColorButton); + pickColor (cfg::BackgroundColor, ui->backgroundColorButton); } // // void ConfigDialog::slot_setGLForeground() { - pickColor (cfg::mainColor, ui->mainColorButton); + pickColor (cfg::MainColor, ui->mainColorButton); } // // void ConfigDialog::slot_setGLSelectColor() { - pickColor (cfg::selectColorBlend, ui->selColorButton); + pickColor (cfg::SelectColorBlend, ui->selColorButton); } //
--- a/src/dialogs.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/dialogs.cc Sun Jul 27 03:14:27 2014 +0300 @@ -45,7 +45,7 @@ #include "ui_bombbox.h" extern const char* g_extProgPathFilter; -EXTERN_CFGENTRY (String, ldrawPath); +EXTERN_CFGENTRY (String, LDrawPath); // ============================================================================= // ============================================================================= @@ -183,7 +183,7 @@ connect (ui->buttonBox, SIGNAL (rejected()), this, validDefault ? SLOT (reject()) : SLOT (slot_exit())); connect (ui->buttonBox, SIGNAL (accepted()), this, SLOT (slot_accept())); - setPath (cfg::ldrawPath); + setPath (cfg::LDrawPath); if (validDefault) slot_tryConfigure();
--- a/src/editmodes/abstractEditMode.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/editmodes/abstractEditMode.cc Sun Jul 27 03:14:27 2014 +0300 @@ -27,8 +27,8 @@ #include "../mainWindow.h" #include "../glRenderer.h" -CFGENTRY (Bool, drawLineLengths, true) -CFGENTRY (Bool, drawAngles, false) +CFGENTRY (Bool, DrawLineLengths, true) +CFGENTRY (Bool, DrawAngles, false) AbstractEditMode::AbstractEditMode (GLRenderer* renderer) : _renderer (renderer) {} @@ -209,14 +209,14 @@ const int j = (i + 1) % poly3d.size(); const int h = (i - 1 >= 0) ? (i - 1) : (poly3d.size() - 1); - if (cfg::drawLineLengths) + if (cfg::DrawLineLengths) { const QString label = QString::number ((poly3d[j] - poly3d[i]).length()); QPoint origin = QLineF (poly[i], poly[j]).pointAt (0.5).toPoint(); painter.drawText (origin, label); } - if (withangles and cfg::drawAngles) + if (withangles and cfg::DrawAngles) { QLineF l0 (poly[h], poly[i]), l1 (poly[i], poly[j]);
--- a/src/extPrograms.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/extPrograms.cc Sun Jul 27 03:14:27 2014 +0300 @@ -51,39 +51,39 @@ // ============================================================================= // -CFGENTRY (String, isecalcPath, ""); -CFGENTRY (String, intersectorPath, ""); -CFGENTRY (String, covererPath, ""); -CFGENTRY (String, ytruderPath, ""); -CFGENTRY (String, rectifierPath, ""); -CFGENTRY (String, edger2Path, ""); +CFGENTRY (String, IsecalcPath, ""); +CFGENTRY (String, IntersectorPath, ""); +CFGENTRY (String, CovererPath, ""); +CFGENTRY (String, YtruderPath, ""); +CFGENTRY (String, RectifierPath, ""); +CFGENTRY (String, Edger2Path, ""); QString* const g_extProgPaths[] = { - &cfg::isecalcPath, - &cfg::intersectorPath, - &cfg::covererPath, - &cfg::ytruderPath, - &cfg::rectifierPath, - &cfg::edger2Path, + &cfg::IsecalcPath, + &cfg::IntersectorPath, + &cfg::CovererPath, + &cfg::YtruderPath, + &cfg::RectifierPath, + &cfg::Edger2Path, }; #ifndef _WIN32 -CFGENTRY (Bool, isecalcUsesWine, false); -CFGENTRY (Bool, intersectorUsesWine, false); -CFGENTRY (Bool, covererUsesWine, false); -CFGENTRY (Bool, ytruderUsesWine, false); -CFGENTRY (Bool, rectifierUsesWine, false); -CFGENTRY (Bool, edger2UsesWine, false); +CFGENTRY (Bool, IsecalcUsesWine, false); +CFGENTRY (Bool, IntersectorUsesWine, false); +CFGENTRY (Bool, CovererUsesWine, false); +CFGENTRY (Bool, YtruderUsesWine, false); +CFGENTRY (Bool, RectifierUsesWine, false); +CFGENTRY (Bool, Edger2UsesWine, false); bool* const g_extProgWine[] = { - &cfg::isecalcUsesWine, - &cfg::intersectorUsesWine, - &cfg::covererUsesWine, - &cfg::ytruderUsesWine, - &cfg::rectifierUsesWine, - &cfg::edger2UsesWine, + &cfg::IsecalcUsesWine, + &cfg::IntersectorUsesWine, + &cfg::CovererUsesWine, + &cfg::YtruderUsesWine, + &cfg::RectifierUsesWine, + &cfg::Edger2UsesWine, }; #endif // _WIN32 @@ -381,7 +381,7 @@ writeSelection (inDATName); - if (not runUtilityProcess (Ytruder, cfg::ytruderPath, argv)) + if (not runUtilityProcess (Ytruder, cfg::YtruderPath, argv)) return; insertOutput (outDATName, false, {}); @@ -426,7 +426,7 @@ writeSelection (inDATName); - if (not runUtilityProcess (Rectifier, cfg::rectifierPath, argv)) + if (not runUtilityProcess (Rectifier, cfg::RectifierPath, argv)) return; insertOutput (outDATName, true, {}); @@ -517,16 +517,16 @@ writeColorGroup (inCol, inDATName); writeColorGroup (cutCol, cutDATName); - if (not runUtilityProcess (Intersector, cfg::intersectorPath, argv_normal)) + if (not runUtilityProcess (Intersector, cfg::IntersectorPath, argv_normal)) return; insertOutput (outDATName, false, {inCol}); - if (repeatInverse and runUtilityProcess (Intersector, cfg::intersectorPath, argv_inverse)) + if (repeatInverse and runUtilityProcess (Intersector, cfg::IntersectorPath, argv_inverse)) insertOutput (outDAT2Name, false, {cutCol}); if (ui.cb_edges->isChecked() and checkProgPath (Isecalc) and - runUtilityProcess (Isecalc, cfg::isecalcPath, join ( {inDATName, cutDATName, edgesDATName}))) + runUtilityProcess (Isecalc, cfg::IsecalcPath, join ( {inDATName, cutDATName, edgesDATName}))) { insertOutput (edgesDATName, false, {}); } @@ -590,7 +590,7 @@ writeColorGroup (in1Col, in1DATName); writeColorGroup (in2Col, in2DATName); - if (not runUtilityProcess (Coverer, cfg::covererPath, argv)) + if (not runUtilityProcess (Coverer, cfg::CovererPath, argv)) return; insertOutput (outDATName, false, {}); @@ -651,7 +651,7 @@ writeColorGroup (in1Col, in1DATName); writeColorGroup (in2Col, in2DATName); - runUtilityProcess (Isecalc, cfg::isecalcPath, argv); + runUtilityProcess (Isecalc, cfg::IsecalcPath, argv); insertOutput (outDATName, false, {}); } @@ -698,7 +698,7 @@ writeSelection (inName); - if (not runUtilityProcess (Edger2, cfg::edger2Path, argv)) + if (not runUtilityProcess (Edger2, cfg::Edger2Path, argv)) return; insertOutput (outName, true, {});
--- a/src/glCompiler.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/glCompiler.cc Sun Jul 27 03:14:27 2014 +0300 @@ -45,9 +45,9 @@ { GL_STACK_OVERFLOW, "The operation would have caused an overflow" }, }; -CFGENTRY (String, selectColorBlend, "#0080FF") -EXTERN_CFGENTRY (Bool, blackEdges); -EXTERN_CFGENTRY (String, backgroundColor); +CFGENTRY (String, SelectColorBlend, "#0080FF") +EXTERN_CFGENTRY (Bool, BlackEdges); +EXTERN_CFGENTRY (String, BackgroundColor); static QList<int> g_warnedColors; static const QColor g_BFCFrontColor (64, 192, 80); @@ -164,7 +164,7 @@ } elif (poly.color == edgeColorIndex) { - qcol = luma (QColor (cfg::backgroundColor)) > 40 ? Qt::black : Qt::white; + qcol = luma (QColor (cfg::BackgroundColor)) > 40 ? Qt::black : Qt::white; } else { @@ -204,7 +204,7 @@ if (blendAlpha != 0.0) { - QColor selcolor (cfg::selectColorBlend); + QColor selcolor (cfg::SelectColorBlend); double denom = blendAlpha + 1.0; qcol.setRed ((qcol.red() + (selcolor.red() * blendAlpha)) / denom); qcol.setGreen ((qcol.green() + (selcolor.green() * blendAlpha)) / denom);
--- a/src/glRenderer.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/glRenderer.cc Sun Jul 27 03:14:27 2014 +0300 @@ -52,22 +52,22 @@ {{ 0, -1, 0 }, Z, Y, false, true, true }, // right }; -CFGENTRY (String, backgroundColor, "#FFFFFF") -CFGENTRY (String, mainColor, "#A0A0A0") -CFGENTRY (Float, mainColorAlpha, 1.0) -CFGENTRY (Int, lineThickness, 2) -CFGENTRY (Bool, bfcRedGreenView, false) -CFGENTRY (Int, camera, EFreeCamera) -CFGENTRY (Bool, blackEdges, false) -CFGENTRY (Bool, drawAxes, false) -CFGENTRY (Bool, drawWireframe, false) -CFGENTRY (Bool, useLogoStuds, false) -CFGENTRY (Bool, antiAliasedLines, true) -CFGENTRY (Bool, randomColors, false) -CFGENTRY (Bool, highlightObjectBelowCursor, true) -CFGENTRY (Bool, drawSurfaces, true) -CFGENTRY (Bool, drawEdgeLines, true) -CFGENTRY (Bool, drawConditionalLines, true) +CFGENTRY (String, BackgroundColor, "#FFFFFF") +CFGENTRY (String, MainColor, "#A0A0A0") +CFGENTRY (Float, MainColorAlpha, 1.0) +CFGENTRY (Int, LineThickness, 2) +CFGENTRY (Bool, BfcRedGreenView, false) +CFGENTRY (Int, Camera, EFreeCamera) +CFGENTRY (Bool, BlackEdges, false) +CFGENTRY (Bool, DrawAxes, false) +CFGENTRY (Bool, DrawWireframe, false) +CFGENTRY (Bool, UseLogoStuds, false) +CFGENTRY (Bool, AntiAliasedLines, true) +CFGENTRY (Bool, RandomColors, false) +CFGENTRY (Bool, HighlightObjectBelowCursor, true) +CFGENTRY (Bool, DrawSurfaces, true) +CFGENTRY (Bool, DrawEdgeLines, true) +CFGENTRY (Bool, DrawConditionalLines, true) // argh const char* g_CameraNames[7] = @@ -103,7 +103,7 @@ GLRenderer::GLRenderer (QWidget* parent) : QGLWidget (parent) { m_isPicking = false; - m_camera = (ECamera) cfg::camera; + m_camera = (ECamera) cfg::Camera; m_drawToolTip = false; m_editmode = AbstractEditMode::createByType (this, EditModeType::Select); m_panning = false; @@ -186,7 +186,7 @@ glShadeModel (GL_SMOOTH); glEnable (GL_MULTISAMPLE); - if (cfg::antiAliasedLines) + if (cfg::AntiAliasedLines) { glEnable (GL_LINE_SMOOTH); glEnable (GL_POLYGON_SMOOTH); @@ -237,7 +237,7 @@ void GLRenderer::initializeGL() { setBackground(); - glLineWidth (cfg::lineThickness); + glLineWidth (cfg::LineThickness); glLineStipple (1, 0x6666); setAutoFillBackground (false); setMouseTracking (true); @@ -283,12 +283,12 @@ // QColor GLRenderer::getMainColor() { - QColor col (cfg::mainColor); + QColor col (cfg::MainColor); if (not col.isValid()) return QColor (0, 0, 0); - col.setAlpha (cfg::mainColorAlpha * 255.f); + col.setAlpha (cfg::MainColorAlpha * 255.f); return col; } @@ -302,7 +302,7 @@ return; } - QColor col (cfg::backgroundColor); + QColor col (cfg::BackgroundColor); if (not col.isValid()) return; @@ -328,7 +328,7 @@ { compiler()->compileDocument (getCurrentDocument()); refresh(); - glLineWidth (cfg::lineThickness); // TODO: ...? + glLineWidth (cfg::LineThickness); // TODO: ...? } // ============================================================================= @@ -360,7 +360,7 @@ zoomAllToFit(); } - if (cfg::drawWireframe and not isPicking()) + if (cfg::DrawWireframe and not isPicking()) glPolygonMode (GL_FRONT_AND_BACK, GL_LINE); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -414,7 +414,7 @@ } else { - if (cfg::bfcRedGreenView) + if (cfg::BfcRedGreenView) { glEnable (GL_CULL_FACE); glCullFace (GL_BACK); @@ -427,7 +427,7 @@ } else { - if (cfg::randomColors) + if (cfg::RandomColors) { drawVBOs (VBOSF_Triangles, VBOCM_RandomColors, GL_TRIANGLES); drawVBOs (VBOSF_Quads, VBOCM_RandomColors, GL_QUADS); @@ -444,7 +444,7 @@ drawVBOs (VBOSF_CondLines, VBOCM_NormalColors, GL_LINES); glDisable (GL_LINE_STIPPLE); - if (cfg::drawAxes) + if (cfg::DrawAxes) { glBindBuffer (GL_ARRAY_BUFFER, g_GLAxes_VBO); glVertexPointer (3, GL_FLOAT, 0, NULL); @@ -470,9 +470,9 @@ void GLRenderer::drawVBOs (EVBOSurface surface, EVBOComplement colors, GLenum type) { // Filter this through some configuration options - if ((eq (surface, VBOSF_Quads, VBOSF_Triangles) and cfg::drawSurfaces == false) or - (surface == VBOSF_Lines and cfg::drawEdgeLines == false) or - (surface == VBOSF_CondLines and cfg::drawConditionalLines == false)) + if ((eq (surface, VBOSF_Quads, VBOSF_Triangles) and cfg::DrawSurfaces == false) or + (surface == VBOSF_Lines and cfg::DrawEdgeLines == false) or + (surface == VBOSF_CondLines and cfg::DrawConditionalLines == false)) { return; } @@ -876,7 +876,7 @@ return; m_camera = cam; - cfg::camera = (int) cam; + cfg::Camera = (int) cam; g_win->updateEditModeActions(); } @@ -1056,14 +1056,14 @@ glDisable (GL_DITHER); // Use particularly thick lines while picking ease up selecting lines. - glLineWidth (max<double> (cfg::lineThickness, 6.5)); + glLineWidth (max<double> (cfg::LineThickness, 6.5)); } else { glEnable (GL_DITHER); // Restore line thickness - glLineWidth (cfg::lineThickness); + glLineWidth (cfg::LineThickness); } } @@ -1528,14 +1528,14 @@ // void GLRenderer::highlightCursorObject() { - if (not cfg::highlightObjectBelowCursor and objectAtCursor() == null) + if (not cfg::HighlightObjectBelowCursor and objectAtCursor() == null) return; LDObjectWeakPtr newObject; LDObjectWeakPtr oldObject = objectAtCursor(); qint32 newIndex; - if (isCameraMoving() or not cfg::highlightObjectBelowCursor) + if (isCameraMoving() or not cfg::HighlightObjectBelowCursor) { newIndex = 0; }
--- a/src/ldDocument.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/ldDocument.cc Sun Jul 27 03:14:27 2014 +0300 @@ -32,10 +32,10 @@ #include "glRenderer.h" #include "glCompiler.h" -CFGENTRY (String, ldrawPath, "") -CFGENTRY (List, recentFiles, {}) -EXTERN_CFGENTRY (String, downloadFilePath) -EXTERN_CFGENTRY (Bool, useLogoStuds) +CFGENTRY (String, LDrawPath, "") +CFGENTRY (List, RecentFiles, {}) +EXTERN_CFGENTRY (String, DownloadFilePath) +EXTERN_CFGENTRY (Bool, UseLogoStuds) static bool g_loadingMainFile = false; static const int g_maxRecentFiles = 10; @@ -62,14 +62,14 @@ void initPaths() { - if (not tryConfigure (cfg::ldrawPath)) + if (not tryConfigure (cfg::LDrawPath)) { LDrawPathDialog dlg (false); if (not dlg.exec()) exit (0); - cfg::ldrawPath = dlg.filename(); + cfg::LDrawPath = dlg.filename(); } } @@ -311,7 +311,7 @@ return relpath; // Try with just the LDraw path first - fullPath = format ("%1" DIRSLASH "%2", cfg::ldrawPath, relpath); + fullPath = format ("%1" DIRSLASH "%2", cfg::LDrawPath, relpath); if (QFile::exists (fullPath)) return fullPath; @@ -320,7 +320,7 @@ { // Look in sub-directories: parts and p. Also look in net_downloadpath, since that's // where we download parts from the PT to. - for (const QString& topdir : QList<QString> ({ cfg::ldrawPath, cfg::downloadFilePath })) + for (const QString& topdir : QList<QString> ({ cfg::LDrawPath, cfg::DownloadFilePath })) { for (const QString& subdir : QList<QString> ({ "parts", "p" })) { @@ -656,7 +656,7 @@ // void addRecentFile (QString path) { - auto& rfiles = cfg::recentFiles; + auto& rfiles = cfg::RecentFiles; int idx = rfiles.indexOf (path); // If this file already is in the list, pop it out. @@ -1322,7 +1322,7 @@ // Possibly substitute with logoed studs: // stud.dat -> stud-logo.dat // stud2.dat -> stud-logo2.dat - if (cfg::useLogoStuds and renderinline) + if (cfg::UseLogoStuds and renderinline) { // Ensure logoed studs are loaded first loadLogoedStuds();
--- a/src/ldObject.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/ldObject.cc Sun Jul 27 03:14:27 2014 +0300 @@ -27,8 +27,8 @@ #include "colors.h" #include "glCompiler.h" -CFGENTRY (String, defaultName, ""); -CFGENTRY (String, defaultUser, ""); +CFGENTRY (String, DefaultName, ""); +CFGENTRY (String, DefaultUser, ""); CFGENTRY (Bool, UseCALicense, true); // List of all LDObjects
--- a/src/main.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/main.cc Sun Jul 27 03:14:27 2014 +0300 @@ -40,7 +40,7 @@ const Vertex g_origin (0.0f, 0.0f, 0.0f); const Matrix g_identity ({1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}); -CFGENTRY (Bool, firstStart, true); +CFGENTRY (Bool, FirstStart, true); // ============================================================================= // @@ -72,10 +72,10 @@ // If this is the first start, get the user to configuration. Especially point // them to the profile tab, it's the most important form to fill in. - if (cfg::firstStart) + if (cfg::FirstStart) { (new ConfigDialog (ConfigDialog::ProfileTab))->exec(); - cfg::firstStart = false; + cfg::FirstStart = false; Config::Save(); }
--- a/src/mainWindow.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/mainWindow.cc Sun Jul 27 03:14:27 2014 +0300 @@ -55,20 +55,20 @@ static bool g_isSelectionLocked = false; static QMap<QAction*, QKeySequence> g_defaultShortcuts; -CFGENTRY (Bool, colorizeObjectsList, true); -CFGENTRY (String, quickColorToolbar, "4:25:14:27:2:3:11:1:22:|:0:72:71:15"); -CFGENTRY (Bool, listImplicitFiles, false); -EXTERN_CFGENTRY (List, recentFiles); -EXTERN_CFGENTRY (Bool, drawAxes); -EXTERN_CFGENTRY (String, mainColor); -EXTERN_CFGENTRY (Float, mainColorAlpha); -EXTERN_CFGENTRY (Bool, drawWireframe); -EXTERN_CFGENTRY (Bool, bfcRedGreenView); -EXTERN_CFGENTRY (Bool, drawAngles); -EXTERN_CFGENTRY (Bool, randomColors); -EXTERN_CFGENTRY (Bool, drawSurfaces) -EXTERN_CFGENTRY (Bool, drawEdgeLines) -EXTERN_CFGENTRY (Bool, drawConditionalLines) +CFGENTRY (Bool, ColorizeObjectsList, true); +CFGENTRY (String, QuickColorToolbar, "4:25:14:27:2:3:11:1:22:|:0:72:71:15"); +CFGENTRY (Bool, ListImplicitFiles, false); +EXTERN_CFGENTRY (List, RecentFiles); +EXTERN_CFGENTRY (Bool, DrawAxes); +EXTERN_CFGENTRY (String, MainColor); +EXTERN_CFGENTRY (Float, MainColorAlpha); +EXTERN_CFGENTRY (Bool, DrawWireframe); +EXTERN_CFGENTRY (Bool, BfcRedGreenView); +EXTERN_CFGENTRY (Bool, DrawAngles); +EXTERN_CFGENTRY (Bool, RandomColors); +EXTERN_CFGENTRY (Bool, DrawSurfaces) +EXTERN_CFGENTRY (Bool, DrawEdgeLines) +EXTERN_CFGENTRY (Bool, DrawConditionalLines) // ============================================================================= // @@ -166,7 +166,7 @@ QAction* first = null; - for (const QVariant& it : cfg::recentFiles) + for (const QVariant& it : cfg::RecentFiles) { QString file = it.toString(); QAction* recent = new QAction (getIcon ("open-recent"), file, this); @@ -184,7 +184,7 @@ { QList<LDQuickColor> colors; - for (QString colorname : cfg::quickColorToolbar.split (":")) + for (QString colorname : cfg::QuickColorToolbar.split (":")) { if (colorname == "|") colors << LDQuickColor::getSeparator(); @@ -236,9 +236,9 @@ void MainWindow::updateGridToolBar() { // Ensure that the current grid - and only the current grid - is selected. - ui->actionGridCoarse->setChecked (cfg::grid == Grid::Coarse); - ui->actionGridMedium->setChecked (cfg::grid == Grid::Medium); - ui->actionGridFine->setChecked (cfg::grid == Grid::Fine); + ui->actionGridCoarse->setChecked (cfg::Grid == Grid::Coarse); + ui->actionGridMedium->setChecked (cfg::Grid == Grid::Medium); + ui->actionGridFine->setChecked (cfg::Grid == Grid::Fine); } // ============================================================================= @@ -410,7 +410,7 @@ item->setBackground (QColor ("#AA0000")); item->setForeground (QColor ("#FFAA00")); } - elif (cfg::colorizeObjectsList and obj->isColored() and + elif (cfg::ColorizeObjectsList and obj->isColored() and obj->color() != null and obj->color() != maincolor() and obj->color() != edgecolor()) { // If the object isn't in the main or edge color, draw this @@ -823,8 +823,8 @@ if (colinfo == maincolor()) { // Use the user preferences for main color here - col = cfg::mainColor; - col.setAlphaF (cfg::mainColorAlpha); + col = cfg::MainColor; + col.setAlphaF (cfg::MainColorAlpha); } // Paint the icon border @@ -976,14 +976,14 @@ ui->actionRedo->setEnabled (pos < (long) his->getSize() - 1); } - ui->actionWireframe->setChecked (cfg::drawWireframe); - ui->actionAxes->setChecked (cfg::drawAxes); - ui->actionBFCView->setChecked (cfg::bfcRedGreenView); - ui->actionRandomColors->setChecked (cfg::randomColors); - ui->actionDrawAngles->setChecked (cfg::drawAngles); - ui->actionDrawSurfaces->setChecked (cfg::drawSurfaces); - ui->actionDrawEdgeLines->setChecked (cfg::drawEdgeLines); - ui->actionDrawConditionalLines->setChecked (cfg::drawConditionalLines); + ui->actionWireframe->setChecked (cfg::DrawWireframe); + ui->actionAxes->setChecked (cfg::DrawAxes); + ui->actionBFCView->setChecked (cfg::BfcRedGreenView); + ui->actionRandomColors->setChecked (cfg::RandomColors); + ui->actionDrawAngles->setChecked (cfg::DrawAngles); + ui->actionDrawSurfaces->setChecked (cfg::DrawSurfaces); + ui->actionDrawEdgeLines->setChecked (cfg::DrawEdgeLines); + ui->actionDrawConditionalLines->setChecked (cfg::DrawConditionalLines); } // =============================================================================
--- a/src/miscallenous.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/miscallenous.cc Sun Jul 27 03:14:27 2014 +0300 @@ -99,21 +99,21 @@ // // Grid stuff // -CFGENTRY (Int, grid, Grid::Medium); -CFGENTRY (Float, gridCoarseCoordinateSnap, 5.0f); -CFGENTRY (Float, gridCoarseAngleSnap, 45.0f); -CFGENTRY (Float, gridMediumCoordinateSnap, 1.0f); -CFGENTRY (Float, gridMediumAngleSnap, 22.5f); -CFGENTRY (Float, gridFineCoordinateSnap, 0.1f); -CFGENTRY (Float, gridFineAngleSnap, 7.5f); -CFGENTRY (Int, edit_rotpoint, 0); -CFGENTRY (Vertex, edit_customrotpoint, g_origin); +CFGENTRY (Int, Grid, Grid::Medium); +CFGENTRY (Float, GridCoarseCoordinateSnap, 5.0f); +CFGENTRY (Float, GridCoarseAngleSnap, 45.0f); +CFGENTRY (Float, GridMediumCoordinateSnap, 1.0f); +CFGENTRY (Float, GridMediumAngleSnap, 22.5f); +CFGENTRY (Float, GridFineCoordinateSnap, 0.1f); +CFGENTRY (Float, GridFineAngleSnap, 7.5f); +CFGENTRY (Int, RotationPointType, 0); +CFGENTRY (Vertex, CustomRotationPoint, g_origin); const gridinfo g_gridInfo[3] = { - { "Coarse", &cfg::gridCoarseCoordinateSnap, &cfg::gridCoarseAngleSnap }, - { "Medium", &cfg::gridMediumCoordinateSnap, &cfg::gridMediumAngleSnap }, - { "Fine", &cfg::gridFineCoordinateSnap, &cfg::gridFineAngleSnap }, + { "Coarse", &cfg::GridCoarseCoordinateSnap, &cfg::GridCoarseAngleSnap }, + { "Medium", &cfg::GridMediumCoordinateSnap, &cfg::GridMediumAngleSnap }, + { "Fine", &cfg::GridFineCoordinateSnap, &cfg::GridFineAngleSnap }, }; // ============================================================================= @@ -167,7 +167,7 @@ // Vertex rotPoint (const LDObjectList& objs) { - switch ((ERotationPoint) cfg::edit_rotpoint) + switch ((ERotationPoint) cfg::RotationPointType) { case EObjectOrigin: { @@ -192,7 +192,7 @@ case ECustomPoint: { - return cfg::edit_customrotpoint; + return cfg::CustomRotationPoint; } } @@ -207,7 +207,7 @@ Ui::RotPointUI ui; ui.setupUi (dlg); - switch ((ERotationPoint) cfg::edit_rotpoint) + switch ((ERotationPoint) cfg::RotationPointType) { case EObjectOrigin: ui.objectPoint->setChecked (true); @@ -222,21 +222,21 @@ break; } - ui.customX->setValue (cfg::edit_customrotpoint.x()); - ui.customY->setValue (cfg::edit_customrotpoint.y()); - ui.customZ->setValue (cfg::edit_customrotpoint.z()); + ui.customX->setValue (cfg::CustomRotationPoint.x()); + ui.customY->setValue (cfg::CustomRotationPoint.y()); + ui.customZ->setValue (cfg::CustomRotationPoint.z()); if (not dlg->exec()) return; - cfg::edit_rotpoint = + cfg::RotationPointType = (ui.objectPoint->isChecked()) ? EObjectOrigin : (ui.worldPoint->isChecked()) ? EWorldOrigin : ECustomPoint; - cfg::edit_customrotpoint.setX (ui.customX->value()); - cfg::edit_customrotpoint.setY (ui.customY->value()); - cfg::edit_customrotpoint.setZ (ui.customZ->value()); + cfg::CustomRotationPoint.setX (ui.customX->value()); + cfg::CustomRotationPoint.setY (ui.customY->value()); + cfg::CustomRotationPoint.setZ (ui.customZ->value()); } // =============================================================================
--- a/src/miscallenous.h Sun Jul 27 02:55:27 2014 +0300 +++ b/src/miscallenous.h Sun Jul 27 03:14:27 2014 +0300 @@ -54,13 +54,13 @@ AbstractConfigEntry::FloatType* anglesnap; }; -EXTERN_CFGENTRY (Int, grid); +EXTERN_CFGENTRY (Int, Grid); static const int g_numGrids = 3; extern const gridinfo g_gridInfo[3]; inline const gridinfo& currentGrid() { - return g_gridInfo[cfg::grid]; + return g_gridInfo[cfg::Grid]; } // =============================================================================
--- a/src/partDownloader.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/partDownloader.cc Sun Jul 27 03:14:27 2014 +0300 @@ -30,9 +30,9 @@ #include "glRenderer.h" #include "configDialog.h" -CFGENTRY (String, downloadFilePath, ""); -CFGENTRY (Bool, guessDownloadPaths, true); -CFGENTRY (Bool, autoCloseDownloadDialog, true); +CFGENTRY (String, DownloadFilePath, ""); +CFGENTRY (Bool, GuessDownloadPaths, true); +CFGENTRY (Bool, AutoCloseDownloadDialog, true); const QString g_unofficialLibraryURL ("http://ldraw.org/library/unofficial/"); @@ -59,7 +59,7 @@ // QString PartDownloader::getDownloadPath() { - QString path = cfg::downloadFilePath; + QString path = cfg::DownloadFilePath; if (DIRSLASH[0] != '/') path.replace (DIRSLASH, "/"); @@ -123,7 +123,7 @@ dest = dest.simplified(); // If the user doesn't want us to guess, stop right here. - if (not cfg::guessDownloadPaths) + if (not cfg::GuessDownloadPaths) return; // Ensure .dat extension @@ -289,7 +289,7 @@ g_win->R()->resetAngles(); } - if (cfg::autoCloseDownloadDialog and not failed) + if (cfg::AutoCloseDownloadDialog and not failed) { // Close automatically if desired. accept();
--- a/src/primitives.cc Sun Jul 27 02:55:27 2014 +0300 +++ b/src/primitives.cc Sun Jul 27 03:14:27 2014 +0300 @@ -31,9 +31,9 @@ static PrimitiveScanner* g_activeScanner = null; PrimitiveCategory* g_unmatched = null; -EXTERN_CFGENTRY (String, defaultName); -EXTERN_CFGENTRY (String, defaultUser); -EXTERN_CFGENTRY (Int, defaultLicense); +EXTERN_CFGENTRY (String, DefaultName); +EXTERN_CFGENTRY (String, DefaultUser); +EXTERN_CFGENTRY (Int, DefaultLicense); static const QStringList g_radialNameRoots = { @@ -622,10 +622,10 @@ QString author = APPNAME; QString license = ""; - if (not cfg::defaultName.isEmpty()) + if (not cfg::DefaultName.isEmpty()) { license = PreferredLicenseText(); - author = format ("%1 [%2]", cfg::defaultName, cfg::defaultUser); + author = format ("%1 [%2]", cfg::DefaultName, cfg::DefaultUser); } LDObjectList objs;