Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the loadClassContentString API for cut, copy and paste #11598

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

adeas31
Copy link
Member

@adeas31 adeas31 commented Nov 17, 2023

Related Issues

#11540

Purpose

Retain the clipboard contents even if the model is unloaded or OMEdit is closed.

Approach

Generate a Modelica code of the selected elements and put it on the clipboard as text. Use the new API loadClassContentString to merge the text. This avoids relying on the internal OMEdit structures which are lost when the model is unloaded and are not available after OMEdit is closed.

@adeas31 adeas31 added COMP/GUI/OMEdit Issue and pull request related to OMEdit COMP/GUI/InstBased Interface Issues with new instantiation-based OMEdit feature labels Nov 17, 2023
@adeas31 adeas31 self-assigned this Nov 17, 2023
Instead of using the OMEdit internal structures for pasting elements use `loadClassContentString` to merge.
Generate the Modelica code from the selected elements and then merge the code using `loadClassContentString`.
Put the data in the form of string and JSON on the clipboard. Use it when paste is called.
@adeas31 adeas31 enabled auto-merge (squash) November 27, 2023 11:06
@adeas31 adeas31 merged commit 2794f15 into OpenModelica:master Nov 27, 2023
2 checks passed
@adeas31 adeas31 deleted the cut-copy-paste branch November 27, 2023 11:53
adeas31 added a commit to adeas31/OpenModelica that referenced this pull request Nov 28, 2023
…elica#11598)

Instead of using the OMEdit internal structures for pasting elements use `loadClassContentString` to merge.
Generate the Modelica code from the selected elements and then merge the code using `loadClassContentString`.
Put the data in the form of string and JSON on the clipboard. Use it when paste is called.
adeas31 added a commit that referenced this pull request Nov 28, 2023
* fix OMSimulator PYTHONPATH in OMEdit (#11526)

* update subModule OMSimulator

* Check if we have a parameter modification or a binding (#11599)

Fixes #11595

* Do not use elided text for multiline string with fixed font size (#11610)

Fixes #8383

* Add loadClassContentString API (#11574)

* Rename conflicting elements in loadClassContentString (#11613)

Fixes #11596

* Added a tab widget at the bottom of MainWindow (#11627)

* Added a tab widget at the bottom of MainWindow

The tab widget mimics the Messages Browser. It is a shorter version of it.
Only shown when Messages Browser is hidden.
Messages Browser can now only be docked at the bottom.

Scroll to bottom when a new simulation output is added.

Fixes #9889

* Set the index to 0

* Fix the context menu for shapes (#11634)

This is a regression introduced in afb86a3

* Use the `loadClassContentString` API for cut, copy and paste (#11598)

Instead of using the OMEdit internal structures for pasting elements use `loadClassContentString` to merge.
Generate the Modelica code from the selected elements and then merge the code using `loadClassContentString`.
Put the data in the form of string and JSON on the clipboard. Use it when paste is called.

* Show the typed dimensions of array parameter in the dialog (#11629)

* Improve loadClassContentString (#11644)

- Traverse equations/algorithms manually when renaming instead of using
  the AbsynUtil traversal functions, since the traversal functions only
  traverses expressions and not crefs in e.g. connect equations.
- Rewrite the conflict handling to avoid generating new names that
  conflicts with the elements being added.

* Do not call show documentation when editing documentation

Fixes #11638
Calling show documentation while editing causes a recursion

* Do not push intermediate commands to stack

* Use QScrollArea for welcome page buttons

Fixes #10235

---------

Co-authored-by: arun3688 <rain100falls@gmail.com>
Co-authored-by: Per Östlund <per.ostlund@liu.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP/GUI/InstBased Interface Issues with new instantiation-based OMEdit feature COMP/GUI/OMEdit Issue and pull request related to OMEdit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant