개정판 8c60f9d8
issue #000 옵션 다이얼로그 창에서 Image/SVG 선택 그리고 해당 데이터로 Report 진행되도록 변경.
HYTOS/HYTOS/MainWindow.py | ||
---|---|---|
1455 | 1455 |
old_callout_text_color = configs[0].value if configs and len(configs) == 1 else '#000000' |
1456 | 1456 |
|
1457 | 1457 |
dlg = QOptionsDialog(self) |
1458 |
dlg.setWindowFlags(dlg.windowFlags() & ~Qt.WindowContextHelpButtonHint) |
|
1459 | 1458 |
if QDialog.Accepted == dlg.exec_(): |
1460 | 1459 |
if app_doc_data.activeDrawing: |
1461 | 1460 |
if str(old_tag_font_size) != str(dlg.tag_font_size) or \ |
... | ... | |
1597 | 1596 |
configs = app_doc_data.getAppConfigs('option', 'ReportDrawing') |
1598 | 1597 |
if configs and configs[0].value: |
1599 | 1598 |
report_drawing = configs[0].value |
1600 |
report_drawing = MainWindow.USE_SVG #TODO: force to set report drawing to USE_IMAGE |
|
1599 |
|
|
1600 |
if report_drawing == MainWindow.USE_IMAGE: #TODO: force to set report drawing to USE_IMAGE |
|
1601 |
report_drawing = MainWindow.USE_IMAGE |
|
1602 |
else: |
|
1603 |
report_drawing == MainWindow.USE_SVG |
|
1604 |
|
|
1601 | 1605 |
|
1602 | 1606 |
report_drawing_path = None |
1603 | 1607 |
report_drawing_path_image = None |
HYTOS/HYTOS/OptionsDialog.py | ||
---|---|---|
22 | 22 |
|
23 | 23 |
def __init__(self, parent): |
24 | 24 |
QDialog.__init__(self, parent) |
25 |
|
|
26 | 25 |
self.ui = Options_UI.Ui_OptionsDialog() |
27 | 26 |
self.ui.setupUi(self) |
28 | 27 |
self.ui.buttonBox.button(QDialogButtonBox.Ok).setIcon(QtGui.QIcon(':/images/OK.svg')) |
... | ... | |
36 | 35 |
self.ui.pushButton_TagFontColor.clicked.connect(self.show_color_dialog) |
37 | 36 |
self.ui.pushButtonCalloutTextColor.clicked.connect(self.show_color_dialog) |
38 | 37 |
self.ui.toolButton_WorkSpace.clicked.connect(self.selectWorkSpaceClick) |
39 |
self.initTagFontColor() |
|
40 |
self.initWorkSpace() |
|
41 | 38 |
|
42 | 39 |
self._tag_font_size = None |
43 | 40 |
self._tag_text_color = None |
44 | 41 |
self._callout_font_size = None |
45 | 42 |
self._callout_text_color = None |
46 | 43 |
|
44 |
self.initTagFontColor() |
|
45 |
self.initWorkSpace() |
|
46 |
|
|
47 | 47 |
self.load_data() |
48 | 48 |
|
49 | 49 |
@property |
... | ... | |
132 | 132 |
configs = app_doc_data.getAppConfigs('app', 'update_url') |
133 | 133 |
if configs and configs[0].value: |
134 | 134 |
self.ui.lineEditUpdateURL.setText(configs[0].value) |
135 |
|
|
136 |
""" TODO: disable this option |
|
137 | 135 |
configs = app_doc_data.getAppConfigs('option', 'ReportDrawing') |
136 |
|
|
138 | 137 |
if configs and configs[0].value: |
139 | 138 |
self.ui.radioButtonUseImage.setChecked(configs[0].value == 'Use Image') |
140 | 139 |
self.ui.radioButtonUseSVG.setChecked(configs[0].value == 'Use SVG') |
141 |
""" |
|
140 |
|
|
142 | 141 |
except Exception as ex: |
143 | 142 |
from App import App |
144 | 143 |
from AppDocData import MessageType |
... | ... | |
159 | 158 |
self._callout_text_color = self.ui.pushButtonCalloutTextColor.palette().color(QPalette.Background).name() |
160 | 159 |
text_checked = self.ui.checkBoxTextBold.isChecked() |
161 | 160 |
callout_checked = self.ui.checkBoxCalloutBold.isChecked() |
162 |
report_drawing = 'Use Image' if self.ui.radioButtonUseImage.isChecked() else 'Use SVG' |
|
161 |
|
|
162 |
if self.ui.radioButtonUseImage.isChecked(): |
|
163 |
report_drawing = 'Use Image' |
|
164 |
if self.ui.radioButtonUseSVG.isChecked(): |
|
165 |
report_drawing = 'Use SVG' |
|
163 | 166 |
|
164 | 167 |
configs.append(Config('option', 'WorkSpace', self.ui.lineEdit_WorkSpace.text())) |
165 | 168 |
configs.append(Config('option', 'TagFontSize', self._tag_font_size)) |
HYTOS/HYTOS/Options_UI.py | ||
---|---|---|
1 | 1 |
# -*- coding: utf-8 -*- |
2 | 2 |
|
3 |
# Form implementation generated from reading ui file '.\UI\Options.ui'
|
|
3 |
# Form implementation generated from reading ui file 'Ui\Options.ui'
|
|
4 | 4 |
# |
5 |
# Created by: PyQt5 UI code generator 5.15.2
|
|
5 |
# Created by: PyQt5 UI code generator 5.15.6
|
|
6 | 6 |
# |
7 | 7 |
# WARNING: Any manual changes made to this file will be lost when pyuic5 is |
8 | 8 |
# run again. Do not edit this file unless you know what you are doing. |
... | ... | |
23 | 23 |
OptionsDialog.setWindowIcon(icon) |
24 | 24 |
self.gridLayout_2 = QtWidgets.QGridLayout(OptionsDialog) |
25 | 25 |
self.gridLayout_2.setObjectName("gridLayout_2") |
26 |
self.buttonBox = QtWidgets.QDialogButtonBox(OptionsDialog) |
|
27 |
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) |
|
28 |
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) |
|
29 |
self.buttonBox.setObjectName("buttonBox") |
|
30 |
self.gridLayout_2.addWidget(self.buttonBox, 5, 0, 1, 1) |
|
31 |
self.gridLayout_4 = QtWidgets.QGridLayout() |
|
32 |
self.gridLayout_4.setObjectName("gridLayout_4") |
|
33 |
self.lineEditUpdateURL = QtWidgets.QLineEdit(OptionsDialog) |
|
34 |
self.lineEditUpdateURL.setObjectName("lineEditUpdateURL") |
|
35 |
self.gridLayout_4.addWidget(self.lineEditUpdateURL, 1, 1, 1, 1) |
|
36 |
self.label_6 = QtWidgets.QLabel(OptionsDialog) |
|
37 |
self.label_6.setObjectName("label_6") |
|
38 |
self.gridLayout_4.addWidget(self.label_6, 1, 0, 1, 1) |
|
39 |
self.label_7 = QtWidgets.QLabel(OptionsDialog) |
|
40 |
self.label_7.setObjectName("label_7") |
|
41 |
self.gridLayout_4.addWidget(self.label_7, 0, 0, 1, 1) |
|
42 |
self.gridLayout_5 = QtWidgets.QGridLayout() |
|
43 |
self.gridLayout_5.setObjectName("gridLayout_5") |
|
44 |
self.radioButtonUseImage = QtWidgets.QRadioButton(OptionsDialog) |
|
45 |
self.radioButtonUseImage.setChecked(True) |
|
46 |
self.radioButtonUseImage.setObjectName("radioButtonUseImage") |
|
47 |
self.gridLayout_5.addWidget(self.radioButtonUseImage, 0, 0, 1, 1) |
|
48 |
self.radioButtonUseSVG = QtWidgets.QRadioButton(OptionsDialog) |
|
49 |
self.radioButtonUseSVG.setEnabled(False) |
|
50 |
self.radioButtonUseSVG.setObjectName("radioButtonUseSVG") |
|
51 |
self.gridLayout_5.addWidget(self.radioButtonUseSVG, 0, 1, 1, 1) |
|
52 |
self.gridLayout_4.addLayout(self.gridLayout_5, 0, 1, 1, 1) |
|
53 |
self.gridLayout_2.addLayout(self.gridLayout_4, 3, 0, 1, 1) |
|
54 | 26 |
self.groupBox = QtWidgets.QGroupBox(OptionsDialog) |
55 | 27 |
font = QtGui.QFont() |
56 | 28 |
font.setBold(True) |
... | ... | |
173 | 145 |
self.gridLayout_8.addWidget(self.checkBoxTextBold, 0, 2, 1, 1) |
174 | 146 |
self.gridLayout_3.addLayout(self.gridLayout_8, 0, 0, 1, 1) |
175 | 147 |
self.gridLayout_2.addWidget(self.groupBox_2, 0, 0, 1, 1) |
148 |
self.gridLayout_4 = QtWidgets.QGridLayout() |
|
149 |
self.gridLayout_4.setObjectName("gridLayout_4") |
|
150 |
self.lineEditUpdateURL = QtWidgets.QLineEdit(OptionsDialog) |
|
151 |
self.lineEditUpdateURL.setObjectName("lineEditUpdateURL") |
|
152 |
self.gridLayout_4.addWidget(self.lineEditUpdateURL, 1, 1, 1, 1) |
|
153 |
self.label_6 = QtWidgets.QLabel(OptionsDialog) |
|
154 |
self.label_6.setObjectName("label_6") |
|
155 |
self.gridLayout_4.addWidget(self.label_6, 1, 0, 1, 1) |
|
156 |
self.label_7 = QtWidgets.QLabel(OptionsDialog) |
|
157 |
self.label_7.setObjectName("label_7") |
|
158 |
self.gridLayout_4.addWidget(self.label_7, 0, 0, 1, 1) |
|
159 |
self.gridLayout_5 = QtWidgets.QGridLayout() |
|
160 |
self.gridLayout_5.setObjectName("gridLayout_5") |
|
161 |
self.radioButtonUseImage = QtWidgets.QRadioButton(OptionsDialog) |
|
162 |
self.radioButtonUseImage.setChecked(True) |
|
163 |
self.radioButtonUseImage.setObjectName("radioButtonUseImage") |
|
164 |
self.gridLayout_5.addWidget(self.radioButtonUseImage, 0, 0, 1, 1) |
|
165 |
self.radioButtonUseSVG = QtWidgets.QRadioButton(OptionsDialog) |
|
166 |
self.radioButtonUseSVG.setObjectName("radioButtonUseSVG") |
|
167 |
self.gridLayout_5.addWidget(self.radioButtonUseSVG, 0, 1, 1, 1) |
|
168 |
self.gridLayout_4.addLayout(self.gridLayout_5, 0, 1, 1, 1) |
|
169 |
self.gridLayout_2.addLayout(self.gridLayout_4, 3, 0, 1, 1) |
|
170 |
self.buttonBox = QtWidgets.QDialogButtonBox(OptionsDialog) |
|
171 |
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) |
|
172 |
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) |
|
173 |
self.buttonBox.setObjectName("buttonBox") |
|
174 |
self.gridLayout_2.addWidget(self.buttonBox, 5, 0, 1, 1) |
|
176 | 175 |
|
177 | 176 |
self.retranslateUi(OptionsDialog) |
178 |
self.buttonBox.accepted.connect(OptionsDialog.accept)
|
|
179 |
self.buttonBox.rejected.connect(OptionsDialog.reject)
|
|
177 |
self.buttonBox.rejected.connect(OptionsDialog.reject) # type: ignore
|
|
178 |
self.buttonBox.accepted.connect(OptionsDialog.accept) # type: ignore
|
|
180 | 179 |
QtCore.QMetaObject.connectSlotsByName(OptionsDialog) |
181 | 180 |
OptionsDialog.setTabOrder(self.comboBox_TagFontSize, self.pushButton_TagFontColor) |
182 | 181 |
OptionsDialog.setTabOrder(self.pushButton_TagFontColor, self.comboBoxCalloutFontSize) |
... | ... | |
187 | 186 |
def retranslateUi(self, OptionsDialog): |
188 | 187 |
_translate = QtCore.QCoreApplication.translate |
189 | 188 |
OptionsDialog.setWindowTitle(_translate("OptionsDialog", "Options")) |
190 |
self.label_6.setText(_translate("OptionsDialog", "Update URL : ")) |
|
191 |
self.label_7.setText(_translate("OptionsDialog", "Report : ")) |
|
192 |
self.radioButtonUseImage.setText(_translate("OptionsDialog", "Use Image")) |
|
193 |
self.radioButtonUseSVG.setText(_translate("OptionsDialog", "Use SVG")) |
|
194 | 189 |
self.groupBox.setTitle(_translate("OptionsDialog", "Directory")) |
195 | 190 |
self.label_2.setText(_translate("OptionsDialog", "Work Space :")) |
196 | 191 |
self.toolButton_WorkSpace.setText(_translate("OptionsDialog", "...")) |
... | ... | |
220 | 215 |
self.comboBox_TagFontSize.setItemText(8, _translate("OptionsDialog", "13")) |
221 | 216 |
self.label_3.setText(_translate("OptionsDialog", "Text Color :")) |
222 | 217 |
self.checkBoxTextBold.setText(_translate("OptionsDialog", "Bold")) |
218 |
self.label_6.setText(_translate("OptionsDialog", "Update URL : ")) |
|
219 |
self.label_7.setText(_translate("OptionsDialog", "Report : ")) |
|
220 |
self.radioButtonUseImage.setText(_translate("OptionsDialog", "Use Image")) |
|
221 |
self.radioButtonUseSVG.setText(_translate("OptionsDialog", "Use SVG")) |
|
223 | 222 |
import Resource_rc |
HYTOS/HYTOS/UI/Options.ui | ||
---|---|---|
23 | 23 |
<normaloff>:/images/HYTOS.png</normaloff>:/images/HYTOS.png</iconset> |
24 | 24 |
</property> |
25 | 25 |
<layout class="QGridLayout" name="gridLayout_2"> |
26 |
<item row="5" column="0"> |
|
27 |
<widget class="QDialogButtonBox" name="buttonBox"> |
|
28 |
<property name="orientation"> |
|
29 |
<enum>Qt::Horizontal</enum> |
|
30 |
</property> |
|
31 |
<property name="standardButtons"> |
|
32 |
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
|
33 |
</property> |
|
34 |
</widget> |
|
35 |
</item> |
|
36 |
<item row="3" column="0"> |
|
37 |
<layout class="QGridLayout" name="gridLayout_4"> |
|
38 |
<item row="1" column="1"> |
|
39 |
<widget class="QLineEdit" name="lineEditUpdateURL"/> |
|
40 |
</item> |
|
41 |
<item row="1" column="0"> |
|
42 |
<widget class="QLabel" name="label_6"> |
|
43 |
<property name="text"> |
|
44 |
<string>Update URL : </string> |
|
45 |
</property> |
|
46 |
</widget> |
|
47 |
</item> |
|
48 |
<item row="0" column="0"> |
|
49 |
<widget class="QLabel" name="label_7"> |
|
50 |
<property name="text"> |
|
51 |
<string>Report : </string> |
|
52 |
</property> |
|
53 |
</widget> |
|
54 |
</item> |
|
55 |
<item row="0" column="1"> |
|
56 |
<layout class="QGridLayout" name="gridLayout_5"> |
|
57 |
<item row="0" column="0"> |
|
58 |
<widget class="QRadioButton" name="radioButtonUseImage"> |
|
59 |
<property name="text"> |
|
60 |
<string>Use Image</string> |
|
61 |
</property> |
|
62 |
<property name="checked"> |
|
63 |
<bool>true</bool> |
|
64 |
</property> |
|
65 |
</widget> |
|
66 |
</item> |
|
67 |
<item row="0" column="1"> |
|
68 |
<widget class="QRadioButton" name="radioButtonUseSVG"> |
|
69 |
<property name="enabled"> |
|
70 |
<bool>false</bool> |
|
71 |
</property> |
|
72 |
<property name="text"> |
|
73 |
<string>Use SVG</string> |
|
74 |
</property> |
|
75 |
</widget> |
|
76 |
</item> |
|
77 |
</layout> |
|
78 |
</item> |
|
79 |
</layout> |
|
80 |
</item> |
|
81 | 26 |
<item row="2" column="0"> |
82 | 27 |
<widget class="QGroupBox" name="groupBox"> |
83 | 28 |
<property name="font"> |
... | ... | |
388 | 333 |
</layout> |
389 | 334 |
</widget> |
390 | 335 |
</item> |
336 |
<item row="3" column="0"> |
|
337 |
<layout class="QGridLayout" name="gridLayout_4"> |
|
338 |
<item row="1" column="1"> |
|
339 |
<widget class="QLineEdit" name="lineEditUpdateURL"/> |
|
340 |
</item> |
|
341 |
<item row="1" column="0"> |
|
342 |
<widget class="QLabel" name="label_6"> |
|
343 |
<property name="text"> |
|
344 |
<string>Update URL : </string> |
|
345 |
</property> |
|
346 |
</widget> |
|
347 |
</item> |
|
348 |
<item row="0" column="0"> |
|
349 |
<widget class="QLabel" name="label_7"> |
|
350 |
<property name="text"> |
|
351 |
<string>Report : </string> |
|
352 |
</property> |
|
353 |
</widget> |
|
354 |
</item> |
|
355 |
<item row="0" column="1"> |
|
356 |
<layout class="QGridLayout" name="gridLayout_5"> |
|
357 |
<item row="0" column="0"> |
|
358 |
<widget class="QRadioButton" name="radioButtonUseImage"> |
|
359 |
<property name="text"> |
|
360 |
<string>Use Image</string> |
|
361 |
</property> |
|
362 |
<property name="checked"> |
|
363 |
<bool>true</bool> |
|
364 |
</property> |
|
365 |
</widget> |
|
366 |
</item> |
|
367 |
<item row="0" column="1"> |
|
368 |
<widget class="QRadioButton" name="radioButtonUseSVG"> |
|
369 |
<property name="text"> |
|
370 |
<string>Use SVG</string> |
|
371 |
</property> |
|
372 |
</widget> |
|
373 |
</item> |
|
374 |
</layout> |
|
375 |
</item> |
|
376 |
</layout> |
|
377 |
</item> |
|
378 |
<item row="5" column="0"> |
|
379 |
<widget class="QDialogButtonBox" name="buttonBox"> |
|
380 |
<property name="orientation"> |
|
381 |
<enum>Qt::Horizontal</enum> |
|
382 |
</property> |
|
383 |
<property name="standardButtons"> |
|
384 |
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
|
385 |
</property> |
|
386 |
</widget> |
|
387 |
</item> |
|
391 | 388 |
</layout> |
392 | 389 |
</widget> |
393 | 390 |
<tabstops> |
... | ... | |
404 | 401 |
<connections> |
405 | 402 |
<connection> |
406 | 403 |
<sender>buttonBox</sender> |
407 |
<signal>accepted()</signal>
|
|
404 |
<signal>rejected()</signal>
|
|
408 | 405 |
<receiver>OptionsDialog</receiver> |
409 |
<slot>accept()</slot>
|
|
406 |
<slot>reject()</slot>
|
|
410 | 407 |
<hints> |
411 | 408 |
<hint type="sourcelabel"> |
412 |
<x>248</x>
|
|
413 |
<y>254</y>
|
|
409 |
<x>316</x>
|
|
410 |
<y>260</y>
|
|
414 | 411 |
</hint> |
415 | 412 |
<hint type="destinationlabel"> |
416 |
<x>157</x>
|
|
413 |
<x>286</x>
|
|
417 | 414 |
<y>274</y> |
418 | 415 |
</hint> |
419 | 416 |
</hints> |
420 | 417 |
</connection> |
421 | 418 |
<connection> |
422 | 419 |
<sender>buttonBox</sender> |
423 |
<signal>rejected()</signal>
|
|
420 |
<signal>accepted()</signal>
|
|
424 | 421 |
<receiver>OptionsDialog</receiver> |
425 |
<slot>reject()</slot>
|
|
422 |
<slot>accept()</slot>
|
|
426 | 423 |
<hints> |
427 | 424 |
<hint type="sourcelabel"> |
428 |
<x>316</x>
|
|
429 |
<y>260</y>
|
|
425 |
<x>248</x>
|
|
426 |
<y>254</y>
|
|
430 | 427 |
</hint> |
431 | 428 |
<hint type="destinationlabel"> |
432 |
<x>286</x>
|
|
429 |
<x>157</x>
|
|
433 | 430 |
<y>274</y> |
434 | 431 |
</hint> |
435 | 432 |
</hints> |
내보내기 Unified diff