-
Notifications
You must be signed in to change notification settings - Fork 7
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
Open in Text Editor #70
base: master
Are you sure you want to change the base?
Conversation
update fork with source
opens file with map scripts in system’s default
mainwindow.cpp
Outdated
#elif defined Q_OS_LINUX | ||
QString cmd = "xdg-open "; | ||
#else // WINDOWS | ||
QString cmd = "cmd /c start "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work (on Windows) unless running pretmap from the command line (and not sure even then)
mainwindow.cpp
Outdated
@@ -826,6 +850,13 @@ void MainWindow::updateSelectedObjects() { | |||
widget->setLayout(fl); | |||
frame->layout()->addWidget(widget); | |||
|
|||
// generate "Open in Text Editor" button | |||
if (key == "script_label") { | |||
QPushButton *scriptButton = new QPushButton(QString("Open This Map's Scripts in a Text Editor")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
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
.inc
extension (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*