[TD]rename CopyView to ShareView

This commit is contained in:
Wanderer Fan
2022-02-02 10:21:39 -05:00
committed by WandererFan
parent 9760384b64
commit 4fd28100ce
8 changed files with 28 additions and 29 deletions

View File

@@ -18,9 +18,9 @@
# * USA *
# * *
# ***************************************************************************
"""Provides the TechDraw CopyView GuiCommand."""
"""Provides the TechDraw ShareView GuiCommand."""
__title__ = "TechDrawTools.CommandCopyView"
__title__ = "TechDrawTools.CommandShareView"
__author__ = "WandererFan"
__url__ = "https://www.freecadweb.org"
__version__ = "00.01"
@@ -33,8 +33,8 @@ import FreeCADGui as Gui
import TechDrawTools
class CommandCopyView:
"""Copies a View from current Page to a different Page."""
class CommandShareView:
"""Shares a View on current Page to another Page."""
def __init__(self):
"""Initialize variables for the command that must exist at all times."""
@@ -42,10 +42,10 @@ class CommandCopyView:
def GetResources(self):
"""Return a dictionary with data that will be used by the button or menu item."""
return {'Pixmap': 'actions/TechDraw_CopyView.svg',
return {'Pixmap': 'actions/TechDraw_ShareView.svg',
'Accel': "",
'MenuText': QT_TRANSLATE_NOOP("CopyView", "Copy View"),
'ToolTip': QT_TRANSLATE_NOOP("CopyView", "Copy a View to a second Page")}
'MenuText': QT_TRANSLATE_NOOP("ShareView", "Share View"),
'ToolTip': QT_TRANSLATE_NOOP("ShareView", "Share a View on a second Page")}
def Activated(self):
"""Run the following code when the command is activated (button press)."""
@@ -71,7 +71,7 @@ class CommandCopyView:
if len(pages) > 1:
toPageName = pages[1].Name
self.ui = TechDrawTools.TaskCopyView()
self.ui = TechDrawTools.TaskShareView()
self.ui.setValues(vName, fromPageName, toPageName)
Gui.Control.showDialog(self.ui)
@@ -86,5 +86,5 @@ class CommandCopyView:
#
# The command must be "registered" with a unique name by calling its class.
Gui.addCommand('TechDraw_CopyView', CommandCopyView())
Gui.addCommand('TechDraw_ShareView', CommandShareView())

View File

@@ -18,9 +18,9 @@
# * USA *
# * *
# ***************************************************************************
"""Provides the TechDraw CopyView Task Dialog."""
"""Provides the TechDraw ShareView Task Dialog."""
__title__ = "TechDrawTools.TaskCopyView"
__title__ = "TechDrawTools.TaskShareView"
__author__ = "WandererFan"
__url__ = "https://www.freecadweb.org"
__version__ = "00.01"
@@ -37,13 +37,14 @@ from TechDrawTools import TDToolsMovers
import os
class TaskCopyView:
class TaskShareView:
def __init__(self):
self._uiPath = App.getHomePath()
self._uiPath = os.path.join(self._uiPath, "Mod/TechDraw/TechDrawTools/Gui/TaskMoveView.ui")
self.form = Gui.PySideUic.loadUi(self._uiPath)
self.form.setWindowTitle(QT_TRANSLATE_NOOP("CopyView", "Copy View to a second Page"))
self.form.setWindowTitle(QT_TRANSLATE_NOOP("ShareView", "Share View with another Page"))
self.form.lViewName.setText(QT_TRANSLATE_NOOP("ShareView", "View to share"))
self.form.pbView.clicked.connect(self.pickView)
self.form.pbFromPage.clicked.connect(self.pickFromPage)
@@ -70,8 +71,8 @@ class TaskCopyView:
_dlgPath = App.getHomePath()
_dlgPath = os.path.join(_dlgPath, "Mod/TechDraw/TechDrawTools/Gui/DlgPageChooser.ui")
dlg = Gui.PySideUic.loadUi(_dlgPath)
dlg.lPrompt.setText(QT_TRANSLATE_NOOP("CopyView", "Select View to copy from list."))
dlg.setWindowTitle(QT_TRANSLATE_NOOP("CopyView", "Select View"))
dlg.lPrompt.setText(QT_TRANSLATE_NOOP("ShareView", "Select View to share from list."))
dlg.setWindowTitle(QT_TRANSLATE_NOOP("ShareView", "Select View"))
views = [x for x in App.ActiveDocument.Objects if x.isDerivedFrom("TechDraw::DrawView")]
for v in views:
@@ -89,8 +90,8 @@ class TaskCopyView:
_dlgPath = App.getHomePath()
_dlgPath = os.path.join(_dlgPath, "Mod/TechDraw/TechDrawTools/Gui/DlgPageChooser.ui")
dlg = Gui.PySideUic.loadUi(_dlgPath)
dlg.lPrompt.setText(QT_TRANSLATE_NOOP("CopyView", "Select From Page."))
dlg.setWindowTitle(QT_TRANSLATE_NOOP("CopyView", "Select Page"))
dlg.lPrompt.setText(QT_TRANSLATE_NOOP("ShareView", "Select From Page."))
dlg.setWindowTitle(QT_TRANSLATE_NOOP("ShareView", "Select Page"))
pages = [x for x in App.ActiveDocument.Objects if x.isDerivedFrom("TechDraw::DrawPage")]
for p in pages:
@@ -108,8 +109,8 @@ class TaskCopyView:
_dlgPath = App.getHomePath()
_dlgPath = os.path.join(_dlgPath, "Mod/TechDraw/TechDrawTools/Gui/DlgPageChooser.ui")
dlg = Gui.PySideUic.loadUi(_dlgPath)
dlg.lPrompt.setText(QT_TRANSLATE_NOOP("CopyView", "Select To Page."))
dlg.setWindowTitle(QT_TRANSLATE_NOOP("CopyView", "Select Page"))
dlg.lPrompt.setText(QT_TRANSLATE_NOOP("ShareView", "Select To Page."))
dlg.setWindowTitle(QT_TRANSLATE_NOOP("ShareView", "Select Page"))
pages = [x for x in App.ActiveDocument.Objects if x.isDerivedFrom("TechDraw::DrawPage")]
for p in pages:

View File

@@ -31,7 +31,7 @@ __date__ = "2022-01-11"
from .TDToolsMovers import *
from .TDToolsUtil import *
from .CommandCopyView import CommandCopyView
from .CommandShareView import CommandShareView
from .CommandMoveView import CommandMoveView
from .TaskCopyView import TaskCopyView
from .TaskShareView import TaskShareView
from .TaskMoveView import TaskMoveView