"
153 | )
154 | attributionTextField.setMaximumHeight(200)
155 | attributionTextField.setMinimumWidth(350)
156 | layout.addWidget(attributionTextField)
157 |
158 | for i in range(0, layout.count()):
159 | layout.itemAt(i).setAlignment(Qt.AlignHCenter)
160 |
161 | layout.addWidget(self.buttonBox)
162 |
163 | self.setLayout(layout)
164 | self.exec_()
165 |
166 |
167 | class SliceProgressDialog(QWidget):
168 | def __init__(self, close_signal):
169 | QWidget.__init__(self)
170 |
171 | layout = QVBoxLayout()
172 |
173 | self.setGeometry(0, 0, 200, 75)
174 | rect = self.frameGeometry()
175 | centerCoord = QDesktopWidget().availableGeometry().center()
176 | rect.moveCenter(centerCoord)
177 | self.move(rect.topLeft())
178 |
179 | self.message = QLabel("Slicing...")
180 | self.progress_bar = QProgressBar(self)
181 | self.progress_bar.setRange(0, 0)
182 |
183 | layout.addWidget(self.message)
184 | layout.addWidget(self.progress_bar)
185 |
186 | self.setLayout(layout)
187 | close_signal.connect(self.close_progress_dialog)
188 | self.show()
189 |
190 | def close_progress_dialog(self):
191 | self.message.setText("Complete")
192 | self.progress_bar.setRange(0, 1)
193 | self.hide()
194 |
195 |
196 | class SliceErrorDialog(QMessageBox):
197 | def __init__(self, inform_text, detailed_text=None):
198 | QMessageBox.__init__(self)
199 | self.setIcon(QMessageBox.Critical)
200 | self.setText("Error")
201 | self.setWindowTitle("Error")
202 | self.setInformativeText(f"{inform_text}")
203 | if detailed_text:
204 | self.setDetailedText(f"{detailed_text}")
205 | self.setStandardButtons(QMessageBox.Ok)
206 | self.exec_()
207 |
--------------------------------------------------------------------------------
/src/slice/ui/widgets.py:
--------------------------------------------------------------------------------
1 | # This file is part of Slice.
2 | #
3 | # Slice is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU General Public License as published by
5 | # the Free Software Foundation, either version 3 of the License, or
6 | # (at your option) any later version.
7 | #
8 | # Slice is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU General Public License for more details.
12 | #
13 | # You should have received a copy of the GNU General Public License
14 | # along with Slice. If not, see