diff options
author | Blaine | 2020-06-10 19:54:37 +0530 |
---|---|---|
committer | Blaine | 2020-06-10 19:54:37 +0530 |
commit | a8f63cfd34be8c42917f560db8d0f37598fb47c6 (patch) | |
tree | 037a5af5abbaab914ef7967c807be85cb692eea6 /src/main/python/utils/dialogs.py | |
parent | 45d43b577803f2907fdc099d34bc21d9b7b9653c (diff) | |
download | Chemical-PFD-a8f63cfd34be8c42917f560db8d0f37598fb47c6.tar.gz Chemical-PFD-a8f63cfd34be8c42917f560db8d0f37598fb47c6.tar.bz2 Chemical-PFD-a8f63cfd34be8c42917f560db8d0f37598fb47c6.zip |
landscape mode
Diffstat (limited to 'src/main/python/utils/dialogs.py')
-rw-r--r-- | src/main/python/utils/dialogs.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/main/python/utils/dialogs.py b/src/main/python/utils/dialogs.py index fa3b5f1..79685c5 100644 --- a/src/main/python/utils/dialogs.py +++ b/src/main/python/utils/dialogs.py @@ -1,12 +1,16 @@ -from PyQt5.QtWidgets import QDialog, QPushButton, QFormLayout, QComboBox, QLabel, QMessageBox, QDialogButtonBox, QHBoxLayout -from .data import sheetDimensionList, ppiList +from PyQt5.QtWidgets import (QCheckBox, QComboBox, QDialog, QDialogButtonBox, + QFormLayout, QHBoxLayout, QLabel, QMessageBox, + QPushButton) + +from .data import ppiList, sheetDimensionList + class paperDims(QDialog): """ Utility dialog box to adjust the current canvas's dimensions, might return just dimensions later so that sizes do not need to be imported in every other module. """ - def __init__(self, parent=None, size='A4', ppi='72', name='Canvas Size'): + def __init__(self, parent=None, size='A4', ppi='72', name='Canvas Size', landscape=False): super(paperDims, self).__init__(parent) #store initial values to show currently set value, also updated when changed. these are returned at EOL @@ -36,6 +40,10 @@ class paperDims(QDialog): dialogBoxLayout.setWidget(1, QFormLayout.LabelRole, ppiLabel) dialogBoxLayout.setWidget(1, QFormLayout.FieldRole, ppiComboBox) + self.landscapeCheckBox = QCheckBox('&Landscape Mode') + self.landscapeCheckBox.setChecked(landscape) + dialogBoxLayout.setWidget(2, QFormLayout.SpanningRole, self.landscapeCheckBox) + # add ok and cancel buttons buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self) buttonBox.accepted.connect(self.accept) @@ -50,7 +58,8 @@ class paperDims(QDialog): super(paperDims, self).exec_() self.deleteLater() #remove from memory #if ok was pressed return value else return None - return (self.returnCanvasSize, self.returnCanvasPPI) if self.result() else None + print(self.landscapeCheckBox.isChecked()) + return (self.returnCanvasSize, self.returnCanvasPPI, self.landscapeCheckBox.isChecked()) if self.result() else None class sideViewSwitchDialog(QDialog): """ @@ -107,4 +116,4 @@ def showUndoDialog(undoView, parent): layout = QHBoxLayout(dialogBox) layout.addWidget(undoView) dialogBox.setWindowTitle("Undo Stack") - dialogBox.show()
\ No newline at end of file + dialogBox.show() |