Skip to content

Commit

Permalink
Merge pull request #23 from GIAPspzoo/main_Patryk_blad
Browse files Browse the repository at this point in the history
Wyeliminowanie błędów python przy braku pliku json
  • Loading branch information
eryk918 authored Aug 2, 2022
2 parents cf00435 + efe5d37 commit 17e2b4a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
11 changes: 8 additions & 3 deletions QuickPrint.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,15 @@ def __init__(self, iface : QgisInterface, parent : QtWidgets=None) -> None:
self.dialog.paperFormatComboBox.currentIndexChanged.connect(
self.create_composer)
self.setup_rubberband()
if Config().setts['font_changed']:
self.set_font_quickprint(QSettings().value("qgis/stylesheet/fontPointSize"))
self.conf = Config()
if 'font_changed' in self.conf.setts.keys():
if self.conf.setts['font_changed']:
self.set_font_quickprint(QSettings().value("qgis/stylesheet/fontPointSize"))
else:
self.conf.set_value('font_changed', False)
self.conf.save_config()

def set_font_quickprint(self, font_size):
def set_font_quickprint(self, font_size: str) -> None:
attributes = [self.dialog.label_side, self.dialog.title_label,
self.dialog.cancelPushButton, self.dialog.previewPushButton,
self.dialog.savePushButton, self.dialog.calendar]
Expand Down
16 changes: 11 additions & 5 deletions giap_dynamic_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def edit_session_toggle(self, ask: bool=False) -> None:
self.edit_session = not self.edit_session
if not hasattr(self, 'conf'):
self.conf = Config()
if ask and self.conf.setts[
if 'ribbons_config' in self.conf.setts and ask and self.conf.setts[
'ribbons_config'] != self.generate_ribbon_config():
self.save = CustomMessageBox(None, tr(
"Do you want to save your changes?")).button_yes_no()
Expand Down Expand Up @@ -206,8 +206,11 @@ def _section_control(self, tabind: int) -> None:
scrll = QScrollArea(self)
scrll.setWidgetResizable(True)
scrll.setWidget(self.instr)
value = QSettings().value("qgis/stylesheet/fontPointSize") if \
self.conf.setts["font_changed"] else 9
if 'font_changed' in self.conf.setts.keys():
value = QSettings().value("qgis/stylesheet/fontPointSize") if \
self.conf.setts["font_changed"] else 9
else:
value = 9
self.instr.setStyleSheet(
f"""QFrame, QLabel, QToolTip, QTextEdit{{
font:{value}pt}}"""
Expand Down Expand Up @@ -1158,8 +1161,11 @@ def __init__(self, lab: str, parent: QtWidgets=None) -> None:
self.setAttribute(Qt.WA_DeleteOnClose)
self.setText(lab)
self.conf = Config()
value = QSettings().value("qgis/stylesheet/fontPointSize") if \
self.conf.setts["font_changed"] else 10
if 'font_changed' in self.conf.setts.keys():
value = QSettings().value("qgis/stylesheet/fontPointSize") if \
self.conf.setts["font_changed"] else 10
else:
value = 10
self.setStyleSheet(
f'font:{value}pt "Segoe UI"; font-weight: normal; '
)
Expand Down
12 changes: 9 additions & 3 deletions giap_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,16 @@ def __init__(self, iface: iface) -> None:
self.style_manager_dlg = StyleManagerDialog(self.style_manager)
self.font_size = QSettings().value("qgis/stylesheet/fontPointSize")
self.kompozycje = CompositionsTool(self.iface, self)
if "font_changed" not in self.config.setts:
self.config.set_value('font_changed', False)
self.config.save_config()
if self.config.setts['font_changed']:
CustomLabel(tr('New section')).setStyleSheet(f'font: {self.font_size}pt;')
self.kompozycje_widget.setStyleSheet(f'font: {self.font_size}pt;')
self.main_widget.pokaz_warstwy.setStyleSheet(f'font: {self.font_size}pt;')
CustomLabel(tr('New section')).setStyleSheet(
f'font: {self.font_size}pt;')
self.kompozycje_widget.setStyleSheet(
f'font: {self.font_size}pt;')
self.main_widget.pokaz_warstwy.setStyleSheet(
f'font: {self.font_size}pt;')
self.setfont_settings_dialog()
self.setfont_styles_dialog()

Expand Down

0 comments on commit 17e2b4a

Please sign in to comment.