-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect_view.py
More file actions
113 lines (90 loc) · 4.22 KB
/
Copy pathselect_view.py
File metadata and controls
113 lines (90 loc) · 4.22 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
from PyQt5.QtWidgets import QApplication,QDialog,QTabWidget,QWidget,QFileDialog,QMessageBox,QErrorMessage
from PyQt5 import QtCore, QtGui, QtWidgets
import os
import shutil
import sys
import cv2
from select_controller import Select_Controller
class Select_View(QWidget):
def __init__(self,main_controller):
super().__init__()
self.main_controller=main_controller
self.select_controller=Select_Controller(self,main_controller)
style_button="background-color: #FD3A41; \
color: #FFFFFF;\
border:6px solid #FC0A32;\
border-radius:15px;\
display:inline-block;\
font-family:Arial;\
font-size:14px;\
font-weight:bold;\
"
croppedPath=""
selectedPath=""
self.label_cropped_folder = QtWidgets.QLabel(self)
self.label_cropped_folder.setGeometry(QtCore.QRect(70, 80, 521, 31))
font = QtGui.QFont()
font.setFamily("Verdana")
font.setPointSize(10)
self.label_cropped_folder.setFont(font)
self.label_cropped_folder.setWordWrap(True)
self.label_selection_folder = QtWidgets.QLabel(self)
self.label_selection_folder.setGeometry(QtCore.QRect(70, 140, 521, 31))
font = QtGui.QFont()
font.setFamily("Verdana")
font.setPointSize(10)
self.label_selection_folder.setFont(font)
self.label_selection_folder.setWordWrap(True)
self.button_cropped_explorer = QtWidgets.QPushButton(self)
self.button_cropped_explorer.setGeometry(QtCore.QRect(600, 80, 81, 31))
font = QtGui.QFont()
font.setFamily("Verdana")
font.setPointSize(10)
self.button_cropped_explorer.setFont(font)
self.button_selection_explorer = QtWidgets.QPushButton(self)
self.button_selection_explorer.setGeometry(QtCore.QRect(600, 140, 81, 31))
font = QtGui.QFont()
font.setFamily("Verdana")
font.setPointSize(10)
self.button_selection_explorer.setFont(font)
self.label_nth_number = QtWidgets.QLabel(self)
self.label_nth_number.setGeometry(QtCore.QRect(70, 210, 101, 21))
font = QtGui.QFont()
font.setFamily("Verdana")
font.setPointSize(10)
self.label_nth_number.setFont(font)
self.button_select_execute = QtWidgets.QPushButton(self)
self.button_select_execute.setGeometry(QtCore.QRect(370, 350, 81, 31))
font = QtGui.QFont()
font.setFamily("Verdana")
font.setPointSize(10)
self.button_select_execute.setFont(font)
self.entry_nth_number = QtWidgets.QSpinBox(self)
self.entry_nth_number.setGeometry(QtCore.QRect(170, 210, 51, 21))
font = QtGui.QFont()
font.setPointSize(8)
self.entry_nth_number.setFont(font)
self.entry_nth_number.setButtonSymbols(QtWidgets.QAbstractSpinBox.PlusMinus)
self.entry_nth_number.setMinimum(2)
self.entry_nth_number.setMaximum(50)
self.entry_nth_number.setSingleStep(1)
self.entry_nth_number.setProperty("value", 2)
#retranslate
self.label_cropped_folder.setText("Cropped Image Directory")
self.label_selection_folder.setText("Selected Image Directory")
self.button_cropped_explorer.setText("Browse")
self.button_cropped_explorer.setStyleSheet(style_button)
self.button_cropped_explorer.clicked.connect(lambda:self.select_controller.browseFiles(self.label_cropped_folder))
self.button_selection_explorer.setText("Browse")
self.button_selection_explorer.setStyleSheet(style_button)
self.button_selection_explorer.clicked.connect(lambda:self.select_controller.browseFiles(self.label_selection_folder))
self.label_nth_number.setText("Nth Number:")
self.button_select_execute.setText("Select")
self.button_select_execute.setStyleSheet(style_button)
self.button_select_execute.clicked.connect(lambda:self.selectFunction())
def errorMessageBox(self,title,text):
msg = QMessageBox()
msg.setIcon(QMessageBox.Critical)
msg.setText(text)
msg.setWindowTitle(title)
msg.exec_()