Browse Source

mode tracking

tb-init-ui-render
Taylor Bockman 5 years ago
parent
commit
d59430f390
  1. 18
      main_window.py

18
main_window.py

@ -1,9 +1,22 @@
import os
from enum import Enum
from PyQt5 import QtWidgets, uic
from clusterview_ui import Ui_MainWindow
class Mode(Enum):
"""
Class to make it easier to figure out what mode
we are operating in when the OpenGL window is
clicked
"""
OFF = 0
ADD = 1
EDIT = 2
DELETE = 3
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
"""
A wrapper class for handling creating a window based
@ -11,6 +24,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
`clusterview.ui`.
"""
__mode = Mode.OFF
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.setupUi(self)
@ -28,12 +43,15 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
# in isolation so this file remains relatively clean aside from
# the UI hooks to the functions above.
def __add_points(self):
self.__mode = Mode.ADD
print("ADDING POINT MODE ENABLED!")
def __edit_points(self):
self.__mode = Mode.EDIT
print("EDITING POINT MODE ENABLED!")
def __delete_points(self):
self.__mode = Mode.DELETE
print("DELETE POINT MODE ENABLED!")
def __solve_launcher(self):

Loading…
Cancel
Save