|
|
|
@ -4,7 +4,7 @@ import FreeCAD as App
|
|
|
|
|
class AHB_RefreshView: |
|
|
|
|
def GetResources(self): |
|
|
|
|
return {"MenuText": "Refresh page (final quality)", |
|
|
|
|
"ToolTip": "Redraws the current page", |
|
|
|
|
"ToolTip": "Redraws the current page, or if one or more pages are selected, redraw all the selected pages", |
|
|
|
|
"Pixmap": "" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -14,6 +14,17 @@ class AHB_RefreshView:
|
|
|
|
|
|
|
|
|
|
def Activated(self): |
|
|
|
|
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench") #: :type workbench: AssemblyHandbookWorkbench |
|
|
|
|
|
|
|
|
|
selection = Gui.Selection.getSelection() |
|
|
|
|
has_selected_pages = len(selection) > 0 |
|
|
|
|
for s in selection: |
|
|
|
|
if s.TypeId != 'TechDraw::DrawPage': |
|
|
|
|
has_selected_pages = False |
|
|
|
|
|
|
|
|
|
if has_selected_pages: |
|
|
|
|
for page in selection: |
|
|
|
|
workbench.techDrawExtensions.forceRedrawPage(page, fast_render = False) |
|
|
|
|
else: |
|
|
|
|
page = workbench.techDrawExtensions.getActivePage() |
|
|
|
|
if page is not None: |
|
|
|
|
workbench.techDrawExtensions.forceRedrawPage(page, fast_render = False) |
|
|
|
|