-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Implemented about dialog in Java FX #968
Conversation
Travis CI uses Jdk 1.8.0_31, and because of this cannot compile this. |
As it says in the error message the class javafx.scene.control.Alert can not be found since this has been introduced in Java 8_40 along with javafx.scene.control.Dialog. However this is a essential part in creating a javafx gui since it is basically the equivalent class to JOptionPane / JDialog classes in swing. |
Please do investigate on this. |
@boceckts This is currently a problem with Travis,but it can be updated: This one looks the most promising: |
|
||
closeButton.setText(Localization.lang("Close")); | ||
|
||
copyButton.setText(Localization.lang("Copy_version_to_clipboard")); |
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.
Just use normal spaces instead of underscore. Then the circleci test should pass.
@boceckts As JabRef uses both CircleCI and Travis and tests for both OpenJDK and JRE, there won't be a simple solution. |
For cicle CI Edit// This one here for installing new version of qt5 seems to be related/similar: |
Thank you for all your feedback, I'm goinig to further investigate on this. |
try (InputStream imageStream = JabRef.class.getResourceAsStream("/images/external/JabRef-icon-48.png"); | ||
InputStream fxmlStream = JabRef.class.getResourceAsStream("/gui/help/AboutDialogLayout.fxml");) { | ||
DialogPane dialogContentPane = (DialogPane) loader.load(fxmlStream); | ||
javafx.scene.image.Image img = new javafx.scene.image.Image(imageStream); |
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.
don't use abbreviation here. img-> image
7c34de8
to
ae7fbe7
Compare
I created a new AboutDialog class which handles its initialization itself as previously. This way there are less changes and imports in the JabrefFrame class. |
Interestingly I found out that circle-ci is already using java8 u40:
|
Thanks for pointing this out, I already wondered since I didn't touch the circle.yml yet the tests are passing on CircleCI. |
setDialogStyle(JabRefMain.class.getResource("/gui/help/AboutDialog.css").toExternalForm()); | ||
} catch (IOException e) { | ||
logger.debug("AboutDialog could not be completely loaded!", e); | ||
} catch (NullPointerException e) { |
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.
Do not catch NPEs.
Please ensure that this version of JabRef also runs under Linux with OpenJDK. |
As this states https://docs.travis-ci.com/user/trusty-ci-environment/ it should be possible to switch to the trusty beta build environment where we should be able to use the open jdk 1.8.0_60. I'm going to try this first before manually testing it. |
We should sit together and think about a good design. I would like to have tabs instead of these strange pull down menus. Reason: responsiveness of the UI. If I click something, I want to read the things instantly. Proposal: Fix the minor issues here, then merge and then think about a good design of the dialog. I liked the JabRef 3.2 About dialog more - maybe we can put each heading into a tab and render the first two paragraphs above that. |
|
||
websiteGithub.set("https://github.com/JabRef/jabref"); | ||
|
||
copyButtonText.set(Localization.lang("Copy_Version")); |
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.
Please change it back to %Copy Version
in the fxml file. We will later provide a proper fix for this issue.
Current coverage is 27.32%@@ javafx #968 diff @@
=====================================
Files 696 699 +3
Lines 46446 46557 +111
Methods 0 0
Branches 7703 7705 +2
=====================================
+ Hits 12719 12721 +2
- Misses 32628 32738 +110
+ Partials 1099 1098 -1
|
The old dialog and html layout file have been removed. The layout of the dialog panel is defined in the AboutDialog.fxml file located in the resources with its stylesheet. The AboutDialogViewModel class takes care of the text initialization of any components in the layout. It also implements any methodes called from any component of the dialog panel. The dialog is build and shown in the AboutDialogView class.
I changed the code accordingly to your comments. |
I will now merge this PR in (in the JavaFX branch) so that you can work on further dialogs. You are right, the keyboard shortcuts dialog looks relatively good. The "grab" button is probably superfluous and "Default" should specify if it resets just one shortcut or all. Moreover, I like the design in the Vivaldi browser: |
I will simplyfy it and remove the tab view. |
Looks good! Just one minor thing, the URL for contributing seems to be not aligned at the same height as the label |
Looks way better!
I would slightly reorganize everything, but your version is also fine |
@tobiasdiez and no Comic Sans MS style (as from the mockup) http://www.comicsanscriminal.com/ ;) |
So there are two new versions similar to what @tobiasdiez suggested. It really looks a bit weird to me with so much space in the top but the information to display is rather small, maybe resize the dialog a bit smaller? |
The small dialog looks good. ❤️ |
Yes I really love the smaller dialog. Good work! Where is the PR?? I want to merge it right-away 😄 |
@Siedlerchr the encoding is set to UTF-8 without BOM but unfortunately your changes have no effect for me. |
Regarding the encoding problems, I just fixed it with #1954. Please try again with the changes I made (gradle changes + version info) |
This is the first dialog in JabRef being implemented in JavaFX. The Dialog is highly flexible in positioning and styling its components through a fxml and corresponding css stylesheet. If JavaFX should be a part of JabRef it is probabbly usefull to define a global stylesheet as well to become a consistent look and feel.
To include JavaFX in JabRef I had to adjust the starting and closing behaviour of Jabref.
In order to run these commits, Java 8_40 or newer is required!