| 87 | } |
| 88 | |
| 89 | void PocketOffsetForm::createFile() |
| 90 | { |
| 91 | const Tool tool[] { |
| 92 | ui->toolHolder->tool(), |
| 93 | ui->toolHolder2->tool(), |
| 94 | ui->toolHolder3->tool(), |
| 95 | ui->toolHolder4->tool() |
| 96 | }; |
| 97 | |
| 98 | for (const Tool& t : tool) { |
| 99 | if (!t.isValid()) { |
| 100 | t.errorMessageBox(this); |
| 101 | return; |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | // if (ui->chbxUseTwoTools->isChecked() && !tool2.isValid()) { |
| 106 | // tool2.errorMessageBox(this); |
| 107 | // return; |
| 108 | // } |
| 109 | |
| 110 | Paths wPaths; |
| 111 | Paths wRawPaths; |
| 112 | FileInterface const* file = nullptr; |
| 113 | bool skip { true }; |
| 114 | |
| 115 | for (auto* item : App::scene()->selectedItems()) { |
| 116 | GraphicsItem* gi = dynamic_cast<GraphicsItem*>(item); |
| 117 | switch (static_cast<GiType>(item->type())) { |
| 118 | case GiType::DataSolid: |
| 119 | case GiType::DataPath: |
| 120 | if (!file) { |
| 121 | file = gi->file(); |
| 122 | boardSide = file->side(); |
| 123 | } else if (file != gi->file()) { |
| 124 | if (skip) { |
| 125 | if ((skip = (QMessageBox::question(this, tr("Warning"), tr("Work items from different files!\nWould you like to continue?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::No))) |
| 126 | return; |
| 127 | } |
| 128 | } |
| 129 | if (static_cast<GiType>(item->type()) == GiType::DataSolid) |
| 130 | wPaths.append(gi->paths()); |
| 131 | else |
| 132 | wRawPaths.append(gi->paths()); |
| 133 | break; |
| 134 | case GiType::ShCircle: |
| 135 | case GiType::ShRectangle: |
| 136 | case GiType::ShPolyLine: |
| 137 | case GiType::ShCirArc: |
| 138 | case GiType::ShText: |
| 139 | wRawPaths.append(gi->paths()); |
| 140 | break; |
| 141 | case GiType::Drill: |
| 142 | wPaths.append(gi->paths()); |
| 143 | break; |
| 144 | default: |
| 145 | break; |
| 146 | } |
nothing calls this directly
no test coverage detected