- fixed issue when doing th CTRL (or SHIFT) + LMB, the focus is automatically moved to Project Tab
- further work in internationalization, added a fallback to English language in case there is no translation for a string
This commit is contained in:
@@ -8,9 +8,16 @@ import FlatCAMTranslation as fcTranslate
|
||||
fcTranslate.apply_language('ToolProperties')
|
||||
|
||||
|
||||
def _tr(text):
|
||||
try:
|
||||
return _(text)
|
||||
except:
|
||||
return text
|
||||
|
||||
|
||||
class Properties(FlatCAMTool):
|
||||
|
||||
toolName = _("Properties")
|
||||
toolName = _tr("Properties")
|
||||
|
||||
def __init__(self, app):
|
||||
FlatCAMTool.__init__(self, app)
|
||||
@@ -84,15 +91,15 @@ class Properties(FlatCAMTool):
|
||||
def properties(self):
|
||||
obj_list = self.app.collection.get_selected()
|
||||
if not obj_list:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Properties Tool was not displayed. No object selected."))
|
||||
self.app.ui.notebook.setTabText(2, _("Tools"))
|
||||
self.app.inform.emit(_tr("[ERROR_NOTCL] Properties Tool was not displayed. No object selected."))
|
||||
self.app.ui.notebook.setTabText(2, _tr("Tools"))
|
||||
self.properties_frame.hide()
|
||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
||||
return
|
||||
for obj in obj_list:
|
||||
self.addItems(obj)
|
||||
self.app.inform.emit(_("[success] Object Properties are displayed."))
|
||||
self.app.ui.notebook.setTabText(2, _("Properties Tool"))
|
||||
self.app.inform.emit(_tr("[success] Object Properties are displayed."))
|
||||
self.app.ui.notebook.setTabText(2, _tr("Properties Tool"))
|
||||
|
||||
def addItems(self, obj):
|
||||
parent = self.treeWidget.invisibleRootItem()
|
||||
|
||||
Reference in New Issue
Block a user