# HG changeset patch # User Santeri Piippo # Date 1382132349 -10800 # Node ID 2b5adb45aaa50e389c2d148ca09c0b118005bf09 # Parent d3373bc7ca3b0416b37d72404a8efb66e62bdc56 Made the config dialog use a list widget for navigation over a tab widget. diff -r d3373bc7ca3b -r 2b5adb45aaa5 src/configDialog.cpp --- a/src/configDialog.cpp Fri Oct 18 23:49:55 2013 +0300 +++ b/src/configDialog.cpp Sat Oct 19 00:39:09 2013 +0300 @@ -135,13 +135,19 @@ ui->m_profileName->setText (ld_defaultname); ui->m_profileUsername->setText (ld_defaultuser); ui->m_profileLicense->setCurrentIndex (ld_defaultlicense); - ui->tabs->setCurrentIndex (deftab); initGrids(); initExtProgs(); + selectPage (deftab); connect (ui->buttonBox, SIGNAL (clicked (QAbstractButton*)), - this, SLOT (buttonClicked (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))); } // ============================================================================= @@ -151,6 +157,13 @@ } // ============================================================================= +// ----------------------------------------------------------------------------- +void ConfigDialog::selectPage (int row) +{ ui->m_pagelist->setCurrentRow (row); + ui->m_pages->setCurrentIndex (row); +} + +// ============================================================================= // Adds a shortcut entry to the list of shortcuts. // ----------------------------------------------------------------------------- void ConfigDialog::addShortcut (KeySequenceConfig& cfg, QAction* act, int& i) @@ -179,7 +192,7 @@ *anglabel = new QLabel ("Angle"); short i = 1; -for (QLabel * label : initlist ( { xlabel, ylabel, zlabel, anglabel })) + for (QLabel* label : initlist ({xlabel, ylabel, zlabel, anglabel})) { label->setAlignment (Qt::AlignCenter); gridlayout->addWidget (label, 0, i++); } @@ -335,7 +348,6 @@ { applySettings(); accept(); } elif (button == dbb->button (QDDB::Apply)) - { applySettings(); } elif (button == dbb->button (QDDB::Cancel)) { reject(); @@ -352,7 +364,7 @@ quickColorItems.clear(); // Init table items -for (LDQuickColor & entry : quickColors) + for (LDQuickColor& entry : quickColors) { QListWidgetItem* item = new QListWidgetItem; if (entry.isSeparator()) @@ -517,7 +529,7 @@ int ConfigDialog::getItemRow (QListWidgetItem* item, QList& haystack) { int i = 0; -for (QListWidgetItem * it : haystack) + for (QListWidgetItem* it : haystack) { if (it == item) return i; @@ -543,7 +555,7 @@ QList ConfigDialog::getShortcutSelection() { QList out; -for (QListWidgetItem * entry : ui->shortcutsList->selectedItems()) + for (QListWidgetItem* entry : ui->shortcutsList->selectedItems()) out << static_cast (entry); return out; @@ -570,7 +582,7 @@ void ConfigDialog::slot_resetShortcut() { QList sel = getShortcutSelection(); -for (ShortcutListItem * item : sel) + for (ShortcutListItem* item : sel) { item->keyConfig()->reset(); setShortcutText (item); } @@ -582,7 +594,7 @@ void ConfigDialog::slot_clearShortcut() { QList sel = getShortcutSelection(); -for (ShortcutListItem * item : sel) + for (ShortcutListItem* item : sel) { item->keyConfig()->value = QKeySequence(); setShortcutText (item); } @@ -594,7 +606,7 @@ void ConfigDialog::slot_setExtProgPath() { const LDExtProgInfo* info = null; -for (const LDExtProgInfo & it : g_LDExtProgInfo) + for (const LDExtProgInfo& it : g_LDExtProgInfo) { if (it.setPathButton == sender()) { info = ⁢ break; @@ -634,7 +646,7 @@ str ConfigDialog::quickColorString() { str val; -for (const LDQuickColor & entry : quickColors) + for (const LDQuickColor& entry : quickColors) { if (val.length() > 0) val += ':'; diff -r d3373bc7ca3b -r 2b5adb45aaa5 src/configDialog.h --- a/src/configDialog.h Fri Oct 18 23:49:55 2013 +0300 +++ b/src/configDialog.h Sat Oct 19 00:39:09 2013 +0300 @@ -91,6 +91,7 @@ void slot_setExtProgPath(); void slot_findDownloadFolder(); void buttonClicked (QAbstractButton* button); + void selectPage (int row); }; // ============================================================================= diff -r d3373bc7ca3b -r 2b5adb45aaa5 ui/config.ui --- a/ui/config.ui Fri Oct 18 23:49:55 2013 +0300 +++ b/ui/config.ui Sat Oct 19 00:39:09 2013 +0300 @@ -6,401 +6,354 @@ 0 0 - 561 - 351 + 717 + 328 Settings - + :/icons/settings.png:/icons/settings.png - - - QTabWidget::North - - - 0 - - - Qt::ElideNone - - - false - - - false - - - false - - - - Interface - - + + + + + + 144 + 0 + + + + + 144 + 16777215 + + - - - Colors - - - - - - QFormLayout::ExpandingFieldsGrow - - - - - - - - Main color: - - - - - - - This color is used for the main color. - - - - - - - :/icons/colorselect.png:/icons/colorselect.png - - - - - - - - - - Main color alpha: - - - - - - - Opacity of main color in the viewport. - - - 1 - - - 10 - - - Qt::Horizontal - - - QSlider::TicksAbove - - - 1 - - - - - - - - - - Background: - - - - - - - This is the background color for the viewport. - - - - - - - :/icons/colorselect.png:/icons/colorselect.png - - - - - - - + + Interface + - - - QFormLayout::ExpandingFieldsGrow - - - - - - - - Line thickness: - - - - - - - - - How thick lines should be drawn in the viewport. - - - 1 - - - 8 - - - Qt::Horizontal - - - QSlider::TicksAbove - - - 1 - - - - - - - # - - - - - - + + Profile + + + + + Shortcuts + + + + + Quick colors + + + + + Grids + + + + + External Programs + - + + Downloads + + + + + + + + 0 + + + - - - - - Makes all edgelines appear black. If this is not set, edge lines take their color as defined in LDConfig.ldr. - - - Black edges - - - - - - - Polygons' front sides become green and back sides red. - - - Red/green BFC view (incomplete) - - - - - - - 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. - - - Colorize objects in list view - - - - - - - List implicitly loaded files - - - - - - - - - - - Use logoed studs - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - + + + Interface + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + + + Main color: + + + + + + + This color is used for the main color. + + + + + + + :/icons/colorselect.png:/icons/colorselect.png + + + + + + + + + + Main color alpha: + + + + + + + Opacity of main color in the viewport. + + + 1 + + + 10 + + + Qt::Horizontal + + + QSlider::TicksAbove + + + 1 + + + + + + + + + + Background: + + + + + + + This is the background color for the viewport. + + + + + + + :/icons/colorselect.png:/icons/colorselect.png + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + + + + + How thick lines should be drawn in the viewport. + + + 1 + + + 8 + + + Qt::Horizontal + + + QSlider::TicksAbove + + + 1 + + + + + + + + + + + + Line thickness: + + + + + + + + + + + + + Makes all edgelines appear black. If this is not set, edge lines take their color as defined in LDConfig.ldr. + + + Black edges + + + + + + + Polygons' front sides become green and back sides red. + + + Red/green BFC view (incomplete) + + + + + + + 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. + + + Colorize objects in list view + + + + + + + List implicitly loaded files + + + + + + + + + + + Use logoed studs + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + - - - - - - Profile - - - - - - Profile - - - - - - - - Username: - - - - - - - Name: - - - - - - - License: - - - - - - - - - - - - - - 0 - 0 - - - - - CA - redistributable - + + + + + + + Profile + + + + + + + + Username: + + + + + + + Name: + + + + + + + License: + + - - - NonCA - not redistributable - + + - - - None - + + - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Shortcuts - - - - - - Here you can alter keyboard shortcuts for almost all LDForge actions. Only exceptions are the controls for the viewport. Use the set button to set a key shortcut, clear to remove it and reset to restore the shortcut to its default value. - -Shortcut changes apply immediately after closing this window. - - - Shortcuts - - - - - - Qt::ScrollBarAsNeeded - - - - - - - - - Set - - + + + + + 0 + 0 + + + + + CA - redistributable + + + + + NonCA - not redistributable + + + + + None + + + + + - - - Reset - - - - :/icons/undo.png:/icons/undo.png - - - - - - - Clear - - - - :/icons/delete.png:/icons/delete.png - - - - - + Qt::Vertical @@ -413,237 +366,300 @@ - - - - - - - - - Quick colors - - - - - - Here you can alter the layout of the quick colors toolbar. Use the controls to add, remove or edit the colors used. You can also add separators in between colors. + + + + + + + + + + Here you can alter keyboard shortcuts for almost all LDForge actions. Only exceptions are the controls for the viewport. Use the set button to set a key shortcut, clear to remove it and reset to restore the shortcut to its default value. -Usually this contains MainColor, EdgeColor and some auxiliary colors used to group objects. - - - Quick colors - - - - - - Qt::ScrollBarAsNeeded - - - - - +Shortcut changes apply immediately after closing this window. + + + Shortcuts + + - - - Add Color - - - - :/icons/palette.png:/icons/palette.png - - - - - - - Add Separator + + + Qt::ScrollBarAsNeeded - - - Edit - - - - :/icons/mode-draw.png:/icons/mode-draw.png - - + + + + + Set + + + + + + + Reset + + + + :/icons/undo.png:/icons/undo.png + + + + + + + Clear + + + + :/icons/delete.png:/icons/delete.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + - - - - Qt::Horizontal - - - + + + + + + + + + + + Here you can alter the layout of the quick colors toolbar. Use the controls to add, remove or edit the colors used. You can also add separators in between colors. + +Usually this contains MainColor, EdgeColor and some auxiliary colors used to group objects. + + + Quick colors + + - - - Move Up - - - - :/icons/arrow-up.png:/icons/arrow-up.png - - - - - - - Move Down - - - - :/icons/arrow-down.png:/icons/arrow-down.png - - - - - - - Qt::Horizontal - - - - - - - Remove - - - - :/icons/delete.png:/icons/delete.png + + + Qt::ScrollBarAsNeeded - - - Clear List - - - - :/icons/delete.png:/icons/delete.png - - - - - - - Qt::Vertical - - - - 20 - 40 - - - + + + + + Add Color + + + + :/icons/palette.png:/icons/palette.png + + + + + + + Add Separator + + + + + + + Edit + + + + :/icons/mode-draw.png:/icons/mode-draw.png + + + + + + + Qt::Horizontal + + + + + + + Move Up + + + + :/icons/arrow-up.png:/icons/arrow-up.png + + + + + + + Move Down + + + + :/icons/arrow-down.png:/icons/arrow-down.png + + + + + + + Qt::Horizontal + + + + + + + Remove + + + + :/icons/delete.png:/icons/delete.png + + + + + + + Clear List + + + + :/icons/delete.png:/icons/delete.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + - - - - - - - - - Grids - - - - - - Grids - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - External Programs - - - - - - LDForge supports launching of several third-party utility tools; here you can set the file paths to these tools. Set the paths of the tools to the exe files. - -Under Linux, you can also set the programs to be launched with Wine, so you can use Windows binaries here as well. You will obviously need Wine installed. A 'wine' command in PATH is necessary for this to work. - - - External Programs - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - Downloading - - - - + + + + + + - - - Download path: + + + Grids - + + + Qt::Vertical + + + + 20 + 40 + + + + + + + - - - + + + LDForge supports launching of several third-party utility tools; here you can set the file paths to these tools. Set the paths of the tools to the exe files. + +Under Linux, you can also set the programs to be launched with Wine, so you can use Windows binaries here as well. You will obviously need Wine installed. A 'wine' command in PATH is necessary for this to work. - - - :/icons/folder.png:/icons/folder.png + + External Programs + + + + Qt::Vertical + + + + 20 + 40 + + + + - - - - - <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> + + + + + + + Downloads + + + + + + + + Download path: + + + + + + + + + + + + + + :/icons/folder.png:/icons/folder.png + + + + + + + + + <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> <p>Examples: <ul> @@ -652,38 +668,43 @@ <li>3002s01 -> parts/s/3002s01.dat</li> <li>4-4cyli -> p/4-4cyli.dat</li> </ul></p> - - - Correct and guess part paths - - - - - - - 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. - - - Close download prompt after completion - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - + + + Correct and guess part paths + + + + + + + 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. + + + Close download prompt after completion + + + + + + + Qt::Vertical + + + + 20 + 187 + + + + + + + + + + + + @@ -698,7 +719,7 @@ - +