Menu

#132 Deactivate debugging tools for non-source files

v1.1.x
fixed
None
v1.1.0
Bug Fix
2017-02-14
2017-01-26
Erik Hänel
No

For non-source files like text files it is not necessary to activate the debugging tools (and the "Execute" tool in principle as well). For the "Execute" tool it is possible to redirect it to "load" in this case.

Analysis:
To redirect "Execute" a little change in NumeReWindow::OnDebugCommand() is required, where we have to consider, that not all file types should be "started" rather than "loaded".

To achieve the deactivation of the debug tool bar, we have to add a case in NumeReWindow::OnUpdateDebugUI().

Implementation:
In NumeReWindow::OnDebugCommand() the following lines were added:

...
else
{
    command = "load \"" + command + "\"";
}

In NumeReWindow::OnUpdateDebugUI() the following changes were included:

if (m_currentEd->GetFileName().GetExt() == "nscr" || m_currentEd->GetFileName().GetExt() == "nprc")
{
    tb->EnableTool(ID_DEBUG_ADDEDITORBREAKPOINT, true);
    tb->EnableTool(ID_DEBUG_REMOVEEDITORBREAKPOINT, true);
    tb->EnableTool(ID_DEBUG_CLEAREDITORBREAKPOINTS, true);
}
else
{
    tb->EnableTool(ID_DEBUG_ADDEDITORBREAKPOINT, false);
    tb->EnableTool(ID_DEBUG_REMOVEEDITORBREAKPOINT, false);
    tb->EnableTool(ID_DEBUG_CLEAREDITORBREAKPOINTS, false);
}

as well as OnUpdateDebugUI() was added to the notebook page change event.

These changes solves the issues.

Documention:
Not needed - Bug fix.

Tests:
This fix was verified in a durability test. Bug fix accepted.

Discussion

  • Erik Hänel

    Erik Hänel - 2017-01-26
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2017-01-26
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,9 @@
     For non-source files like text files it is not necessary to activate the debugging tools (and the "Execute" tool in principle as well). For the "Execute" tool it is possible to redirect it to "load" in this case.
    +
    +**Analysis:**
    +
    +**Implementation:**
    +
    +**Documention:**
    +
    +**Tests:**
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2017-01-26
    • summary: Deactive debugging tools for non-source files --> Deactivate debugging tools for non-source files
     
  • Erik Hänel

    Erik Hänel - 2017-01-27
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,9 @@
     For non-source files like text files it is not necessary to activate the debugging tools (and the "Execute" tool in principle as well). For the "Execute" tool it is possible to redirect it to "load" in this case.
    
     **Analysis:**
    +To redirect "Execute" a little change in `NumeReWindow::OnDebugCommand()` is required, where we have to consider, that not all file types should be "started" rather than "loaded".
    +
    +To achieve the deactivation of the debug tool bar, we have to add a case in `NumeReWindow::OnUpdateDebugUI()`.
    
     **Implementation:**
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2017-01-27
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -6,6 +6,33 @@
     To achieve the deactivation of the debug tool bar, we have to add a case in `NumeReWindow::OnUpdateDebugUI()`.
    
     **Implementation:**
    +In `NumeReWindow::OnDebugCommand()` the following lines were added:
    +~~~C
    +...
    +else
    +{
    
    +    command = "load \"" + command + "\"";
    +}
    +~~~
    +
    +In `NumeReWindow::OnUpdateDebugUI()` the following changes were included:
    +~~~C
    +if (m_currentEd->GetFileName().GetExt() == "nscr" || m_currentEd->GetFileName().GetExt() == "nprc")
    +{
    +    tb->EnableTool(ID_DEBUG_ADDEDITORBREAKPOINT, true);
    +    tb->EnableTool(ID_DEBUG_REMOVEEDITORBREAKPOINT, true);
    +    tb->EnableTool(ID_DEBUG_CLEAREDITORBREAKPOINTS, true);
    +}
    +else
    +{
    +    tb->EnableTool(ID_DEBUG_ADDEDITORBREAKPOINT, false);
    +    tb->EnableTool(ID_DEBUG_REMOVEEDITORBREAKPOINT, false);
    +    tb->EnableTool(ID_DEBUG_CLEAREDITORBREAKPOINTS, false);
    +}
    +~~~
    +as well as `OnUpdateDebugUI()` was added to the notebook page change event.
    +
    +These changes solves the issues.
    
     **Documention:**
    
    • status: implementing --> testing
     
  • Erik Hänel

    Erik Hänel - 2017-01-27
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -35,5 +35,6 @@
     These changes solves the issues.
    
     **Documention:**
    +Not needed - Bug fix.
    
     **Tests:**
    
     
  • Erik Hänel

    Erik Hänel - 2017-02-14
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -38,3 +38,4 @@
     Not needed - Bug fix.
    
     **Tests:**
    +This fix was verified in a durability test. Bug fix accepted.
    
    • status: testing --> fixed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB