Skip to content

Commit

Permalink
[Draft] Further cleanup of the branch
Browse files Browse the repository at this point in the history
thanks to vocx revisions
  • Loading branch information
carlopav committed Apr 19, 2020
1 parent 6f89f78 commit b855a97
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
13 changes: 7 additions & 6 deletions src/Mod/Draft/draftguitools/gui_snaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,20 @@
# \brief Provide the Draft_Snap commands used by the snapping mechanism
# in Draft.

import FreeCADGui as Gui
import draftguitools.gui_base as gui_base

from PySide import QtGui
from PySide.QtCore import QT_TRANSLATE_NOOP

import FreeCADGui as Gui

import draftguitools.gui_base as gui_base
from draftutils.translate import _tr


# UTILITIES -----------------------------------------------------------------


def get_snap_statusbar_widget():
"""retuns snap statusbar button"""
"""Return snap statusbar button."""
mw = Gui.getMainWindow()
if mw:
sb = mw.statusBar()
Expand All @@ -50,7 +51,7 @@ def get_snap_statusbar_widget():


def sync_snap_toolbar_button(button, status):
"""set snap toolbar button to given state"""
"""Set snap toolbar button to given state."""
snap_toolbar = Gui.Snapper.get_snap_toolbar()
if not snap_toolbar:
return
Expand All @@ -71,7 +72,7 @@ def sync_snap_toolbar_button(button, status):


def sync_snap_statusbar_button(button, status):
"""set snap statusbar button to given state"""
"""Set snap statusbar button to given state."""
ssw = get_snap_statusbar_widget()
if not ssw:
return
Expand Down
10 changes: 7 additions & 3 deletions src/Mod/Draft/draftutils/init_draft_statusbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
# \ingroup DRAFT
# \brief This module provides the code for the Draft Statusbar.

from PySide import QtCore
from PySide import QtGui
from PySide.QtCore import QT_TRANSLATE_NOOP

import FreeCAD as App
import FreeCADGui as Gui
from PySide import QtCore, QtGui
from PySide.QtCore import QT_TRANSLATE_NOOP

from draftutils.init_tools import get_draft_snap_commands

#----------------------------------------------------------------------------
Expand Down Expand Up @@ -148,7 +151,8 @@ def _set_scale(action):
if custom_scale[1]:
print(custom_scale[0])
scale = label_to_scale(custom_scale[0])
if scale is None: return
if scale is None:
return
param.SetFloat("DraftAnnotationScale", scale)
cs = scale_to_label(scale)
scale_widget.scaleLabel.setText(cs)
Expand Down
12 changes: 6 additions & 6 deletions src/Mod/Draft/draftutils/init_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ def get_draft_utility_commands():

def get_draft_snap_commands():
"""Return the snapping commands list."""
return ['Draft_Snap_Lock',
'Draft_Snap_Endpoint', 'Draft_Snap_Midpoint',
'Draft_Snap_Center', 'Draft_Snap_Angle',
return ['Draft_Snap_Lock',
'Draft_Snap_Endpoint', 'Draft_Snap_Midpoint',
'Draft_Snap_Center', 'Draft_Snap_Angle',
'Draft_Snap_Intersection', 'Draft_Snap_Perpendicular',
'Draft_Snap_Extension', 'Draft_Snap_Parallel',
'Draft_Snap_Special', 'Draft_Snap_Near',
'Draft_Snap_Ortho', 'Draft_Snap_Grid',
'Draft_Snap_Extension', 'Draft_Snap_Parallel',
'Draft_Snap_Special', 'Draft_Snap_Near',
'Draft_Snap_Ortho', 'Draft_Snap_Grid',
'Draft_Snap_WorkingPlane', 'Draft_Snap_Dimensions',
]

Expand Down

0 comments on commit b855a97

Please sign in to comment.