-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Full compatibility for Sumatra custom path #2781
Conversation
…ppears in PDF Viewer ComboBox, and making it work with Forward Search and the Configure Inverse Search. 1. Changed isSumatraAvailable in SumatraConversation to a singleton object that checks if Sumatra is available. 2. Added an InputVerifier on the TextField of Custom Sumatra Path that checks the validity of the path, and updates the value of isSumatraAvailable and updates the items in the PDF Viewer ComboBox. 3. Changed the availability in the InternalPdfViewer to a function so that it can be changed during execution. 4. Removed the lines checking if the Sumatra Custom Path was null in addOpenViewerListener so that the user can select which PDF Viewer to open, even if a Sumatra Custom Path is present.
Inverse search action supported for custom SumatraPath Added support for loading custom SumatraPath at startup Redone update of the PdfViewerComboBox to eliminate errors Changed SumatraConversation from a class to an object to better match InternalPdfViewers Added a run function that doesn't wait for a return of the program executed
Qodona warning suppress
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.
Great, nice work! Just a few minor comments, but I think functionality is good as it is.
src/nl/hannahsten/texifyidea/action/sumatra/ConfigureInverseSearchAction.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/run/latex/ui/LatexSettingsEditor.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/run/latex/ui/LatexSettingsEditor.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/run/sumatra/SumatraConversation.kt
Outdated
Show resolved
Hide resolved
src/nl/hannahsten/texifyidea/run/sumatra/SumatraConversation.kt
Outdated
Show resolved
Hide resolved
Configure Inverse Search Action back to showing when Sumatra is available. Redone InputVerifier in LatexSettingsEditor to just update the ComboBox and SumatraAvailabilityChecker, no focus changes. Added a file for SumatraAvailabilityChecker. Initialization of SumatraConversation done in execute(). SystemEnvironment updated to be a non-blocking function when necessary.
Moved verification of custom Sumatra path from LatexSettingsEditor InputVerifier to LatexRunConfiguration@checkConfiguration. - Added enableSumatraPath reference in LatexRunConfiguration to make it work. - LatexSettingsEditor edits runConfiguration.enableSumatraPath. - Kept the InputVerifier to update the PDFViewer ComboBox Changed isSumatraPathAvailable to know when a customPath is valid (even if Sumatra is in PATH). - Now returns if Sumatra is available globally (in PATH and custom path) and if Sumatra is available in custom path. - Necessary to make the LatexRunConfiguration@checkConfiguration work. Removed some unnecessary assignation to SumatraAvailabilityChecker. Added some comments.
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.
Great work! This is a much better user experience, works for me as expected.
Fix #2737
Summary of additions and changes
Added full support when inputting a custom Sumatra path, so that it appears in PDF Viewer ComboBox, and making it work with Forward Search and the Configure Inverse Search.
In brief : when inputting a correct custom Sumatra path (valid path and that contains SumatraPDF.exe), after clicking away from the TextBox, Sumatra automatically appears in the ComboBox of PDF Viewer. And then, making it work with Forward Search and the Configure Inverse Search.
How to test this pull request
Open TeXiFy with only global PATH set to Sumatra (afterwards, do the same with registry keys)
Under LaTeX configuration, under "PDF viewer", "Sumatra" should appear.
Under Tools/LaTeX, option to "Configure Inverse Search" should work as normal.
Forward search should work as normal.
Set no PATH and no registry keys to Sumatra.
Set custom path to Sumatra in Run Configuration to real Sumatra install and click away from the text box.
Under "PDF viewer", "Sumatra" should appear.
Set custom path to Sumatra in Run Configuration to a real folder that doesn't contain Sumatra and click away from the text box.
Under "PDF viewer", "Sumatra" shouldn't appear and an error popup should appear.
Set custom path to Sumatra in Run Configuration to a folder that doesn't exist and click away from the text box.
Under "PDF viewer", "Sumatra" shouldn't appear and an error popup should appear.
Select a "PDF viewer" of your choice under LaTeX configuration, under "PDF viewer".
Run LaTeX project, the PDF viewer selected should open (even if Sumatra is in the Path).