Add <open log file> button to error msg popup

This commit is contained in:
Manfred Karrer 2017-11-12 20:16:31 -05:00
parent 11338f6567
commit 32180c9fa4
No known key found for this signature in database
GPG key ID: 401250966A6B2C46
4 changed files with 34 additions and 19 deletions

View file

@ -1242,12 +1242,12 @@ popup.headline.warning=Warning
popup.headline.error=Error
popup.doNotShowAgain=Don't show again
popup.reportError.log=Open log file
popup.reportError.gitHub=Report to Github issue tracker
popup.reportError.forum=Report at Bisq forum
popup.reportError={0}\n\nTo help us to improve the software please report the bug at our issue tracker at Github or post it at the Bisq forum.\n\
The error message will be copied to clipboard when you click the below buttons.\n\
It will make debugging easier if you can attach the Bisq.log file which you can find in the application directory.\n\
You can open the application directory at \"Account/Backup\".
popup.reportError={0}\n\nTo help us to improve the software please report the bug at our issue tracker at Github (https://github.com/bisq-network/exchange/issues).\n\
The error message will be copied to the clipboard when you click the below buttons.\n\
It will make debugging easier if you can attach the bisq.log file as well.
popup.error.tryRestart=Please try to restart your application and check your network connection to see if you can resolve the issue.
popup.error.createTx=Error at creating transaction: {0}

View file

@ -79,6 +79,11 @@ public class BisqEnvironment extends StandardEnvironment {
private static final String BISQ_HOME_DIR_PROPERTY_SOURCE_NAME = "bisqHomeDirProperties";
private static final String BISQ_CLASSPATH_PROPERTY_SOURCE_NAME = "bisqClasspathProperties";
private static String staticAppDataDir;
public static String getStaticAppDataDir() {
return staticAppDataDir;
}
@SuppressWarnings("SameReturnValue")
public static BaseCurrencyNetwork getDefaultBaseCurrencyNetwork() {
return BaseCurrencyNetwork.BTC_MAINNET;
@ -203,6 +208,8 @@ public class BisqEnvironment extends StandardEnvironment {
appDataDir = commandLineProperties.containsProperty(AppOptionKeys.APP_DATA_DIR_KEY) ?
(String) commandLineProperties.getProperty(AppOptionKeys.APP_DATA_DIR_KEY) :
appDataDir(userDataDir, appName);
staticAppDataDir = appDataDir;
ignoreDevMsg = commandLineProperties.containsProperty(AppOptionKeys.IGNORE_DEV_MSG_KEY) ?
(String) commandLineProperties.getProperty(AppOptionKeys.IGNORE_DEV_MSG_KEY) :
"";

View file

@ -45,7 +45,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
public class AccountAgeWitnessService {
// TODO update release date
private static final Date RELEASE = Utilities.getUTCDate(2017, GregorianCalendar.NOVEMBER, 8);
private static final Date RELEASE = Utilities.getUTCDate(2017, GregorianCalendar.NOVEMBER, 11);
private static final Date FIRST_PHASE = Utilities.getUTCDate(2017, GregorianCalendar.DECEMBER, 15);
private static final Date SECOND_PHASE = Utilities.getUTCDate(2018, GregorianCalendar.JANUARY, 15);
public static final Date FULL_ACTIVATION = Utilities.getUTCDate(2018, GregorianCalendar.FEBRUARY, 15);

View file

@ -22,6 +22,7 @@ import io.bisq.common.Timer;
import io.bisq.common.UserThread;
import io.bisq.common.locale.Res;
import io.bisq.common.util.Utilities;
import io.bisq.core.app.BisqEnvironment;
import io.bisq.core.user.DontShowAgainLookup;
import io.bisq.gui.app.BisqApp;
import io.bisq.gui.components.BusyAnimation;
@ -56,6 +57,9 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
@ -724,29 +728,33 @@ public abstract class Overlay<T extends Overlay> {
private void addReportErrorButtons() {
messageLabel.setText(Res.get("popup.reportError", truncatedMessage));
Button logButton = new Button(Res.get("popup.reportError.log"));
GridPane.setMargin(logButton, new Insets(20, 0, 0, 0));
GridPane.setHalignment(logButton, HPos.RIGHT);
GridPane.setRowIndex(logButton, ++rowIndex);
GridPane.setColumnIndex(logButton, 1);
gridPane.getChildren().add(logButton);
logButton.setOnAction(event -> {
try {
File dataDir = new File(BisqEnvironment.getStaticAppDataDir());
File logFile = new File(Paths.get(dataDir.getPath(), "bisq.log").toString());
Utilities.openFile(logFile);
} catch (IOException e) {
e.printStackTrace();
log.error(e.getMessage());
}
});
Button gitHubButton = new Button(Res.get("popup.reportError.gitHub"));
GridPane.setMargin(gitHubButton, new Insets(20, 0, 0, 0));
GridPane.setHalignment(gitHubButton, HPos.RIGHT);
GridPane.setRowIndex(gitHubButton, ++rowIndex);
GridPane.setColumnIndex(gitHubButton, 1);
gridPane.getChildren().add(gitHubButton);
gitHubButton.setOnAction(event -> {
if (message != null)
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("https://github.com/bisq-network/exchange/issues");
});
Button forumButton = new Button(Res.get("popup.reportError.forum"));
GridPane.setHalignment(forumButton, HPos.RIGHT);
GridPane.setRowIndex(forumButton, ++rowIndex);
GridPane.setColumnIndex(forumButton, 1);
gridPane.getChildren().add(forumButton);
forumButton.setOnAction(event -> {
if (message != null)
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("http://forum.bisq.network");
hide();
});
}