Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Draft: gui_ and task_circulararray cleanup
  • Loading branch information
vocx-fc authored and yorikvanhavre committed Apr 10, 2020
1 parent b2a7cb9 commit 13cc36e
Show file tree
Hide file tree
Showing 2 changed files with 303 additions and 198 deletions.
19 changes: 13 additions & 6 deletions src/Mod/Draft/draftguitools/gui_circulararray.py
Expand Up @@ -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.
Expand All @@ -31,21 +31,23 @@
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):
"""Gui command for the CircularArray tool."""

def __init__(self):
super().__init__()
self.command_name = "CircularArray"
self.command_name = "Circular array"
self.location = None
self.mouse_event = None
self.view = None
Expand All @@ -56,14 +58,15 @@ def __init__(self):

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):
Expand All @@ -72,6 +75,10 @@ def Activated(self):
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()
Expand Down

0 comments on commit 13cc36e

Please sign in to comment.