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

Allow setting working directory #1580

Merged
merged 10 commits into from Jun 3, 2017

Conversation

Projects
None yet
3 participants
@ketanhwr
Contributor

ketanhwr commented May 29, 2017

This addresses #941. I've also split 'Command' to 'Executable' and 'Arguments'. I've shown the design in the issue and one of the reasons for this was ..the "Browse" button to choose the executable currently resets the command line arguments.

A screenshot of what I've done:
tiled-wd

@Ablu

Do you think it would be possible to unify the replacement logic for the command and the working directory? So that all variables can be used in both fields? Of course this needs special handling regarding the quotes...

Show outdated Hide outdated src/tiled/command.cpp Outdated
@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr May 29, 2017

Contributor

I was thinking the same, but to extend the custom command system with two separate functions would easy when we add new variables. New variables would normally be unique to Executable or Working Directory. So, unifying them won't be helpful, imo.

Contributor

ketanhwr commented May 29, 2017

I was thinking the same, but to extend the custom command system with two separate functions would easy when we add new variables. New variables would normally be unique to Executable or Working Directory. So, unifying them won't be helpful, imo.

@Ablu

This comment has been minimized.

Show comment
Hide comment
@Ablu

Ablu May 29, 2017

Contributor

Well... I think if we have one central place to add new variables that should be just as easy. (if the quote handling is also done automatically). So I would think of one function which does all the replacement is then invoked for both, the command and the working directory.

Contributor

Ablu commented May 29, 2017

Well... I think if we have one central place to add new variables that should be just as easy. (if the quote handling is also done automatically). So I would think of one function which does all the replacement is then invoked for both, the command and the working directory.

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr May 29, 2017

Contributor

Alright, I'll think up of some solution for this. I actually made a function substituteVariables() but discarded it. Nvm, I'll add it again

Contributor

ketanhwr commented May 29, 2017

Alright, I'll think up of some solution for this. I actually made a function substituteVariables() but discarded it. Nvm, I'll add it again

ketanhwr added some commits May 31, 2017

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr May 31, 2017

Contributor

@Ablu I've done both the things which were left, you can review now. The build is failing due to libtiled-java 😕

Contributor

ketanhwr commented May 31, 2017

@Ablu I've done both the things which were left, you can review now. The build is failing due to libtiled-java 😕

Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.cpp Outdated

ketanhwr added some commits May 31, 2017

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr May 31, 2017

Contributor

@Ablu what you suggested works nicely! Have a look now 🙂

Contributor

ketanhwr commented May 31, 2017

@Ablu what you suggested works nicely! Have a look now 🙂

Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.cpp Outdated
@bjorn

Looks like a nice change overal! I've made some inline comments.

In addition, please make sure that existing commands remain functional as-is. It looks like currently their command will no longer be read out at all, but care should be taken not to break the command setup for existing users. Probably it would be enough to read in the "Command" setting into the new "Executable" setting.

Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.h Outdated
@bjorn

Some more comments. :-)

Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.cpp Outdated
Show outdated Hide outdated src/tiled/command.cpp Outdated

ketanhwr added some commits Jun 3, 2017

@bjorn bjorn merged commit f59b10c into bjorn:master Jun 3, 2017

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jun 3, 2017

Owner

Looking good, thanks!

Owner

bjorn commented Jun 3, 2017

Looking good, thanks!

@bjorn bjorn referenced this pull request Jun 3, 2017

Merged

Adds Autocrop feature #1574

thabetx added a commit to thabetx/tiled that referenced this pull request Jun 7, 2017

Allow setting working directory (bjorn#1580)
Also separated arguments and executable and added %executablepath variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment