Browse Source

init commit

Jan-Peter Klein 1 year ago
parent
commit
b10523ea6c

File diff suppressed because it is too large
+ 182 - 2
src/main/java/org/cryptomator/ui/error/ErrorController.java


+ 31 - 0
src/main/java/org/cryptomator/ui/error/ErrorDiscussion.java

@@ -0,0 +1,31 @@
+package org.cryptomator.ui.error;
+
+public class ErrorDiscussion {
+
+	String id;
+	int upvoteCount;
+	String title;
+	String url;
+	int comments;
+	Answer answer;
+
+	String getUpvoteCount(){return  upvoteCount+"";}
+
+	String getErrorCode(){return title.substring(6);}
+	String getMethodCode(){
+		return title.substring(6,10);
+	}
+	String getRootCauseCode(){
+		return title.substring(11,15);
+	}
+
+	String getThrowableCode(){
+		return title.substring(16,20);
+	}
+
+	class Answer{
+		private String url;
+		private int upvoteCount;
+	}
+
+}

+ 10 - 4
src/main/resources/fxml/error.fxml

@@ -31,13 +31,19 @@
 			</StackPane>
 			<VBox spacing="6" HBox.hgrow="ALWAYS">
 				<FormattedLabel styleClass="label-extra-large" format="%error.message" arg1="${controller.errorCode}"/>
-				<Label text="%error.description" wrapText="true"/>
-				<Hyperlink styleClass="hyperlink-underline" text="%error.hyperlink.lookup" onAction="#searchError" contentDisplay="LEFT">
+				<Label text="%error.existingSolutionDescription" wrapText="true" visible="${controller.lookUpSolutionVisibility}" managed="${controller.lookUpSolutionVisibility}"/>
+				<Label text="%error.description" wrapText="true" visible="${!controller.lookUpSolutionVisibility}" managed="${!controller.lookUpSolutionVisibility}"/>
+				<Hyperlink styleClass="hyperlink-underline" text="%error.hyperlink.solution" onAction="#showSolution" contentDisplay="LEFT" visible="${controller.lookUpSolutionVisibility}" managed="${controller.lookUpSolutionVisibility}">
 					<graphic>
 						<FontAwesome5IconView glyph="LINK" glyphSize="12"/>
 					</graphic>
 				</Hyperlink>
-				<Hyperlink styleClass="hyperlink-underline" text="%error.hyperlink.report" onAction="#reportError" contentDisplay="LEFT">
+				<Hyperlink styleClass="hyperlink-underline" text="%error.hyperlink.lookup" onAction="#searchError" contentDisplay="LEFT" visible="${!controller.lookUpSolutionVisibility}" managed="${!controller.lookUpSolutionVisibility}">
+					<graphic>
+						<FontAwesome5IconView glyph="LINK" glyphSize="12"/>
+					</graphic>
+				</Hyperlink>
+				<Hyperlink styleClass="hyperlink-underline" text="%error.hyperlink.report" onAction="#reportError" contentDisplay="LEFT" visible="${!controller.lookUpSolutionVisibility}" managed="${!controller.lookUpSolutionVisibility}">
 					<graphic>
 						<FontAwesome5IconView glyph="LINK" glyphSize="12"/>
 					</graphic>
@@ -60,7 +66,7 @@
 					</graphic>
 				</Hyperlink>
 			</HBox>
-			<TextArea VBox.vgrow="ALWAYS" text="${controller.detailText}" prefRowCount="5" editable="false"/>
+			<TextArea VBox.vgrow="ALWAYS" text="${controller.detailTexts}" prefRowCount="5" editable="false"/>
 		</VBox>
 
 		<ButtonBar buttonMinWidth="120" buttonOrder="B+C">

+ 3 - 0
src/main/resources/i18n/strings.properties

@@ -21,6 +21,9 @@ error.description=Cryptomator didn't expect this to happen. You can look up exis
 error.hyperlink.lookup=Look up this error
 error.hyperlink.report=Report this error
 error.technicalDetails=Details:
+error.existingSolutionDescription=Cryptomator didn't expect this to happen. But we found an existing solution for this error. Please take a look at the following link.
+error.hyperlink.solution=Look up the solution
+
 
 # Defaults
 defaults.vault.vaultName=Vault