|
12 | 12 | #
|
13 | 13 | # You should have received a copy of the GNU General Public License
|
14 | 14 | # along with Slice. If not, see <https://www.gnu.org/licenses/>.
|
15 |
| - |
16 | 15 | from fontTools import __version__ as fonttools_version
|
17 | 16 | from PyQt5.QtCore import QDir, Qt
|
18 | 17 | from PyQt5.QtGui import QFont, QFontDatabase, QIcon, QImage, QPixmap
|
19 | 18 | from PyQt5.QtWidgets import (
|
| 19 | + QDesktopWidget, |
20 | 20 | QDialog,
|
21 | 21 | QDialogButtonBox,
|
22 | 22 | QFileDialog,
|
23 | 23 | QLabel,
|
24 | 24 | QMessageBox,
|
| 25 | + QProgressBar, |
25 | 26 | QTextBrowser,
|
26 | 27 | QVBoxLayout,
|
| 28 | + QWidget, |
27 | 29 | )
|
28 | 30 |
|
29 | 31 | from ..imageresources import *
|
@@ -153,6 +155,35 @@ def __init__(self, version):
|
153 | 155 | self.exec_()
|
154 | 156 |
|
155 | 157 |
|
| 158 | +class SliceProgressDialog(QWidget): |
| 159 | + def __init__(self, close_signal): |
| 160 | + QWidget.__init__(self) |
| 161 | + |
| 162 | + layout = QVBoxLayout() |
| 163 | + |
| 164 | + self.setGeometry(0, 0, 200, 75) |
| 165 | + rect = self.frameGeometry() |
| 166 | + centerCoord = QDesktopWidget().availableGeometry().center() |
| 167 | + rect.moveCenter(centerCoord) |
| 168 | + self.move(rect.topLeft()) |
| 169 | + |
| 170 | + self.message = QLabel("Slicing...") |
| 171 | + self.progress_bar = QProgressBar(self) |
| 172 | + self.progress_bar.setRange(0, 0) |
| 173 | + |
| 174 | + layout.addWidget(self.message) |
| 175 | + layout.addWidget(self.progress_bar) |
| 176 | + |
| 177 | + self.setLayout(layout) |
| 178 | + close_signal.connect(self.close_progress_dialog) |
| 179 | + self.show() |
| 180 | + |
| 181 | + def close_progress_dialog(self): |
| 182 | + self.message.setText("Complete") |
| 183 | + self.progress_bar.setRange(0, 1) |
| 184 | + self.hide() |
| 185 | + |
| 186 | + |
156 | 187 | class SliceErrorDialog(QMessageBox):
|
157 | 188 | def __init__(self, inform_text, detailed_text=None):
|
158 | 189 | QMessageBox.__init__(self)
|
|
0 commit comments