Skip to content

Commit

Permalink
Merge branch 'RPTools:develop' into onChangeMap-upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmr3366 authored Oct 19, 2023
2 parents 0557975 + c324e93 commit 2d80b51
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 32 deletions.
9 changes: 4 additions & 5 deletions src/main/java/net/rptools/maptool/client/AppUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,17 @@ public static Path getInstallDirectory() {
var path = Path.of(getAppInstallLocation());
if (MapTool.isDevelopment()) {
// remove build/classes/java
path = path.getParent().getParent().getParent().getParent();
} else {
path = path.getParent().getParent().getParent();
} else { // First try to find MapTool* directory in path
while (path != null) {
if (path.getFileName().toString().matches("(?i).*maptool.*")) {
path = path.getParent();
break;
}
path = path.getParent();
}
}
if (path == null) {
return Path.of(getAppInstallLocation());
if (path == null) { // if not found then just return the parent of the app subdir
return Path.of(getAppInstallLocation()).resolve("..").toAbsolutePath();
} else {
return path;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ public PreferencesDialog() {
fileSyncPath = panel.getTextField("fileSyncPath");
fileSyncPathButton = (JButton) panel.getButton("fileSyncPathButton");

final var installDirTextField = (JTextField) panel.getComponent("InstallDirTextField");
installDirTextField.setText(AppUtil.getInstallDirectory().toString());

publicKeyTextArea = (JTextArea) panel.getTextComponent("publicKeyTextArea");
regeneratePublicKey = (JButton) panel.getButton("regeneratePublicKey");
copyPublicKey = (JButton) panel.getButton("copyKey");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<grid id="3f87d" binding="mainPanel" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="5" bottom="5" right="5"/>
<constraints>
<xy x="10" y="10" width="1006" height="721"/>
<xy x="10" y="10" width="1101" height="751"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down Expand Up @@ -970,7 +970,7 @@
</properties>
<border type="none"/>
<children>
<grid id="aba93" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="aba93" layout-manager="GridLayoutManager" row-count="7" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="4" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
Expand All @@ -981,7 +981,7 @@
<grid id="c02b4" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="0" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Label.performance">
Expand Down Expand Up @@ -1050,7 +1050,7 @@
<grid id="91b3d" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="1" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Preferences.label.initiative.defaults">
Expand Down Expand Up @@ -1140,7 +1140,7 @@
<grid id="58760" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="2" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Label.client">
Expand Down Expand Up @@ -1193,7 +1193,7 @@
<grid id="cbd77" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="3" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Label.macropanels">
Expand Down Expand Up @@ -1226,7 +1226,7 @@
<grid id="d929a" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="5" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="5" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Label.macropermissions">
Expand Down Expand Up @@ -1259,7 +1259,7 @@
<grid id="8bca9" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="4" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Label.upnp">
Expand Down Expand Up @@ -1288,16 +1288,31 @@
</component>
</children>
</grid>
<vspacer id="2d390">
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="eff99">
<grid id="8f668" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="6" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
</vspacer>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Preferences.label.installDir">
<font name="Dialog" size="12" style="1"/>
<title-color color="-13538620"/>
<color color="-6710887"/>
</border>
<children>
<component id="d8f1a" class="javax.swing.JTextField">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
<name value="InstallDirTextField"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="b7224" layout-manager="GridLayoutManager" row-count="3" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
Expand Down Expand Up @@ -2004,7 +2019,7 @@
</component>
</children>
</grid>
<grid id="d083" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="d083" layout-manager="GridLayoutManager" row-count="7" column-count="5" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="5" bottom="5" right="5"/>
<constraints>
<tabbedpane title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Label.startup"/>
Expand All @@ -2017,7 +2032,7 @@
<grid id="1dbec" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="0" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Preferences.label.jvm">
Expand Down Expand Up @@ -2103,7 +2118,7 @@
<grid id="7d6e1" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="3" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Preferences.label.advanced">
Expand Down Expand Up @@ -2171,7 +2186,7 @@
<grid id="64613" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="1" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Preferences.label.language.override">
Expand Down Expand Up @@ -2207,7 +2222,7 @@
<grid id="91892" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="2" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Preferences.label.options">
Expand Down Expand Up @@ -2243,7 +2258,7 @@
<grid id="261e4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="2" row-span="5" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="0" column="4" row-span="6" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none" title-resource-bundle="net/rptools/maptool/language/i18n" title-key="Preferences.startup.label.info">
Expand All @@ -2265,12 +2280,12 @@
</grid>
<vspacer id="23f1f">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="9203f">
<constraints>
<grid row="5" column="2" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="6" column="4" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
Expand Down Expand Up @@ -2304,7 +2319,7 @@
<children>
<component id="bc6ed" class="javax.swing.JLabel" binding="developerTabWarning">
<constraints>
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="0" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<gridbag top="6" left="0" bottom="6" right="0" weightx="0.0" weighty="0.0"/>
</constraints>
<properties>
Expand All @@ -2315,7 +2330,7 @@
</component>
<hspacer id="100b0">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<grid row="1" column="3" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<gridbag weightx="1.0" weighty="0.0"/>
</constraints>
</hspacer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package net.rptools.maptool.client.ui.preferencesdialog;

import java.awt.*;
import javax.swing.*;

public class PreferencesDialogView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ Preferences.label.client.fitview = Fit GM view
Preferences.label.client.fitview.tooltip = When forcing players to the GM's view, should the player's map be zoomed such that their screen shows at least the same content as the GM's screen?
Preferences.label.client.default.username = Default Username
Preferences.label.client.default.username.tooltip = The default username that appears in the MapTool toolbar.
Preferences.label.installDir = Installation Directory
Preferences.client.webEndPoint.port = Internal Web Server End Point Port
Preferences.client.webEndPoint.port.tooltip = Web Server End Point Port (Internal MapTool Only)
Preferences.client.default.username.value = Anonymous User
Expand Down

0 comments on commit 2d80b51

Please sign in to comment.