- refactoring all the references to object options property to obj_options to make a difference with the application options property

This commit is contained in:
Marius Stanciu
2022-02-16 10:47:12 +02:00
committed by Marius
parent de1d97327c
commit 1681b327ed
54 changed files with 896 additions and 892 deletions

View File

@@ -38,7 +38,7 @@ class ScriptObject(FlatCAMObj):
self.kind = "script"
self.options.update({
self.obj_options.update({
"plot": True,
"type": 'Script',
"source_file": '',
@@ -82,17 +82,17 @@ class ScriptObject(FlatCAMObj):
# tab_here = False
# # try to not add too many times a tab that it is already installed
# for idx in range(self.app.ui.plot_tab_area.count()):
# if self.app.ui.plot_tab_area.widget(idx).objectName() == self.options['name']:
# if self.app.ui.plot_tab_area.widget(idx).objectName() == self.obj_options['name']:
# tab_here = True
# break
#
# # add the tab if it is not already added
# if tab_here is False:
# self.app.ui.plot_tab_area.addTab(self.script_editor_tab, '%s' % _("Script Editor"))
# self.script_editor_tab.setObjectName(self.options['name'])
# self.script_editor_tab.setObjectName(self.obj_options['name'])
# self.app.ui.plot_tab_area.addTab(self.script_editor_tab, '%s' % _("Script Editor"))
# self.script_editor_tab.setObjectName(self.options['name'])
# self.script_editor_tab.setObjectName(self.obj_options['name'])
# first clear previous text in text editor (if any)
# self.script_editor_tab.code_editor.clear()
@@ -148,14 +148,14 @@ class ScriptObject(FlatCAMObj):
tab_here = False
# try to not add too many times a tab that it is already installed
for idx in range(self.app.ui.plot_tab_area.count()):
if self.app.ui.plot_tab_area.widget(idx).objectName() == (self.options['name'] + "_editor_tab"):
if self.app.ui.plot_tab_area.widget(idx).objectName() == (self.obj_options['name'] + "_editor_tab"):
tab_here = True
break
# add the tab if it is not already added
if tab_here is False:
self.app.ui.plot_tab_area.addTab(self.script_editor_tab, '%s' % _("Script Editor"))
self.script_editor_tab.setObjectName(self.options['name'] + "_editor_tab")
self.script_editor_tab.setObjectName(self.obj_options['name'] + "_editor_tab")
self.app.ui.plot_tab_area.setCurrentWidget(self.script_editor_tab)
def change_level(self, level):