Added Help tab, changed Home to File
This commit is contained in:
parent
a19168fc05
commit
cf29bdc68b
106
win_venv/main.py
106
win_venv/main.py
@ -16,19 +16,12 @@ outputFilePath = scriptPath + '\\files\\output'
|
|||||||
LIB_RAW = 0
|
LIB_RAW = 0
|
||||||
LIB_VIS = 1
|
LIB_VIS = 1
|
||||||
|
|
||||||
|
|
||||||
def files(path):
|
def files(path):
|
||||||
for file in os.listdir(path):
|
for file in os.listdir(path):
|
||||||
if os.path.isfile(os.path.join(path, file)):
|
if os.path.isfile(os.path.join(path, file)):
|
||||||
yield file
|
yield file
|
||||||
|
|
||||||
class deletePopup(QMessageBox):
|
|
||||||
def __init__(self, parent=None):
|
|
||||||
super(deletePopup,self).__init__(parent)
|
|
||||||
self.setText("Are you sure you want to delete the file?")
|
|
||||||
self.setIcon(self.Warning)
|
|
||||||
self.setWindowTitle("Confirm deletion")
|
|
||||||
self.setStandardButtons(self.Yes | self.No)
|
|
||||||
|
|
||||||
def save_input(oldpath):
|
def save_input(oldpath):
|
||||||
# make timestampt the filename, so it wouln't overwrite
|
# make timestampt the filename, so it wouln't overwrite
|
||||||
timestamp = str(int(time.time()))
|
timestamp = str(int(time.time()))
|
||||||
@ -38,6 +31,15 @@ def save_input(oldpath):
|
|||||||
return newpath
|
return newpath
|
||||||
|
|
||||||
|
|
||||||
|
class deletePopup(QMessageBox):
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
super(deletePopup, self).__init__(parent)
|
||||||
|
self.setText("Are you sure you want to delete the file?")
|
||||||
|
self.setIcon(self.Warning)
|
||||||
|
self.setWindowTitle("Confirm deletion")
|
||||||
|
self.setStandardButtons(self.Yes | self.No)
|
||||||
|
|
||||||
|
|
||||||
class LibraryTableButtons(QWidget):
|
class LibraryTableButtons(QWidget):
|
||||||
def __init__(self, file, parent=None):
|
def __init__(self, file, parent=None):
|
||||||
super(LibraryTableButtons,self).__init__(parent)
|
super(LibraryTableButtons,self).__init__(parent)
|
||||||
@ -97,12 +99,57 @@ class LibraryTable(QTableWidget):
|
|||||||
self.setCellWidget(index,2,LibraryTableButtons(filePath + '\\' + names[index].text()))
|
self.setCellWidget(index,2,LibraryTableButtons(filePath + '\\' + names[index].text()))
|
||||||
|
|
||||||
|
|
||||||
|
class formatHelp(QLabel):
|
||||||
|
|
||||||
|
def __init__(self, parent=None):
|
||||||
|
QLabel.__init__(self)
|
||||||
|
help_text = '''
|
||||||
|
VisionScore to program służący do generowania analizy nagrań lub zdjęć z meczów piłkarskich.
|
||||||
|
|
||||||
|
By wygenerować taką analizę, należy postępować według następujących kroków:
|
||||||
|
|
||||||
|
1. Wgraj plik z plikiem do przeanalizowania
|
||||||
|
File -> Upload new file
|
||||||
|
2. Po wgraniu pliku pojawi się on w
|
||||||
|
Library -> Input files
|
||||||
|
# 3. By wygenerować analizę należy kliknąć przycisk
|
||||||
|
Analyze
|
||||||
|
znajdujący się obok wgranego pliku. Analizę można wygenerować także do uprzednio wgranych plików.
|
||||||
|
4. Po wygenerowaniu, analiza znajdować się będzie w
|
||||||
|
Library -> Vizusalizations
|
||||||
|
możesz tam także zobaczyć wszystkie poprzednio wygenerowane analizy.
|
||||||
|
|
||||||
|
Każdy plik źródłowy lub wygenerowaną analizę możesz w każdym momencie podejrzeć klikając
|
||||||
|
View
|
||||||
|
obok pliku znajdującego się w bibliotekach. Plik możesz też w każdym momencie usunąć klikając
|
||||||
|
Delete
|
||||||
|
obok odpowiedniego pliku.
|
||||||
|
|
||||||
|
|
||||||
|
Zakończ działanie aplikacji klikąc
|
||||||
|
File -> Exit
|
||||||
|
używając skrótu klawiszowego Ctrl+Q lub bo prostu zamykając okienko aplikacji.
|
||||||
|
|
||||||
|
|
||||||
|
Kontakt: mikbed@st.amu.edu.pl
|
||||||
|
'''
|
||||||
|
self.setText(help_text)
|
||||||
|
self.adjustSize()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.initUI()
|
self.initUI()
|
||||||
|
|
||||||
|
# todo: split in multiply labels for richer formatting
|
||||||
|
# Show Help tab
|
||||||
|
def showHelp(self):
|
||||||
|
label = formatHelp()
|
||||||
|
self.setCentralWidget(label)
|
||||||
|
|
||||||
# Show raw uploaded files
|
# Show raw uploaded files
|
||||||
def showInputLibrary(self):
|
def showInputLibrary(self):
|
||||||
libTable = LibraryTable(LIB_RAW)
|
libTable = LibraryTable(LIB_RAW)
|
||||||
@ -127,38 +174,41 @@ class MainWindow(QMainWindow):
|
|||||||
scriptDir = os.path.dirname(os.path.realpath(__file__))
|
scriptDir = os.path.dirname(os.path.realpath(__file__))
|
||||||
self.setWindowIcon(QIcon(scriptDir + os.path.sep + 'static/v_logo.jpg'))
|
self.setWindowIcon(QIcon(scriptDir + os.path.sep + 'static/v_logo.jpg'))
|
||||||
|
|
||||||
# Toolbar
|
# File menu
|
||||||
menuBar = self.menuBar()
|
menuBar = self.menuBar()
|
||||||
homeMenu = QMenu("&Home", self)
|
fileMenu = QMenu("&File", self)
|
||||||
menuBar.addMenu(homeMenu)
|
menuBar.addMenu(fileMenu)
|
||||||
|
|
||||||
# Upload file
|
# Upload file
|
||||||
uploadAct = QAction('&Upload new file', self)
|
uploadAct = QAction('&Upload new file', self)
|
||||||
uploadAct.triggered.connect(self.showUploadFile)
|
uploadAct.triggered.connect(self.showUploadFile)
|
||||||
homeMenu.addAction(uploadAct)
|
fileMenu.addAction(uploadAct)
|
||||||
|
|
||||||
#Library menu
|
|
||||||
libraryMenu = QMenu("&Library", self)
|
|
||||||
menuBar.addMenu(libraryMenu)
|
|
||||||
|
|
||||||
#Input files
|
|
||||||
inputAct = QAction('&Input files', self)
|
|
||||||
inputAct.triggered.connect(self.showInputLibrary)
|
|
||||||
libraryMenu.addAction(inputAct)
|
|
||||||
|
|
||||||
#Visualisations
|
|
||||||
visAct = QAction('&Visualisations', self)
|
|
||||||
visAct.triggered.connect(self.showVisualisationsLibrary)
|
|
||||||
libraryMenu.addAction(visAct)
|
|
||||||
|
|
||||||
# Exit app
|
# Exit app
|
||||||
exitAct = QAction('&Exit', self)
|
exitAct = QAction('&Exit', self)
|
||||||
exitAct.setShortcut('Ctrl+Q')
|
exitAct.setShortcut('Ctrl+Q')
|
||||||
exitAct.setStatusTip('Exit')
|
exitAct.setStatusTip('Exit')
|
||||||
exitAct.triggered.connect(qApp.quit)
|
exitAct.triggered.connect(qApp.quit)
|
||||||
homeMenu.addAction(exitAct)
|
fileMenu.addAction(exitAct)
|
||||||
|
|
||||||
helpMenu = menuBar.addMenu("&Help")
|
# Library menu
|
||||||
|
libraryMenu = QMenu("&Library", self)
|
||||||
|
menuBar.addMenu(libraryMenu)
|
||||||
|
|
||||||
|
# Input files
|
||||||
|
inputAct = QAction('&Input files', self)
|
||||||
|
inputAct.triggered.connect(self.showInputLibrary)
|
||||||
|
libraryMenu.addAction(inputAct)
|
||||||
|
|
||||||
|
# Visualisations
|
||||||
|
visAct = QAction('&Visualisations', self)
|
||||||
|
visAct.triggered.connect(self.showVisualisationsLibrary)
|
||||||
|
libraryMenu.addAction(visAct)
|
||||||
|
|
||||||
|
# Help
|
||||||
|
helpAct = QAction('&Help', self)
|
||||||
|
helpAct.triggered.connect(self.showHelp)
|
||||||
|
menuBar.addAction(helpAct)
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user