From d59430f3909dc3919547a7d6f9f589778806d3d9 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Wed, 7 Aug 2019 12:05:37 -0700 Subject: [PATCH] mode tracking --- main_window.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/main_window.py b/main_window.py index 513dae4..a9e5c71 100644 --- a/main_window.py +++ b/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):