Browse Source

Add error message for zero-point case.

pull/1/head
Taylor Bockman 5 years ago
parent
commit
9cff55d5fb
  1. 8
      main_window.py

8
main_window.py

@ -2,7 +2,7 @@ from functools import partial
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QFileDialog, QInputDialog, QMainWindow
from PyQt5.QtWidgets import QErrorMessage, QFileDialog, QInputDialog, QMainWindow
from clusterview2.exceptions import handle_exceptions
from clusterview2.colors import Color
@ -167,6 +167,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.opengl_widget.update()
def _clustering(self):
if len(list(PointManager.point_set.points)) == 0:
error_dialog = QErrorMessage()
error_dialog.showMessage('Place points before clustering.')
error_dialog.exec_()
return
clear_selection()
self._mode = Mode.CLUSTERING
self.opengl_widget.setCursor(QCursor(Qt.CursorShape.ArrowCursor))

Loading…
Cancel
Save