Skip to content

Commit

Permalink
Add proof step renames to undo stack
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Cashman committed Nov 28, 2023
1 parent a208cdf commit 64112fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions zxlive/common.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import os
from enum import IntEnum
from typing import Final
from typing import Final, Callable
from typing_extensions import TypeAlias

from PySide6.QtCore import QSettings
from PySide6.QtGui import QColor
from PySide6.QtGui import QColor, QUndoCommand

import pyzx

_ROOT = os.path.abspath(os.path.dirname(__file__))


def get_data(path: str) -> str:
return os.path.join(os.environ.get("_MEIPASS", _ROOT), path)

Expand Down
1 change: 1 addition & 0 deletions zxlive/proof.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def rename_step(self, index: int, name: str):
# Must create a new Rewrite object instead of modifying current object
# since Rewrite inherits NamedTuple and is hence immutable
self.steps[index] = Rewrite(name, old_step.rule, old_step.diff)
self.dataChanged.emit(QModelIndex(), QModelIndex(), [])

# Rerender the proof step otherwise it will display the old name until
# the cursor moves
Expand Down
2 changes: 1 addition & 1 deletion zxlive/proof_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from . import animations as anims
from .base_panel import BasePanel, ToolbarSection
from .commands import AddRewriteStep, GoToRewriteStep, MoveNodeInStep
from .commands import AddRewriteStep, GoToRewriteStep, MoveNodeInStep, UndoableChange
from .common import (ET, VT, GraphT, get_data,
pos_from_view, pos_to_view, colors)
from .dialogs import show_error_msg
Expand Down

0 comments on commit 64112fb

Please sign in to comment.