336 |
336 |
337 // ============================================================================= |
337 // ============================================================================= |
338 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
338 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
339 // ============================================================================= |
339 // ============================================================================= |
340 extern_cfg (str, prog_ytruder); |
340 extern_cfg (str, prog_ytruder); |
|
341 extern_cfg (str, prog_rectifier); |
341 static const struct extProgInfo { |
342 static const struct extProgInfo { |
342 const char* const name, *iconname; |
343 const char* const name, *iconname; |
343 strconfig* const path; |
344 strconfig* const path; |
344 mutable QLineEdit* input; |
345 mutable QLineEdit* input; |
345 mutable QPushButton* setPathButton; |
346 mutable QPushButton* setPathButton; |
346 } g_extProgInfo[] = { |
347 } g_extProgInfo[] = { |
347 { "Ytruder", "ytruder", &prog_ytruder, null, null }, |
348 { "Ytruder", "ytruder", &prog_ytruder, null, null }, |
|
349 { "Rectifier", "rectifier", &prog_rectifier, null, null }, |
348 }; |
350 }; |
349 |
351 |
350 void ConfigDialog::initExtProgTab () { |
352 void ConfigDialog::initExtProgTab () { |
351 QWidget* tab = new QWidget; |
353 QWidget* tab = new QWidget; |
352 QGridLayout* pathsLayout = new QGridLayout; |
354 QGridLayout* pathsLayout = new QGridLayout; |
353 QGroupBox* pathsBox = new QGroupBox ("Paths", this); |
355 QGroupBox* pathsBox = new QGroupBox ("Paths", this); |
354 QVBoxLayout* layout = new QVBoxLayout; |
356 QVBoxLayout* layout = new QVBoxLayout (this); |
355 |
357 |
356 ulong row = 0; |
358 ulong row = 0; |
357 for (const extProgInfo& info : g_extProgInfo) { |
359 for (const extProgInfo& info : g_extProgInfo) { |
358 QLabel* icon = new QLabel, |
360 QLabel* icon = new QLabel, |
359 *progLabel = new QLabel (info.name); |
361 *progLabel = new QLabel (info.name); |
370 |
372 |
371 pathsLayout->addWidget (icon, row, 0); |
373 pathsLayout->addWidget (icon, row, 0); |
372 pathsLayout->addWidget (progLabel, row, 1); |
374 pathsLayout->addWidget (progLabel, row, 1); |
373 pathsLayout->addWidget (input, row, 2); |
375 pathsLayout->addWidget (input, row, 2); |
374 pathsLayout->addWidget (setPathButton, row, 3); |
376 pathsLayout->addWidget (setPathButton, row, 3); |
|
377 ++row; |
375 } |
378 } |
376 |
379 |
377 pathsBox->setLayout (pathsLayout); |
380 pathsBox->setLayout (pathsLayout); |
378 layout->addWidget (pathsBox); |
381 layout->addWidget (pathsBox); |
379 layout->addSpacing (10); |
382 layout->addSpacing (10); |
458 idx = getItemRow (item, quickColorItems) + 1; |
461 idx = getItemRow (item, quickColorItems) + 1; |
459 else |
462 else |
460 idx = quickColorItems.size(); |
463 idx = quickColorItems.size(); |
461 |
464 |
462 quickColorMeta.insert (quickColorMeta.begin() + idx, entry); |
465 quickColorMeta.insert (quickColorMeta.begin() + idx, entry); |
463 entry = &quickColorMeta[idx]; |
466 entry = quickColorMeta[idx]; |
464 } |
467 } |
465 |
468 |
466 updateQuickColorList (entry); |
469 updateQuickColorList (entry); |
467 } |
470 } |
468 |
471 |
729 |
732 |
730 // Set the grid settings |
733 // Set the grid settings |
731 for (int i = 0; i < g_NumGrids; ++i) |
734 for (int i = 0; i < g_NumGrids; ++i) |
732 for (int j = 0; j < 4; ++j) |
735 for (int j = 0; j < 4; ++j) |
733 g_GridInfo[i].confs[j]->value = dlg.dsb_gridData[i][j]->value (); |
736 g_GridInfo[i].confs[j]->value = dlg.dsb_gridData[i][j]->value (); |
|
737 |
|
738 // Ext program settings |
|
739 for (const extProgInfo& info : g_extProgInfo) |
|
740 *info.path = info.input->text (); |
734 |
741 |
735 // Save the config |
742 // Save the config |
736 config::save (); |
743 config::save (); |
737 |
744 |
738 // Reload all subfiles as the ldraw path potentially changed. |
745 // Reload all subfiles as the ldraw path potentially changed. |