Open
Conversation
update fork with source
opens file with map scripts in system’s default
garakmon
commented
Aug 13, 2018
mainwindow.cpp
Outdated
| #elif defined Q_OS_LINUX | ||
| QString cmd = "xdg-open "; | ||
| #else // WINDOWS | ||
| QString cmd = "cmd /c start "; |
Contributor
Author
There was a problem hiding this comment.
I don't think this will work (on Windows) unless running pretmap from the command line (and not sure even then)
Contributor
Author
huderlem
reviewed
Sep 6, 2018
mainwindow.cpp
Outdated
|
|
||
| // generate "Open in Text Editor" button | ||
| if (key == "script_label") { | ||
| QPushButton *scriptButton = new QPushButton(QString("Open This Map's Scripts in a Text Editor")); |
Contributor
There was a problem hiding this comment.
I don't think this button should be added in the context of the event. If you have multiple events selected, you'll see this button for each selected event. Instead, the button should probably just go underneath the "New Object" and "Delete" buttons. Also, it's a bit too long. Maybe just "Open Map Scripts"
Contributor
Author
There was a problem hiding this comment.
Oh I didn't realize you could have multiple selected events. Agree with both the comments-- will make appropriate changes. Did the button work for you though?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds functionality to open a Map's scripts in a text editor (#60 ). The editor opened is the system's default editor for files with the
.incextension (usually default text editor unless otherwise set).The button is only available when an event with a script is selected.
*Needs to be tested (and probably modified) on Windows & Linux*