-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversion of preferences/exportsorting, import, maintable and entryeditor to mvvm #5315
Conversation
I accidentally pushed some changes I temporarily made to the checkstyle.xml, since the dtd does not exist on the puppycrawl-server. Should I remove them again? |
@@ -88,7 +86,7 @@ private void initialize() { | |||
.withText(PreferencesTab::getTabName) | |||
.install(preferenceTabList); | |||
|
|||
viewModel.setValues(); // ToDo: Remove this after conversion of all tabs | |||
DefaultTaskExecutor.runInJavaFXThread(viewModel::setValues); |
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.
Could you please add a comment why this is necessary?
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.
The FXThread or setValues()?
This is something I forgot to put in a BackgroundTask, @tobiasdiez asked to lazy-load the prefs, I did not have time to look deeper into it.
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.
Is this a bad idea?
BackgroundTask.wrap(() -> DefaultTaskExecutor.runInJavaFXThread(() -> viewModel.setValues())).executeWith(Globals.TASK_EXECUTOR);
I know, that is not lazy loading of the preference values at all. But lazy loading would mean, there need to be some more precautions and checks, like in the store-method of the tabs, that they wont store empty prefs. Just wanted to hear your thoughts before I start refactoring something, that could be rejected in the end.
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 formulated that in a quite misleading way. What I meant is that tab.setValues
should only be called when tab
gets the focus - and not when the preference dialog is loaded. I was hoping to improve the loading time of the dialog in that way. But this kind of lazy loading probably needs a bit of refactoring because you don't want to override the users temporary changes when he switches between tabs. You can leave this also for another PR.
No problem I guess. In general code looks good, I did not find anything big. Please test if scroll bars are automatically shown when you resize the tabs or when you have a small screen so that all is still visible. The java 9 module stuff is indeed crazy. I did not knew that it's required in the same project. Always thought it's for external visibility |
1f88a18
to
3c0eae0
Compare
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.
Thanks! I have to disappoint you as my remarks are only minor - so your thesis will be happy to get your full attention tomorrow ;-) (or are already finished?).
@@ -1,7 +1,7 @@ | |||
<?xml version="1.0"?> | |||
<!DOCTYPE module PUBLIC | |||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN" | |||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | |||
"http://www.checkstyle.org/dtds/configuration_1_3.dtd"> |
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.
Yes, just leave these changes...they are so minimal that they don't justify the overhead of a new PR.
@@ -88,7 +86,7 @@ private void initialize() { | |||
.withText(PreferencesTab::getTabName) | |||
.install(preferenceTabList); | |||
|
|||
viewModel.setValues(); // ToDo: Remove this after conversion of all tabs | |||
DefaultTaskExecutor.runInJavaFXThread(viewModel::setValues); |
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 formulated that in a quite misleading way. What I meant is that tab.setValues
should only be called when tab
gets the focus - and not when the preference dialog is loaded. I was hoping to improve the loading time of the dialog in that way. But this kind of lazy loading probably needs a bit of refactoring because you don't want to override the users temporary changes when he switches between tabs. You can leave this also for another PR.
😭 |
The scrollbars show up in testing automatically, but only to a certain size (About 600 pixels in width of the preferences dialog. Scenic view does not seem to work with a gradle run on my machine currently). Below that, the scrollbar is being eaten by the dialog width. I created the fxml very quickly with a fixed width of 650 pixels for simplicity, as I had no patience yet to make everything scalable. But I think this could be easily done after everything is converted to the mvvm-pattern just inside the fxmls. This is quite a todo list, growing and growing: 😀
|
I am merging this now! Thanks again for your continouos contribution! 👍 We really appreciate that! I would say we should first focus on finishing the prefs tabs stuff. Making it look "nice" is another not so important task atm. |
30fb68e Create BJEDIS-ABNT-Number (#5255) aafb868 Update geochimica-et-cosmochimica-acta.csl (#5321) 60ba25f british-journal-of-anaesthesia.csl: add comma delimiter between non-sequential citations eg. 1 4 7-9 -> 1, 4, 7-9 (#5313) 67e6564 Reindent/reorder (#5318) c0d2a39 Ruby 3.0.0 (#5309) 76d60ff Update harvard-anglia-ruskin-university.csl (#5310) bc18ac9 Create journal-for-the-study-of-the-new-testament.csl (#5312) aff602c Update journal-of-food-protection.csl (#5315) 4503826 Update muscle-and-nerve.csl (#5317) 3bed58e constant redefinition 4d718a0 update documentaiton link fa99e2f add comma delimiter between succesive numbers d396f8b Allow privileged testing of PRs (#5307) 43b22c7 Update masarykova-univerzita-pravnicka-fakulta.csl, pravnik.csl, iso690-full-note-cs.csl (#5308) 8a31c1e Update copernicus-publications.csl (#5303) 96760bb Update anabases.csl (#5304) 744de6d removed locale (#5300) 7eb0d60 Update aviation-space-and-environmental-medicine.csl (#5297) 2769970 Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-ser… (#5298) 51e3f4c Update harvard-university-of-bath.csl (#5299) 5fce84f Create cns-spectrums.csl (#5290) bb8082c Create journal-of-surgical-oncology.csl (#5259) 90c13ae Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-ser… (#5288) 4bab1ad Update early-christianity.csl (#5289) 636ba78 Update tatup-zeitschrift-fur-technikfolgenabschatzung-in-theorie-und-… (#5291) b7cc511 Create biotechnologia.csl (#5292) 5bab881 Update journal-of-orthopaedic-trauma.csl (#5287) 5943413 Fix locales (#5285) 302bd65 Update universite-du-quebec-a-montreal-departement-dhistoire.csl (#5286) 860ae48 Add Haaga-Helia University of Applied Sciences Harvard style (#5282) c1c27de Localize Metropolia style title (#5283) 508da89 Fix presentation for Methods of Information in Medicine (#5284) 53e1d0b Create geschichte-und-gesellschaft.csl (#5216) d7ed0cb Create universite-de-geneve-departement-de-francais-moderne.csl (#5212) 80c404b Update journal-of-orthopaedic-trauma.csl (#5281) 20c143a Adding publishers' names (#5280) 6e5cd59 Update sodertorns-hogskola-oxford.csl (#5279) 52f2621 dollar-brace a260294 Create journal-of-microbiology-and-biotechnology.csl (#5277) 1fc979e Create qeios.csl (#5261) 86347b7 GH does this for us -- again, sorry guys b649589 Create experimental-biology-and-medicine.csl (#5276) 12ae0b1 Revert "tell sheldon about the job state" bdcae89 tell sheldon about the job state 1240067 Add Vegetation classification and Survey (#5271) 6f398f0 Major update to Gallia.csl (#5269) 2a74b2c Update filters.yaml (#5273) 20046d2 Update spec_helper.rb (#5272) 2ee0dd8 Create the-sociological-review.csl (#5260) 5b8d09c move filters to inert file to pacify Sheldon (#5268) e5f3315 Localize more language descriptors in style titles (#5270) bfd2942 Localize more language descriptors in style titles (#5267) 35e276f Fix variable used for the label after indication of number of pages (#5240) 60f6371 Create Universidade-do-Estado-do-Rio-de-Janeiro.csl (#5247) d8cc2ae Create the-journal-of-the-acoustical-society-of-america-numeric.csl (#5256) 92259c1 Create journal-of-financial-and-quantitative-analysis.csl (#5264) 6ba8aab Create journal-of-vestibular-research.csl (#5258) 0c88f41 Update european-journal-of-international-law.csl (#5265) cff5abc Put language descriptor within parentheses 4a62709 Update monash-university-harvard.csl (#5253) 64fd1aa Localize more language descriptors in style titles (#5262) f6519cb Localize more language descriptors in style titles (#5257) 170ccae tiny fixes for universitat-basel-iberoromanistik.csl (#5254) b7284c9 Localize more language descriptors in style titles (#5252) f4ef858 Add "Baishideng Publishing Group" dependents (#5251) 266e7c3 Make world-journal-of-hepatology.csl to bpg.csl parent (#5243) 9129098 fix small formatting issues for mclc.csl (#5229) 5d9560b Create crispr-journal.csl (#5249) a217299 Change "Czech" to "Čeština" in titles (#5248) 4fef39a Create journal-of-open-research-software.csl (#5245) 2bff1a6 Change "Dutch" to "Nederlands" in titles (#5242) f28da34 Update spec_helper.rb (#5246) e0e977c Move content from wiki pages to markdown files (#5194) 018304c Update universite-de-montreal-apa.csl (#5239) 3b83e5c Create sodertorns-hogskola-oxford.csl (#5234) 1335378 Stop notifying 8827 port on Zotero servers (#5237) f079b2a Update author-year disambiguation (#5238) 60bb0c9 Update technische-universitat-dresden-medizin.csl (#5236) e374657 Create Leidraad voor juridische auteurs 2019 (Dutch) (#5223) 0450d89 Add new style for U of Mannheim, Germanistische Linguistik (#5228) 81f0689 Create health-sports-rehabilitation-medicine.csl (#5233) c152a44 Update Gemfile.lock (#5235) 748e1eb Update geochimica-et-cosmochimica-acta.csl (#5231) 06b9ce8 Update zeitschrift-fur-theologie-und-philosophie.csl (#5230) e747cb1 haute-ecole-de-gestion-de-geneve: Make polyglot & et al changes 4cfedb7 Create universite-de-sherbrooke-histoire.csl (#5210) a96a61e Update journal-of-glaciology.csl (#5222) c6a94c9 Add Journal of Human Rights (#5227) c5c9c5f Update ruhr-universitat-bochum-lehrstuhl-fur-industrial-sales-and-ser… (#5214) ffb7aa6 Create comparativ.csl (#5215) e07329a Update lancaster-university-harvard.csl (#5220) c075d41 Update mimesis-edizioni.csl (#5219) 502970a Removed space in year only citation (#5218) 13e8c6b Update acta-scientiae-veterinariae.csl (#5209) 0699da6 Remake mammallia.csl for Oct/2020 guidelines. (#5207) b2dd3fd Update journal-of-international-business-studies.csl (#5217) dd52bfe Update quaternaire.csl (#5199) ccb1b0d rebuild webpage and article-journal citations in journal-of-forensic-sciences.csl (#5203) f02f4fb Create pedosphere.csl (#5196) 70dd87a Create open-gender-journal.csl (#5198) d272998 Create the-quarterly-journal-of-economics.csl (#5197) d27cab3 fix locale issues, add cite-locator (#5206) git-subtree-dir: buildres/csl/csl-styles git-subtree-split: 30fb68e
follow-up to #5033
This PR ha grown pretty huge too, although there is nothing really complicated in it. The four very simple tabs are converted and I included some suggestions about templates/generics and icons @tobiasdiez made in #5185 comment and in #5265.
The SaveOrderConfigDisplay had to be refactored, as there were some bugs: It did not want to set the values after resetting the preferences and it could not load the fields-class (crazy java9-module-stuff), so I also had to change some exports in the modules-info. There I also included some changes out of the gitter-discussion.
I already got some ideas how to resort all the preferences and options in the options-menu, One could change the ListView on the sidePane to a TreeView and start thinning each tab into small preferenceTabs. The help buttons could also be somehow adjusted for each tab at the same position. (maybe somewhere to the right of the title)
I guess there are some things to be discussed or corected in this PR, so im looking forward for your comments.