- moved all the new_object related methods in their own class AppObjects.AppObject
This commit is contained in:
@@ -2477,7 +2477,7 @@ class MainGUI(QtWidgets.QMainWindow):
|
||||
|
||||
# New Geometry
|
||||
if key == QtCore.Qt.Key_B:
|
||||
self.app.new_gerber_object()
|
||||
self.app.app_obj.new_gerber_object()
|
||||
|
||||
# New Geometry
|
||||
if key == QtCore.Qt.Key_D:
|
||||
@@ -2497,7 +2497,7 @@ class MainGUI(QtWidgets.QMainWindow):
|
||||
|
||||
# New Excellon
|
||||
if key == QtCore.Qt.Key_L:
|
||||
self.app.new_excellon_object()
|
||||
self.app.app_obj.new_excellon_object()
|
||||
|
||||
# Move tool toggle
|
||||
if key == QtCore.Qt.Key_M:
|
||||
@@ -2505,7 +2505,7 @@ class MainGUI(QtWidgets.QMainWindow):
|
||||
|
||||
# New Geometry
|
||||
if key == QtCore.Qt.Key_N:
|
||||
self.app.new_geometry_object()
|
||||
self.app.app_obj.new_geometry_object()
|
||||
|
||||
# Set Origin
|
||||
if key == QtCore.Qt.Key_O:
|
||||
|
||||
@@ -48,9 +48,9 @@ class CanvasCache(QtCore.QObject):
|
||||
Case story #1:
|
||||
|
||||
1) No objects in the project.
|
||||
2) Object is created (new_object() emits object_created(obj)).
|
||||
2) Object is created (app_obj.new_object() emits object_created(obj)).
|
||||
on_object_created() adds (i) object to collection and emits
|
||||
(ii) new_object_available() then calls (iii) object.plot()
|
||||
(ii) app_obj.new_object_available() then calls (iii) object.plot()
|
||||
3) object.plot() creates axes if necessary on
|
||||
app.collection.figure. Then plots on it.
|
||||
4) Plots on a cache-size canvas (in background).
|
||||
@@ -116,7 +116,7 @@ class CanvasCache(QtCore.QObject):
|
||||
|
||||
# Continue to update the cache.
|
||||
|
||||
# def on_new_object_available(self):
|
||||
# def on_app_obj.new_object_available(self):
|
||||
#
|
||||
# log.debug("A new object is available. Should plot it!")
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class PreferencesUIManager:
|
||||
self.preferences_changed_flag = False
|
||||
|
||||
# when adding entries here read the comments in the method found below named:
|
||||
# def new_object(self, kind, name, initialize, active=True, fit=True, plot=True)
|
||||
# def app_obj.new_object(self, kind, name, initialize, active=True, fit=True, plot=True)
|
||||
self.defaults_form_fields = {
|
||||
# General App
|
||||
"decimals_inch": self.ui.general_defaults_form.general_app_group.precision_inch_entry,
|
||||
|
||||
Reference in New Issue
Block a user