DevDebug.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Copyright (c) 2011-2018 by Andrew Mustun. All rights reserved.
  3. *
  4. * DirectDistanceEntry handling added 2013 by Robert S.
  5. *
  6. * This file is part of the QCAD project.
  7. *
  8. * QCAD is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * QCAD is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with QCAD.
  20. */
  21. include("scripts/WidgetFactory.js");
  22. include("scripts/simple.js");
  23. function DevDebug(guiAction) {
  24. EAction.call(this, guiAction);
  25. }
  26. DevDebug.prototype = new EAction();
  27. /**
  28. * Shows / hides the script shell widget.
  29. */
  30. DevDebug.prototype.beginEvent = function() {
  31. EAction.prototype.beginEvent.call(this);
  32. var appWin = RMainWindowQt.getMainWindow();
  33. appWin.setProperty("Debug", true);
  34. EAction.handleUserMessage("Debug mode activated");
  35. };
  36. DevDebug.init = function(basePath) {
  37. var appWin = EAction.getMainWindow();
  38. var action = new RGuiAction(qsTr("&Debug Mode"), appWin);
  39. action.setRequiresDocument(false);
  40. action.setScriptFile(basePath + "/DevDebug.js");
  41. action.setDefaultCommands(["debug"]);
  42. action.setGroupSortOrder(3800);
  43. action.setSortOrder(200);
  44. action.setWidgetNames(["!MiscDevelopmentMenu", "!MiscDevelopmentToolBar", "!MiscDevelopmentToolsPanel"]);
  45. };