Modified :

- naming Label and not Name/ID
This commit is contained in:
jerome Laverroux
2020-04-21 14:49:30 +02:00
parent 8eaf6dd997
commit c5f84631bb

View File

@@ -41,7 +41,8 @@ import FreeCADGui as Gui
import Draft_rc
import draftutils.utils as utils
import draftguitools.gui_base as gui_base
from draftutils.translate import _tr, translate
from draftutils.translate import _tr
from DraftTools import translate
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
@@ -67,8 +68,7 @@ class AddToGroup(gui_base.GuiCommandNeedsSelection):
def GetResources(self):
"""Set icon, menu and tooltip."""
_tooltip = ("Moves the selected objects to an existing group, "
"or removes them from any group.\n"
"Create a group first to use this tool.")
"or removes them from any group.")
d = {'Pixmap': 'Draft_AddToGroup',
'Accel':"M",
@@ -103,10 +103,6 @@ class AddToGroup(gui_base.GuiCommandNeedsSelection):
self.ui.sourceCmd = self
self.ui.popupMenu(self.labels)
# def actions(self,labelname):
def proceed(self, labelname):
# If the selected group matches the ungroup label,
@@ -456,14 +452,15 @@ class Ui_AddNamedGroup():
self.form = QtGui.QWidget()
self.form.setWindowTitle(_tr("Add group"))
row = QtGui.QHBoxLayout(self.form)
lbl = QtGui.QLabel(_tr("Group name:"))
lbl = QtGui.QLabel(_tr("Group name")+":")
self.name = QtGui.QLineEdit()
row.addWidget(lbl)
row.addWidget(self.name)
def accept(self):
group = App.activeDocument().addObject("App::DocumentObjectGroup",self.name.text())
group = App.activeDocument().addObject("App::DocumentObjectGroup",translate("Gui::Dialog::DlgAddProperty","Group"))
group.Label=self.name.text()
moveToGroup(group)
Gui.Control.closeDialog()