Skip to content

Commit

Permalink
Merge pull request #30 from mastodon-sc/fix-small-issues
Browse files Browse the repository at this point in the history
Improve Error Dialog & Increase Timeout for Starting Blender
  • Loading branch information
maarzt authored Oct 18, 2024
2 parents 50da777 + 0bbcda8 commit 8fae192
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/mastodon/blender/ViewServiceClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static void waitForConnection( int port )
String version = ViewServiceGrpc
.newBlockingStub( channel )
.withWaitForReady()
.withDeadlineAfter( 10, TimeUnit.SECONDS )
.withDeadlineAfter( 20, TimeUnit.SECONDS )
.getVersion( Empty.newBuilder().build() )
.getVersion();
if ( !version.equals( "0.1.0" ) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import org.apache.commons.lang.StringEscapeUtils;

public class ExceptionDialog
{

Expand Down Expand Up @@ -75,7 +77,10 @@ private static JPanel initMessagePanel( String message, Throwable exception )
final JScrollPane scrollPane = initScrollPane( textArea );
final JLabel showDetailsLabel = initShowDetailsLabel( scrollPane );
JPanel panel = new JPanel(new MigLayout("insets dialog", "[grow]", "[][][grow]"));
panel.add(new JLabel( message ), "wrap");
String messageHtml = "<html><body>"
+ StringEscapeUtils.escapeHtml( message ).replace( "\n", "<br>" )
+ "</body></html>";
panel.add(new JLabel( messageHtml ), "wrap");
panel.add( showDetailsLabel, "wrap");
panel.add(scrollPane, "grow");
return panel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ExceptionMessageDialogDemo
{
public static void main(String... args) {
Exception e = getSomeExceptions();
System.out.println( ExceptionDialog.showOkCancelDialog( null, "Some Error Occurred", "This is what went wrong", e, "Hello", "Cancel" ));
System.out.println( ExceptionDialog.showOkCancelDialog( null, "Some Error Occurred", "This is what went wrong.\nAnd another line of text.", e, "Hello", "Cancel" ));
}

private static Exception getSomeExceptions()
Expand Down

0 comments on commit 8fae192

Please sign in to comment.