Draft: gui_ and task_circulararray cleanup

This commit is contained in:
vocx-fc
2020-03-06 01:55:40 -06:00
committed by Yorik van Havre
parent b2a7cb9303
commit 13cc36e73d
2 changed files with 302 additions and 197 deletions

View File

@@ -20,7 +20,7 @@
# * USA *
# * *
# ***************************************************************************
"""Provides the Draft CircularArray tool."""
"""Provides the Draft CircularArray GuiCommand."""
## @package gui_circulararray
# \ingroup DRAFT
# \brief This module provides the Draft CircularArray tool.
@@ -31,13 +31,15 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD as App
import FreeCADGui as Gui
import Draft
import Draft_rc
import Draft_rc # include resources, icons, ui files
from draftutils.messages import _msg, _log
from draftutils.translate import _tr
from draftguitools import gui_base
from drafttaskpanels import task_circulararray
import draftutils.todo as todo
# The module is used to prevent complaints from code checkers (flake8)
True if Draft_rc.__name__ else False
bool(Draft_rc.__name__)
class GuiCommandCircularArray(gui_base.GuiCommandBase):
@@ -45,7 +47,7 @@ class GuiCommandCircularArray(gui_base.GuiCommandBase):
def __init__(self):
super().__init__()
self.command_name = "CircularArray"
self.command_name = "Circular array"
self.location = None
self.mouse_event = None
self.view = None
@@ -56,14 +58,15 @@ class GuiCommandCircularArray(gui_base.GuiCommandBase):
def GetResources(self):
"""Set icon, menu and tooltip."""
_msg = ("Creates copies of a selected object, "
_tip = ("Creates copies of a selected object, "
"and places the copies in a circular pattern.\n"
"The properties of the array can be further modified after "
"the new object is created, including turning it into "
"a different type of array.")
d = {'Pixmap': 'Draft_CircularArray',
'MenuText': QT_TRANSLATE_NOOP("Draft", "Circular array"),
'ToolTip': QT_TRANSLATE_NOOP("Draft", _msg)}
'ToolTip': QT_TRANSLATE_NOOP("Draft", _tip)}
return d
def Activated(self):
@@ -72,6 +75,10 @@ class GuiCommandCircularArray(gui_base.GuiCommandBase):
We add callbacks that connect the 3D view with
the widgets of the task panel.
"""
_log("GuiCommand: {}".format(_tr(self.command_name)))
_msg("{}".format(16*"-"))
_msg("GuiCommand: {}".format(_tr(self.command_name)))
self.location = coin.SoLocation2Event.getClassTypeId()
self.mouse_event = coin.SoMouseButtonEvent.getClassTypeId()
self.view = Draft.get3DView()