MiscInformation.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (c) 2017 by RibbonSoft, GmbH. All rights reserved.
  3. *
  4. * This file is part of the QCAD project.
  5. *
  6. * Licensees holding valid QCAD Professional Edition licenses
  7. * may use this file in accordance with the QCAD License
  8. * Agreement provided with the Software.
  9. *
  10. * This file is provided AS IS with NO WARRANTY OF ANY KIND,
  11. * INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
  12. * FOR A PARTICULAR PURPOSE.
  13. *
  14. * See http://www.ribbonsoft.com for further details.
  15. */
  16. include("scripts/Misc/Misc.js");
  17. /**
  18. * \class MiscInformation
  19. * \brief Base class for misc info tools.
  20. */
  21. function MiscInformation(guiAction) {
  22. EAction.call(this, guiAction);
  23. }
  24. MiscInformation.prototype = new EAction();
  25. MiscInformation.includeBasePath = includeBasePath;
  26. MiscInformation.getMenu = function() {
  27. // var menu = EAction.getSubMenu(
  28. // Misc.getMenu(),
  29. // 51100, 600,
  30. // MiscInformation.getTitle(),
  31. // "MiscInformationMenu"
  32. // );
  33. // return menu;
  34. };
  35. MiscInformation.getToolBar = function() {
  36. var tb = EAction.getToolBar(qsTr("Misc") + " " + MiscInformation.getTitle(), "MiscInformationToolBar", Qt.TopToolBarArea, Misc.getContextMenuCategory());
  37. tb.orientation = Qt.Vertical;
  38. tb.visible = false;
  39. return tb;
  40. };
  41. MiscInformation.getCadToolBarPanel = function() {
  42. var mtb = Misc.getCadToolBarPanel();
  43. var actionName = "MiscInformationToolsPanelAction";
  44. if (!isNull(mtb) && mtb.findChild(actionName)==undefined) {
  45. var action = new RGuiAction(qsTr("Misc Information Tools"), mtb);
  46. action.setScriptFile(MiscInformation.includeBasePath + "/MiscInformation.js");
  47. action.objectName = actionName;
  48. action.setRequiresDocument(true);
  49. //action.setIcon(MiscInformation.includeBasePath + "/MiscInformation.svg");
  50. //action.setStatusTip(qsTr("Show misc information tools"));
  51. action.setNoState();
  52. action.setDefaultCommands(["miscinfomenu"]);
  53. action.setGroupSortOrder(90);
  54. action.setSortOrder(450);
  55. action.setWidgetNames(["MiscToolsPanel"]);
  56. }
  57. var tb = EAction.getCadToolBarPanel(
  58. MiscInformation.getTitle(),
  59. "MiscInformationToolsPanel",
  60. true
  61. );
  62. return tb;
  63. };
  64. MiscInformation.getTitle = function() {
  65. return qsTr("&Information");
  66. };
  67. MiscInformation.prototype.getTitle = function() {
  68. return MiscInformation.getTitle();
  69. };
  70. MiscInformation.init = function() {
  71. MiscInformation.getMenu();
  72. MiscInformation.getToolBar();
  73. MiscInformation.getCadToolBarPanel();
  74. };