-
Notifications
You must be signed in to change notification settings - Fork 159
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
feat: Use dialog box for input #1217
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1217 +/- ##
============================================
- Coverage 58.69% 58.25% -0.45%
Complexity 1059 1059
============================================
Files 86 86
Lines 5707 5751 +44
Branches 962 974 +12
============================================
Hits 3350 3350
- Misses 1862 1906 +44
Partials 495 495
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
lets make JBANG_GUI env that if false (and we for now assume its false by default) we work like before and if true we enable this behavior. Then we can release it and get some feedback before enabling it for every jbang install by switching to assume JBANG_GUI is true by default.
So how are we going to get feedback then if it's false by default? |
You have to remember this will only kick in when somebody is using Or we should start creating beta versions for Jbang that people who like to live on the edge can install :-) |
By asking them enable it :) |
Btw. I didn't see it only happen using curl/pipe...are you sure ? I'll test again. |
It should definitely only happen when the stdin is not a shell/terminal. |
And how are you going to do that? Asking a bunch of people if they want to set Better to just ask them directly to download this version and test it for a bit. That way at least they won't forget to enable it. But I think you're being a bit too careful :-) |
btw. how are you testing this ?I can for the love of me not activate it :) |
Hehe, one of the ways is simulating a curl by simply using cat:
|
Sorry, you actually need to be in the
|
also needs rebase after #1211 got merged? |
Jbang now detects if no console is available to ask for user feedback and will try to pop-up a dialog box instead. Fixes jbangdev#1216
Rebase done. |
@maxandersen could you perhaps see if any of the other standard icon options give a better result? jbang/src/main/java/dev/jbang/util/Util.java Line 1365 in 7bae206
It's easier if you test it manually instead of me making changes , committing and then asking you to test :-) |
And it seems that the dock icon can only be changed with JDK 9+ : https://stackoverflow.com/a/56924202/2889926 |
For Java 8+ we would need to set -Xdock:icon=/path/myIcon.png |
...I could fear that only work for some jdks though... |
Yes, and it only works for MacOS and where would we get the icon from? Edit: although we could probably add it to the jbang archive I guess. |
Jbang will now try to set the application icon before showing any dialogs. This is done using reflection because the necessary API was only added to Java since version 9.
@maxandersen can you test if this new version works for you? There should now be Jbang icons both in the dialog and in the MacOS dock. Edit: setting the "taskbar icon" doesn't seem to work on Linux and Windows:
|
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.
also tested on java 8 and here icon is great but task bar is duke but that I can live with :)
Detects when console input is not possible and will pop-up a dialog box instead.
This needs #1211 to be merged first.