Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed Jun 10, 2023
2 parents 9d4d21d + 13c6135 commit 1207fcf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/org/infinity/NearInfinity.java
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ private NearInfinity(Options options) {

final BrowserMenuBar menu = new BrowserMenuBar();
menu.setUpdateMenuEnabled(options.isUpdateEnabled());
menu.setLaunchGameMenuEnabled(options.isLaunchGameVisible());
// Registers menu as key event dispatcher to intercept Ctrl+Shift+D from any window
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(menu);
setJMenuBar(menu);
Expand Down
7 changes: 6 additions & 1 deletion src/org/infinity/gui/BrowserMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
import org.infinity.util.tuples.Couple;

public final class BrowserMenuBar extends JMenuBar implements KeyEventDispatcher {
public static final String VERSION = "v2.3-20230609";
public static final String VERSION = "v2.3-20230610";

public static final LookAndFeelInfo DEFAULT_LOOKFEEL =
new LookAndFeelInfo("Metal", "javax.swing.plaf.metal.MetalLookAndFeel");
Expand Down Expand Up @@ -281,6 +281,11 @@ public void setUpdateMenuEnabled(boolean enable) {
helpMenu.setUpdateMenuEnabled(enable);
}

/** Specifies the enabled state of the "Allow launching games" entry in the Options menu. */
public void setLaunchGameMenuEnabled(boolean enable) {
optionsMenu.optionLaunchGameAllowed.setEnabled(enable);
}

/**
* Returns whether menu item "Tools > Print debug info" is shown.
*/
Expand Down
6 changes: 6 additions & 0 deletions src/org/infinity/updater/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@ public class Utils {
* </p>
*
* @param s String containing date/time information.
* @return {@code OffsetDateTime} object of the given date string. Returns the current date if {@code null} is
* specified.
*/
public static OffsetDateTime getDateTimeFromString(String s) throws DateTimeParseException {
if (s == null || s.isEmpty()) {
return OffsetDateTime.now();
}

DateTimeParseException exception = null;
final DateTimeFormatter[] formatters = {
ISO_DATE_TIME,
Expand Down

0 comments on commit 1207fcf

Please sign in to comment.