-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·76 lines (53 loc) · 1.92 KB
/
main.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Main GUI file
For developing and running this software you need: PyQt4
debian/ubuntu packages: python-qt4 pyqt4-dev-tools python-qt4-doc
For compiling:
run ./ui/compileAll.py
Documentation see:
PyQt Docs:
Specific objects like QButton: http://pyqt.sourceforge.net/Docs/PyQt4/classes.html -> search for name of the class you're looking for
General stuff: http://pyqt.sourceforge.net/Docs/PyQt4/
python "cheatsheet" (still looking for a better one):
http://rgruet.free.fr/PQR27/PQR2.7.html
"""
from PyQt4.QtGui import QMainWindow
from PyQt4.QtCore import pyqtSignature
from ui import *
import sys
class VisiLatheGUI(QMainWindow, Ui_MainWindow):
"""
Class documentation goes here.
"""
def __init__(self, parent = None):
"""
Constructor
"""
QMainWindow.__init__(self, parent)
self.setupUi(self)
# Signal-Slot-connections
self.workflowTabs.currentChanged.connect(self.workflowTabChanged)
# init
self.workflowTabChanged(0)
def workflowTabChanged(self, index):
# The "workflow" tabs at the left were switched to another step
# Change the rest of the GUI accordingly
# tab indices - need to be readjusted when other tabs are added
INDEX_DRAWINGS=1
INDEX_TOOLPATHS=2
# TODO abort editing / ask for unsaved changes
# show/hide the additional settings GroupBox
self.toolpathSettings.setVisible(index==INDEX_TOOLPATHS)
self.drawingSettings.setVisible(index==INDEX_DRAWINGS)
def workflowNext(self):
# switch to next workflow tab
self.workflowTabs.setCurrentIndex(self.workflowTabs.currentIndex()+1)
def main():
app = QtGui.QApplication(sys.argv)
gui = VisiLatheGUI()
gui.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()