-
-
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
Enhanced message log #4815
Enhanced message log #4815
Changes from all commits
3ab1bd7
577de6a
7e20650
23362fa
7995593
deff466
e5cb625
7ccf914
67e33e1
0444b6a
f2a31d0
d87c7f6
ea3e786
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,6 @@ | |
import java.util.Optional; | ||
import java.util.regex.Pattern; | ||
|
||
import javax.swing.JOptionPane; | ||
|
||
import org.jabref.Globals; | ||
import org.jabref.JabRefGUI; | ||
import org.jabref.gui.desktop.os.DefaultDesktop; | ||
|
@@ -201,12 +199,8 @@ public static void openBrowserShowPopup(String url) { | |
String couldNotOpenBrowser = Localization.lang("Could not open browser."); | ||
String openManually = Localization.lang("Please open %0 manually.", url); | ||
String copiedToClipboard = Localization.lang("The link has been copied to the clipboard."); | ||
JabRefGUI.getMainFrame().output(couldNotOpenBrowser); | ||
JOptionPane.showMessageDialog(null, | ||
couldNotOpenBrowser + "\n" + openManually + "\n" + | ||
copiedToClipboard, | ||
couldNotOpenBrowser, | ||
JOptionPane.ERROR_MESSAGE); | ||
JabRefGUI.getMainFrame().getDialogService().notify(couldNotOpenBrowser); | ||
JabRefGUI.getMainFrame().getDialogService().showErrorDialogAndWait(couldNotOpenBrowser, couldNotOpenBrowser + "\n" + openManually + "\n" + copiedToClipboard); | ||
} | ||
} | ||
|
||
|
@@ -239,19 +233,17 @@ public static void openConsole(File file) throws IOException { | |
// replace the placeholder if used | ||
String commandLoggingText = command.replace("%DIR", absolutePath); | ||
|
||
JabRefGUI.getMainFrame().output(Localization.lang("Executing command \"%0\"...", commandLoggingText)); | ||
JabRefGUI.getMainFrame().getDialogService().notify(Localization.lang("Executing command \"%0\"...", commandLoggingText)); | ||
LOGGER.info("Executing command \"" + commandLoggingText + "\"..."); | ||
|
||
try { | ||
new ProcessBuilder(subcommands).start(); | ||
} catch (IOException exception) { | ||
LOGGER.error("Open console", exception); | ||
|
||
JOptionPane.showMessageDialog(null, | ||
Localization.lang("Error occured while executing the command \"%0\".", commandLoggingText), | ||
Localization.lang("Open console") + " - " + Localization.lang("Error"), | ||
JOptionPane.ERROR_MESSAGE); | ||
JabRefGUI.getMainFrame().output(null); | ||
JabRefGUI.getMainFrame().getDialogService().showErrorDialogAndWait( | ||
Localization.lang("Open console") + " - " + Localization.lang("Error", | ||
Localization.lang("Error occured while executing the command \"%0\".", commandLoggingText))); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just saw that we seemed to forgot to convert that old swing dialog here. Could you please fix this as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did it in f2a31d0, there was also another one in the same class |
||
} | ||
} | ||
|
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.
lookupIdentifiers is executed in a background thread and in order to provide feedback to the user, i used a workaround here and explicitly called DefaultTaskExecutor.runInJavaFXThread
However, i would suggest to completely remove the notifications here, because they do not provide much value