Skip to content

Commit

Permalink
feat: implement checkbox for supports wall creation (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjonok authored Oct 11, 2024
1 parent c5c0727 commit afeefa6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ class Locale:
RemoveFirstPlaneError = "First figure cannot be removed"
CannotDropHere = "Figure cannot be dropped here"

ShouldCreateWalls = "Create wall in support"

def __init__(self, **entries):
self.__dict__.update(entries)

Expand Down Expand Up @@ -297,6 +299,7 @@ def __init__(self, **entries):
RemoveFirstPlaneError="Первая фигура не может быть убрана",
WarningPathNotClosed="При разрезании модели были обнаружены незамкнутые участки! Проверьте корректность расположения фигур",
CannotDropHere="Фигура не может быть перенесена сюда",
ShouldCreateWalls="Создавать стенки в поддержках",
),
}

Expand Down
20 changes: 20 additions & 0 deletions src/settings_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class SettingsWidget(QWidget):
"support_priority_zoffset",
"support_number_of_bottom_layers",
"support_number_of_lid_layers",
"support_create_walls",
"critical_angle",
]

Expand Down Expand Up @@ -1260,6 +1261,25 @@ def on_change():
"label": angle_label,
"edit": angle_value,
}
elif name == "support_create_walls":
self.ensure_sett("supports.create_walls")

create_walls_label = QLabel(self.locale.ShouldCreateWalls)
create_walls_box = QCheckBox()
if self.sett().supports.create_walls:
create_walls_box.setCheckState(QtCore.Qt.Checked)
self.panel.addWidget(create_walls_label, self.next_row, 1)
self.panel.addWidget(create_walls_box, self.cur_row, 2, 1, self.col2_cells)

def on_change():
self.sett().supports.create_walls = create_walls_box.isChecked()

create_walls_box.stateChanged.connect(on_change)

self.__elements[name] = {
"label": create_walls_label,
"checkbox": create_walls_box,
}

# add row index for element
self.__elements[name]["row_idx"] = self.cur_row
Expand Down

0 comments on commit afeefa6

Please sign in to comment.