-
Notifications
You must be signed in to change notification settings - Fork 1
/
Ranges_Creator_Properties.py
55 lines (43 loc) · 1.61 KB
/
Ranges_Creator_Properties.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
import os, sys
from GUI_functions import load_ranges_creator_options, set_ranges_creator_options
class Ranges_Creator_Window(QDialog):
def __init__(self, parent=None):
super(Ranges_Creator_Window, self).__init__(parent)
value = load_ranges_creator_options()
self.setWindowTitle("Ranges Creator Properties")
self.option = QCheckBox("Enable validation ranges creator upon successful signle run")
self.option.setChecked(value)
self.cancel_button = QPushButton("Cancel")
self.ok_button = QPushButton("Ok")
self.ok_button.clicked.connect(self.set_value)
self.cancel_button.clicked.connect(self.close)
self.ok_button.setDefault(True)
layout1 = QHBoxLayout()
layout1.addStretch()
layout1.addWidget(self.cancel_button)
layout1.addStretch()
layout1.addWidget(self.ok_button)
layout1.addStretch()
layout2 = QVBoxLayout()
layout2.addWidget(self.option)
layout2.addStretch()
layout2.addLayout(layout1)
self.setLayout(layout2)
def set_value(self):
set_ranges_creator_options(self.option.isChecked())
self.close()
if __name__ == '__main__':
def main():
app=QApplication(sys.argv)
app.setStyle('Fusion')
window = Ranges_Creator_Window()
window.show()
app.exec_()
try:
main()
except Exception as why:
print(why)