MiscDevelopment.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. * Copyright (c) 2011-2018 by Andrew Mustun. All rights reserved.
  3. *
  4. * This file is part of the QCAD project.
  5. *
  6. * QCAD is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * QCAD is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with QCAD.
  18. */
  19. /**
  20. * \defgroup ecma_misc_development Misc development tools
  21. * \ingroup ecma_misc
  22. *
  23. * \brief This module contains misc development tools.
  24. */
  25. include("scripts/Misc/Misc.js");
  26. /**
  27. * \class MiscDevelopment
  28. * \ingroup ecma_misc_draw
  29. * \brief Base class for misc development tools.
  30. */
  31. function MiscDevelopment(guiAction) {
  32. Misc.call(this, guiAction);
  33. }
  34. MiscDevelopment.prototype = new Misc();
  35. MiscDevelopment.includeBasePath = includeBasePath;
  36. MiscDevelopment.getMenu = function() {
  37. // var menu = EAction.getSubMenu(
  38. // Misc.getMenu(),
  39. // 51150, 100,
  40. // MiscDevelopment.getTitle(),
  41. // "MiscDevelopmentMenu"
  42. // );
  43. // return menu;
  44. };
  45. MiscDevelopment.getToolBar = function() {
  46. var tb = EAction.getToolBar(qsTr("Misc") + " " + MiscDevelopment.getTitle(), "MiscDevelopmentToolBar", Qt.TopToolBarArea, Misc.getContextMenuCategory());
  47. tb.visible = false;
  48. return tb;
  49. };
  50. MiscDevelopment.getCadToolBarPanel = function() {
  51. var mtb = Misc.getCadToolBarPanel();
  52. var actionName = "MiscDevelopmentToolsPanelAction";
  53. if (!isNull(mtb) && mtb.findChild(actionName)==undefined) {
  54. var action = new RGuiAction(qsTr("Misc Development Tools"), mtb);
  55. action.setScriptFile(MiscDevelopment.includeBasePath + "/MiscDevelopment.js");
  56. action.objectName = actionName;
  57. action.setRequiresDocument(true);
  58. //action.setIcon(MiscDevelopment.includeBasePath + "/MiscDevelopment.svg");
  59. //action.setStatusTip(qsTr("Show misc development tools"));
  60. action.setNoState();
  61. action.setDefaultCommands(["miscdevelopmentmenu"]);
  62. action.setGroupSortOrder(90);
  63. action.setSortOrder(10000);
  64. action.setWidgetNames(["MiscToolsPanel"]);
  65. }
  66. var tb = EAction.getCadToolBarPanel(
  67. MiscDevelopment.getTitle(),
  68. "MiscDevelopmentToolsPanel",
  69. true
  70. );
  71. return tb;
  72. };
  73. MiscDevelopment.getTitle = function() {
  74. return qsTr("De&velopment");
  75. };
  76. MiscDevelopment.prototype.getTitle = function() {
  77. return MiscDevelopment.getTitle();
  78. };
  79. MiscDevelopment.init = function() {
  80. MiscDevelopment.getMenu();
  81. MiscDevelopment.getToolBar();
  82. MiscDevelopment.getCadToolBarPanel();
  83. };