Sun, 27 Jul 2014 04:25:50 +0300
- refactored up the configuration dialog. Instead of setting all configuration values one-by-one, dynamically fill in the values and save them into config based on widget names and data
src/actions.cc | file | annotate | diff | comparison | revisions | |
src/configDialog.cc | file | annotate | diff | comparison | revisions | |
src/configDialog.h | file | annotate | diff | comparison | revisions | |
src/configuration.cc | file | annotate | diff | comparison | revisions | |
src/configuration.h | file | annotate | diff | comparison | revisions | |
src/glRenderer.cc | file | annotate | diff | comparison | revisions | |
src/mainWindow.cc | file | annotate | diff | comparison | revisions | |
ui/config.ui | file | annotate | diff | comparison | revisions |
--- a/src/actions.cc Sun Jul 27 03:14:27 2014 +0300 +++ b/src/actions.cc Sun Jul 27 04:25:50 2014 +0300 @@ -40,7 +40,7 @@ #include "editmodes/abstractEditMode.h" EXTERN_CFGENTRY (Bool, DrawWireframe); -EXTERN_CFGENTRY (Bool, BfcRedGreenView); +EXTERN_CFGENTRY (Bool, BFCRedGreenView); EXTERN_CFGENTRY (String, DefaultName); EXTERN_CFGENTRY (String, DefaultUser); EXTERN_CFGENTRY (Bool, UseCALicense); @@ -679,9 +679,9 @@ // void MainWindow::slot_actionBFCView() { - cfg::BfcRedGreenView = not cfg::BfcRedGreenView; + cfg::BFCRedGreenView = not cfg::BFCRedGreenView; - if (cfg::BfcRedGreenView) + if (cfg::BFCRedGreenView) cfg::RandomColors = false; updateActions(); @@ -885,7 +885,7 @@ cfg::RandomColors = not cfg::RandomColors; if (cfg::RandomColors) - cfg::BfcRedGreenView = false; + cfg::BFCRedGreenView = false; updateActions(); R()->refresh();
--- a/src/configDialog.cc Sun Jul 27 03:14:27 2014 +0300 +++ b/src/configDialog.cc Sun Jul 27 04:25:50 2014 +0300 @@ -39,46 +39,19 @@ #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 (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, 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 (String, QuickColorToolbar) const char* g_extProgPathFilter = #ifdef _WIN32 @@ -123,31 +96,47 @@ ui = new Ui_ConfigUI; ui->setupUi (this); - // Interface tab - setButtonBackground (ui->backgroundColorButton, cfg::BackgroundColor); - connect (ui->backgroundColorButton, SIGNAL (clicked()), - this, SLOT (slot_setGLBackground())); - - setButtonBackground (ui->mainColorButton, cfg::MainColor); - connect (ui->mainColorButton, SIGNAL (clicked()), - this, SLOT (slot_setGLForeground())); - - setButtonBackground (ui->selColorButton, cfg::SelectColorBlend); - connect (ui->selColorButton, SIGNAL (clicked()), - this, SLOT (slot_setGLSelectColor())); + // Set defaults + _applyToWidgetOptions ([&](QWidget* wdg, AbstractConfigEntry* conf) + { + QVariant value (conf->toVariant()); + QLineEdit* le; + QSpinBox* spinbox; + QDoubleSpinBox* doublespinbox; + QSlider* slider; + QCheckBox* checkbox; + QPushButton* button; - 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); + if ((le = qobject_cast<QLineEdit*> (wdg)) != null) + { + le->setText (value.toString()); + } + elif ((spinbox = qobject_cast<QSpinBox*> (wdg)) != null) + { + spinbox->setValue (value.toInt()); + } + elif ((doublespinbox = qobject_cast<QDoubleSpinBox*> (wdg)) != null) + { + doublespinbox->setValue (value.toDouble()); + } + elif ((slider = qobject_cast<QSlider*> (wdg)) != null) + { + slider->setValue (value.toInt()); + } + elif ((checkbox = qobject_cast<QCheckBox*> (wdg)) != null) + { + checkbox->setChecked (value.toBool()); + } + elif ((button = qobject_cast<QPushButton*> (wdg)) != null) + { + setButtonBackground (button, value.toString()); + connect (button, SIGNAL (clicked()), this, SLOT (setButtonColor())); + } + else + { + print ("Unknown widget of type %1\n", wdg->metaObject()->className()); + } + }); g_win->applyToActions ([&](QAction* act) { @@ -156,14 +145,13 @@ ui->shortcutsList->setSortingEnabled (true); ui->shortcutsList->sortItems(); - + quickColors = quickColorsFromConfig(); + updateQuickColorList(); + initExtProgs(); + selectPage (deftab); connect (ui->shortcut_set, SIGNAL (clicked()), this, SLOT (slot_setShortcut())); connect (ui->shortcut_reset, SIGNAL (clicked()), this, SLOT (slot_resetShortcut())); connect (ui->shortcut_clear, SIGNAL (clicked()), this, SLOT (slot_clearShortcut())); - - quickColors = quickColorsFromConfig(); - updateQuickColorList(); - connect (ui->quickColor_add, SIGNAL (clicked()), this, SLOT (slot_setColor())); connect (ui->quickColor_remove, SIGNAL (clicked()), this, SLOT (slot_delColor())); connect (ui->quickColor_edit, SIGNAL (clicked()), this, SLOT (slot_setColor())); @@ -171,34 +159,11 @@ connect (ui->quickColor_moveUp, SIGNAL (clicked()), this, SLOT (slot_moveColor())); 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); connect (ui->findDownloadPath, SIGNAL (clicked (bool)), this, SLOT (slot_findDownloadFolder())); - - 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); - - initExtProgs(); - selectPage (deftab); - connect (ui->buttonBox, SIGNAL (clicked (QAbstractButton*)), this, SLOT (buttonClicked (QAbstractButton*))); - - connect (ui->m_pages, SIGNAL (currentChanged (int)), - this, SLOT (selectPage (int))); - - connect (ui->m_pagelist, SIGNAL (currentRowChanged (int)), - this, SLOT (selectPage (int))); + connect (ui->m_pages, SIGNAL (currentChanged (int)), this, SLOT (selectPage (int))); + connect (ui->m_pagelist, SIGNAL (currentRowChanged (int)), this, SLOT (selectPage (int))); } // @@ -277,43 +242,64 @@ ui->extProgs->setLayout (pathsLayout); } +void ConfigDialog::_applyToWidgetOptions (std::function<void (QWidget*, AbstractConfigEntry*)> func) +{ + // Apply configuration + for (QWidget* wdg : findChildren<QWidget*>()) + { + if (not wdg->objectName().startsWith ("config")) + continue; + + QString confname (wdg->objectName().mid (strlen ("config"))); + AbstractConfigEntry* conf (Config::FindByName (confname)); + + if (conf == null) + { + print ("Couldn't find configuration entry named %1", confname); + continue; + } + + func (wdg, conf); + } +} + // // Set the settings based on widget data. // 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::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(); + _applyToWidgetOptions ([&](QWidget* wdg, AbstractConfigEntry* conf) + { + QVariant value (conf->toVariant()); + QLineEdit* le; + QSpinBox* spinbox; + QDoubleSpinBox* doublespinbox; + QSlider* slider; + QCheckBox* checkbox; + QPushButton* button; + + if ((le = qobject_cast<QLineEdit*> (wdg)) != null) + value = le->text(); + elif ((spinbox = qobject_cast<QSpinBox*> (wdg)) != null) + value = spinbox->value(); + elif ((doublespinbox = qobject_cast<QDoubleSpinBox*> (wdg)) != null) + value = doublespinbox->value(); + elif ((slider = qobject_cast<QSlider*> (wdg)) != null) + value = slider->value(); + elif ((checkbox = qobject_cast<QCheckBox*> (wdg)) != null) + value = checkbox->isChecked(); + elif ((button = qobject_cast<QPushButton*> (wdg)) != null) + value = _buttonColors[button]; + else + print ("Unknown widget of type %1\n", wdg->metaObject()->className()); + + conf->loadFromVariant (value); + }); // Rebuild the quick color toolbar g_win->setQuickColors (quickColors); 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(); - // Ext program settings for (const LDExtProgInfo& info : g_LDExtProgInfo) { @@ -343,17 +329,18 @@ // void ConfigDialog::buttonClicked (QAbstractButton* button) { - typedef QDialogButtonBox QDDB; QDialogButtonBox* dbb = ui->buttonBox; - if (button == dbb->button (QDDB::Ok)) + if (button == dbb->button (QDialogButtonBox::Ok)) { applySettings(); accept(); - } elif (button == dbb->button (QDDB::Apply)) + } + elif (button == dbb->button (QDialogButtonBox::Apply)) { applySettings(); - } elif (button == dbb->button (QDDB::Cancel)) + } + elif (button == dbb->button (QDialogButtonBox::Cancel)) { reject(); } @@ -376,7 +363,7 @@ if (entry.isSeparator()) { - item->setText ("--------"); + item->setText ("<hr />"); item->setIcon (getIcon ("empty")); } else @@ -436,7 +423,9 @@ return; if (entry) + { entry->setColor (val); + } else { LDQuickColor entry (val, null); @@ -510,47 +499,31 @@ // // -// Pick a color and set the appropriate configuration option. -// -void ConfigDialog::pickColor (QString& conf, QPushButton* button) +void ConfigDialog::setButtonColor() { - QColor col = QColorDialog::getColor (QColor (conf)); + QPushButton* button = qobject_cast<QPushButton*> (sender()); + + if (button == null) + { + print ("setButtonColor: null sender!\n"); + return; + } + + QColor col = QColorDialog::getColor (_buttonColors[button]); if (col.isValid()) { - int r = col.red(), - g = col.green(), - b = col.blue(); + int r = col.red(); + int g = col.green(); + int b = col.blue(); QString colname; colname.sprintf ("#%.2X%.2X%.2X", r, g, b); - conf = colname; setButtonBackground (button, colname); } } // -// -void ConfigDialog::slot_setGLBackground() -{ - pickColor (cfg::BackgroundColor, ui->backgroundColorButton); -} - -// -// -void ConfigDialog::slot_setGLForeground() -{ - pickColor (cfg::MainColor, ui->mainColorButton); -} - -// -// -void ConfigDialog::slot_setGLSelectColor() -{ - pickColor (cfg::SelectColorBlend, ui->selColorButton); -} - -// // Sets background color of a given button. // void ConfigDialog::setButtonBackground (QPushButton* button, QString value) @@ -558,6 +531,7 @@ button->setIcon (getIcon ("colorselect")); button->setAutoFillBackground (true); button->setStyleSheet (format ("background-color: %1", value)); + _buttonColors[button] = QColor (value); } // @@ -677,7 +651,9 @@ void ConfigDialog::slot_findDownloadFolder() { QString dpath = QFileDialog::getExistingDirectory(); - ui->downloadPath->setText (dpath); + + if (not dpath.isEmpty()) + ui->configDownloadFilePath->setText (dpath); } //
--- a/src/configDialog.h Sun Jul 27 03:14:27 2014 +0300 +++ b/src/configDialog.h Sun Jul 27 04:25:50 2014 +0300 @@ -61,11 +61,11 @@ private: Ui_ConfigUI* ui; QList<QListWidgetItem*> quickColorItems; + QMap<QPushButton*, QColor> _buttonColors; void applySettings(); void addShortcut (QAction* act); void setButtonBackground (QPushButton* button, QString value); - void pickColor (QString& conf, QPushButton* button); void updateQuickColorList (LDQuickColor* sel = null); void setShortcutText (ShortcutListItem* item); int getItemRow (QListWidgetItem* item, QList<QListWidgetItem*>& haystack); @@ -73,11 +73,10 @@ QListWidgetItem* getSelectedQuickColor(); QList<ShortcutListItem*> getShortcutSelection(); void initExtProgs(); + void _applyToWidgetOptions (std::function<void (QWidget*, AbstractConfigEntry*)> func); private slots: - void slot_setGLBackground(); - void slot_setGLForeground(); - void slot_setGLSelectColor(); + void setButtonColor(); void slot_setShortcut(); void slot_resetShortcut(); void slot_clearShortcut();
--- a/src/configuration.cc Sun Jul 27 03:14:27 2014 +0300 +++ b/src/configuration.cc Sun Jul 27 04:25:50 2014 +0300 @@ -145,6 +145,20 @@ return new QSettings (path, QSettings::IniFormat); } +// +// Accessor to entry list +// +QList<AbstractConfigEntry*> const& Config::AllConfigEntries() +{ + return ConfigurationEntries; +} + +AbstractConfigEntry* Config::FindByName (QString const& name) +{ + auto it = EntriesByName.find (name); + return (it != EntriesByName.end()) ? *it : null; +} + template<typename T> static T* GetConfigByName (QString name, AbstractConfigEntry::Type type) {
--- a/src/configuration.h Sun Jul 27 03:14:27 2014 +0300 +++ b/src/configuration.h Sun Jul 27 04:25:50 2014 +0300 @@ -24,6 +24,7 @@ #include "basics.h" class QSettings; +class AbstractConfigEntry; #define CFGENTRY(T, NAME, DEFAULT) namespace cfg { AbstractConfigEntry::T##Type NAME; } #define EXTERN_CFGENTRY(T, NAME) namespace cfg { extern AbstractConfigEntry::T##Type NAME; } @@ -37,6 +38,8 @@ QString DirectoryPath(); QString FilePath (QString file); QSettings* SettingsObject(); + QList<AbstractConfigEntry*> const& AllConfigEntries(); + AbstractConfigEntry* FindByName (QString const& name); } class AbstractConfigEntry
--- a/src/glRenderer.cc Sun Jul 27 03:14:27 2014 +0300 +++ b/src/glRenderer.cc Sun Jul 27 04:25:50 2014 +0300 @@ -56,7 +56,7 @@ CFGENTRY (String, MainColor, "#A0A0A0") CFGENTRY (Float, MainColorAlpha, 1.0) CFGENTRY (Int, LineThickness, 2) -CFGENTRY (Bool, BfcRedGreenView, false) +CFGENTRY (Bool, BFCRedGreenView, false) CFGENTRY (Int, Camera, EFreeCamera) CFGENTRY (Bool, BlackEdges, false) CFGENTRY (Bool, DrawAxes, false) @@ -414,7 +414,7 @@ } else { - if (cfg::BfcRedGreenView) + if (cfg::BFCRedGreenView) { glEnable (GL_CULL_FACE); glCullFace (GL_BACK);
--- a/src/mainWindow.cc Sun Jul 27 03:14:27 2014 +0300 +++ b/src/mainWindow.cc Sun Jul 27 04:25:50 2014 +0300 @@ -63,7 +63,7 @@ EXTERN_CFGENTRY (String, MainColor); EXTERN_CFGENTRY (Float, MainColorAlpha); EXTERN_CFGENTRY (Bool, DrawWireframe); -EXTERN_CFGENTRY (Bool, BfcRedGreenView); +EXTERN_CFGENTRY (Bool, BFCRedGreenView); EXTERN_CFGENTRY (Bool, DrawAngles); EXTERN_CFGENTRY (Bool, RandomColors); EXTERN_CFGENTRY (Bool, DrawSurfaces) @@ -978,7 +978,7 @@ ui->actionWireframe->setChecked (cfg::DrawWireframe); ui->actionAxes->setChecked (cfg::DrawAxes); - ui->actionBFCView->setChecked (cfg::BfcRedGreenView); + ui->actionBFCView->setChecked (cfg::BFCRedGreenView); ui->actionRandomColors->setChecked (cfg::RandomColors); ui->actionDrawAngles->setChecked (cfg::DrawAngles); ui->actionDrawSurfaces->setChecked (cfg::DrawSurfaces);
--- a/ui/config.ui Sun Jul 27 03:14:27 2014 +0300 +++ b/ui/config.ui Sun Jul 27 04:25:50 2014 +0300 @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>717</width> - <height>419</height> + <width>644</width> + <height>370</height> </rect> </property> <property name="windowTitle"> @@ -79,7 +79,7 @@ <item> <widget class="QStackedWidget" name="m_pages"> <property name="currentIndex"> - <number>2</number> + <number>0</number> </property> <widget class="QWidget" name="page_3"> <layout class="QVBoxLayout" name="verticalLayout_13"> @@ -88,164 +88,218 @@ <property name="title"> <string>Interface</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_3" stretch="0,0,0"> + <layout class="QVBoxLayout" name="verticalLayout_10"> <item> - <layout class="QFormLayout" name="formLayout"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="whatsThis"> - <string/> - </property> - <property name="text"> - <string>Main color:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QPushButton" name="mainColorButton"> - <property name="whatsThis"> - <string>This color is used for the main color.</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../ldforge.qrc"> - <normaloff>:/icons/colorselect.png</normaloff>:/icons/colorselect.png</iconset> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_3"> - <property name="whatsThis"> - <string/> - </property> - <property name="text"> - <string>Main color alpha:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QSlider" name="mainColorAlpha"> - <property name="whatsThis"> - <string>Opacity of main color in the viewport.</string> - </property> - <property name="minimum"> - <number>1</number> - </property> - <property name="maximum"> - <number>10</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="tickPosition"> - <enum>QSlider::TicksAbove</enum> - </property> - <property name="tickInterval"> - <number>1</number> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="selectedColorLabel"> - <property name="text"> - <string>Selected Color</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QPushButton" name="selColorButton"> - <property name="whatsThis"> - <string>This color is used for the main color.</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../ldforge.qrc"> - <normaloff>:/icons/colorselect.png</normaloff>:/icons/colorselect.png</iconset> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_2"> - <property name="whatsThis"> - <string/> - </property> - <property name="text"> - <string>Background:</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QPushButton" name="backgroundColorButton"> - <property name="whatsThis"> - <string>This is the background color for the viewport.</string> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../ldforge.qrc"> - <normaloff>:/icons/colorselect.png</normaloff>:/icons/colorselect.png</iconset> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QFormLayout" name="formLayout_2"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="1"> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <widget class="QSlider" name="lineThickness"> - <property name="whatsThis"> - <string>How thick lines should be drawn in the viewport.</string> - </property> - <property name="minimum"> - <number>1</number> - </property> - <property name="maximum"> - <number>8</number> - </property> + <spacer name="horizontalSpacer_2"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="tickPosition"> - <enum>QSlider::TicksAbove</enum> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> </property> - <property name="tickInterval"> - <number>1</number> + </spacer> + </item> + <item> + <layout class="QFormLayout" name="formLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label_2"> + <property name="whatsThis"> + <string/> + </property> + <property name="text"> + <string>Background color</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QPushButton" name="configBackgroundColor"> + <property name="whatsThis"> + <string>This is the background color for the viewport.</string> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../ldforge.qrc"> + <normaloff>:/icons/colorselect.png</normaloff>:/icons/colorselect.png</iconset> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label"> + <property name="whatsThis"> + <string/> + </property> + <property name="text"> + <string>Main color</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QPushButton" name="configMainColor"> + <property name="whatsThis"> + <string>This color is used for the main color.</string> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../ldforge.qrc"> + <normaloff>:/icons/colorselect.png</normaloff>:/icons/colorselect.png</iconset> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="selectedColorLabel"> + <property name="text"> + <string>Selected color</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QPushButton" name="configSelectColorBlend"> + <property name="whatsThis"> + <string>This color is used for the main color.</string> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../ldforge.qrc"> + <normaloff>:/icons/colorselect.png</normaloff>:/icons/colorselect.png</iconset> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_3"> + <property name="whatsThis"> + <string/> + </property> + <property name="text"> + <string>Main color alpha</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QDoubleSpinBox" name="configMainColorAlpha"> + <property name="maximum"> + <double>1.000000000000000</double> + </property> + <property name="singleStep"> + <double>0.050000000000000</double> + </property> + <property name="value"> + <double>1.000000000000000</double> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_5"> + <property name="whatsThis"> + <string/> + </property> + <property name="text"> + <string>Line thickness</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QSlider" name="configLineThickness"> + <property name="whatsThis"> + <string>How thick lines should be drawn in the viewport.</string> + </property> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>8</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksAbove</enum> + </property> + <property name="tickInterval"> + <number>1</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - </widget> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_5"> - <property name="whatsThis"> - <string/> - </property> - <property name="text"> - <string>Line thickness:</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_8"> <item> - <layout class="QVBoxLayout" name="verticalLayout_11"> - <item> - <widget class="QCheckBox" name="blackEdges"> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="0" column="0"> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="3" column="1"> + <widget class="QCheckBox" name="configAntiAliasedLines"> + <property name="text"> + <string>Anti-aliased lines</string> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QCheckBox" name="configDrawLineLengths"> + <property name="text"> + <string>Display line lenghts when drawing</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QCheckBox" name="configBFCRedGreenView"> + <property name="whatsThis"> + <string>Polygons' front sides become green and back sides red.</string> + </property> + <property name="text"> + <string>Red/green BFC view (incomplete)</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QCheckBox" name="configColorizeObjectsList"> + <property name="whatsThis"> + <string>Makes colored objects (non-16 and 24) appear colored in the list view. A red triangle will, for instance, have its entry written in red text. This can be useful to locate colored objects.</string> + </property> + <property name="text"> + <string>Colorize objects in list view</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QCheckBox" name="configBlackEdges"> <property name="whatsThis"> <string>Makes all edgelines appear black. If this is not set, edge lines take their color as defined in LDConfig.ldr.</string> </property> @@ -254,60 +308,28 @@ </property> </widget> </item> - <item> - <widget class="QCheckBox" name="colorBFC"> - <property name="whatsThis"> - <string>Polygons' front sides become green and back sides red.</string> - </property> - <property name="text"> - <string>Red/green BFC view (incomplete)</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="colorizeObjects"> - <property name="whatsThis"> - <string>Makes colored objects (non-16 and 24) appear colored in the list view. A red triangle will, for instance, have its entry written in red text. This can be useful to locate colored objects.</string> + <item row="1" column="3"> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <property name="text"> - <string>Colorize objects in list view</string> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> </property> - </widget> + </spacer> </item> - <item> - <widget class="QCheckBox" name="m_aa"> - <property name="text"> - <string>Anti-aliased lines</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_12"> - <item> - <widget class="QCheckBox" name="m_logostuds"> + <item row="0" column="2"> + <widget class="QCheckBox" name="configUseLogoStuds"> <property name="text"> <string>Use logoed studs</string> </property> </widget> </item> - <item> - <widget class="QCheckBox" name="linelengths"> - <property name="text"> - <string>Display line lenghts when drawing</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="implicitFiles"> - <property name="text"> - <string>List implicitly loaded files</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="highlightObjectBelowCursor"> + <item row="2" column="2"> + <widget class="QCheckBox" name="configHighlightObjectBelowCursor"> <property name="text"> <string>Highlight object below cursor</string> </property> @@ -338,25 +360,51 @@ <layout class="QVBoxLayout" name="verticalLayout_9"> <item> <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> + <item row="0" column="1"> <widget class="QLabel" name="label_17"> <property name="text"> <string>Position decimals:</string> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QSpinBox" name="roundPosition"/> + <item row="0" column="2"> + <widget class="QSpinBox" name="configRoundPosition"/> </item> - <item row="1" column="0"> + <item row="1" column="1"> <widget class="QLabel" name="label_18"> <property name="text"> <string>Matrix decimals:</string> </property> </widget> </item> - <item row="1" column="1"> - <widget class="QSpinBox" name="roundMatrix"/> + <item row="1" column="2"> + <widget class="QSpinBox" name="configRoundMatrix"/> + </item> + <item row="0" column="0"> + <spacer name="horizontalSpacer_5"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="3"> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> </item> @@ -390,36 +438,73 @@ </property> <layout class="QVBoxLayout" name="verticalLayout_8"> <item> - <layout class="QFormLayout" name="formLayout_3"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="1" column="0"> - <widget class="QLabel" name="label_7"> - <property name="text"> - <string>Name:</string> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="m_profileName"/> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_8"> - <property name="text"> - <string>Username:</string> + <item> + <layout class="QFormLayout" name="formLayout_3"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> </property> - </widget> + <item row="1" column="0"> + <widget class="QLabel" name="label_7"> + <property name="text"> + <string>Name:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLineEdit" name="configDefaultName"> + <property name="minimumSize"> + <size> + <width>250</width> + <height>0</height> + </size> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>Username:</string> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLineEdit" name="configDefaultUser"/> + </item> + <item row="3" column="1"> + <widget class="QCheckBox" name="configUseCALicense"> + <property name="text"> + <string>Use CA license</string> + </property> + </widget> + </item> + </layout> </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="m_profileUsername"/> - </item> - <item row="3" column="1"> - <widget class="QCheckBox" name="UseCALicense"> - <property name="text"> - <string>Use CA license</string> + <item> + <spacer name="horizontalSpacer_8"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - </widget> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> </layout> </item> @@ -650,22 +735,35 @@ </property> <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <layout class="QGridLayout" name="gridLayout" columnstretch="0,0,1,1"> - <item row="0" column="2"> + <layout class="QGridLayout" name="gridLayout"> + <item row="3" column="4"> + <widget class="QDoubleSpinBox" name="configGridFineAngleSnap"> + <property name="suffix"> + <string>°</string> + </property> + <property name="decimals"> + <number>3</number> + </property> + <property name="maximum"> + <double>360.000000000000000</double> + </property> + </widget> + </item> + <item row="0" column="3"> <widget class="QLabel" name="label_15"> <property name="text"> <string>Coordinate snap</string> </property> </widget> </item> - <item row="0" column="3"> + <item row="0" column="4"> <widget class="QLabel" name="label_16"> <property name="text"> <string>Angle snap</string> </property> </widget> </item> - <item row="1" column="0"> + <item row="1" column="1"> <widget class="QLabel" name="label_6"> <property name="text"> <string/> @@ -675,15 +773,15 @@ </property> </widget> </item> - <item row="1" column="1"> + <item row="1" column="2"> <widget class="QLabel" name="label_12"> <property name="text"> <string>Coarse</string> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QDoubleSpinBox" name="gridCoarseCoordinateSnap"> + <item row="1" column="3"> + <widget class="QDoubleSpinBox" name="configGridCoarseCoordinateSnap"> <property name="suffix"> <string> LDU</string> </property> @@ -695,8 +793,8 @@ </property> </widget> </item> - <item row="1" column="3"> - <widget class="QDoubleSpinBox" name="gridCoarseAngleSnap"> + <item row="1" column="4"> + <widget class="QDoubleSpinBox" name="configGridCoarseAngleSnap"> <property name="suffix"> <string>°</string> </property> @@ -708,7 +806,7 @@ </property> </widget> </item> - <item row="2" column="0"> + <item row="2" column="1"> <widget class="QLabel" name="label_10"> <property name="text"> <string/> @@ -718,15 +816,15 @@ </property> </widget> </item> - <item row="2" column="1"> + <item row="2" column="2"> <widget class="QLabel" name="label_13"> <property name="text"> <string>Medium</string> </property> </widget> </item> - <item row="2" column="2"> - <widget class="QDoubleSpinBox" name="gridMediumCoordinateSnap"> + <item row="2" column="3"> + <widget class="QDoubleSpinBox" name="configGridMediumCoordinateSnap"> <property name="suffix"> <string> LDU</string> </property> @@ -738,8 +836,8 @@ </property> </widget> </item> - <item row="2" column="3"> - <widget class="QDoubleSpinBox" name="gridMediumAngleSnap"> + <item row="2" column="4"> + <widget class="QDoubleSpinBox" name="configGridMediumAngleSnap"> <property name="suffix"> <string>°</string> </property> @@ -751,7 +849,7 @@ </property> </widget> </item> - <item row="3" column="0"> + <item row="3" column="1"> <widget class="QLabel" name="label_11"> <property name="text"> <string/> @@ -761,15 +859,15 @@ </property> </widget> </item> - <item row="3" column="1"> + <item row="3" column="2"> <widget class="QLabel" name="label_14"> <property name="text"> <string>Fine</string> </property> </widget> </item> - <item row="3" column="2"> - <widget class="QDoubleSpinBox" name="gridFineCoordinateSnap"> + <item row="3" column="3"> + <widget class="QDoubleSpinBox" name="configGridFineCoordinateSnap"> <property name="suffix"> <string> LDU</string> </property> @@ -781,18 +879,31 @@ </property> </widget> </item> - <item row="3" column="3"> - <widget class="QDoubleSpinBox" name="gridFineAngleSnap"> - <property name="suffix"> - <string>°</string> + <item row="1" column="0"> + <spacer name="horizontalSpacer_9"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> </property> - <property name="decimals"> - <number>3</number> + </spacer> + </item> + <item row="1" column="5"> + <spacer name="horizontalSpacer_10"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <property name="maximum"> - <double>360.000000000000000</double> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> </property> - </widget> + </spacer> </item> </layout> </item> @@ -861,7 +972,7 @@ </widget> </item> <item> - <widget class="QLineEdit" name="downloadPath"/> + <widget class="QLineEdit" name="configDownloadFilePath"/> </item> <item> <widget class="QPushButton" name="findDownloadPath"> @@ -877,7 +988,7 @@ </layout> </item> <item> - <widget class="QCheckBox" name="guessNetPaths"> + <widget class="QCheckBox" name="configGuessDownloadPaths"> <property name="whatsThis"> <string><p>When this is set, LDForge tries to adjust and correct part paths based on the input. A full path given to the download prompt should be of form <tt>"&lt;dir&gt;/&lt;file&gt;.dat"</tt> - with this set, input can be automatically completed.</p> @@ -895,7 +1006,7 @@ </widget> </item> <item> - <widget class="QCheckBox" name="autoCloseNetPrompt"> + <widget class="QCheckBox" name="configAutoCloseDownloadDialog"> <property name="whatsThis"> <string>If this is set, LDForge will close the download prompt after everything has been downloaded. The prompt will not be closed if a download has failed.</string> </property>