Skip to content

Commit d7d4173

Browse files
authored
Merge pull request #495 from TcMenu/main-remote-theme
#491 #494 #453 remove online library version checker, add remote plugin, themebuilder for mono themes
2 parents 65c3b6b + 300efb6 commit d7d4173

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+868
-537
lines changed

embedCONTROLCore/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<artifactId>embedCONTROLCore</artifactId>
1414
<name>embedCONTROLCore</name>
1515
<description>TcMenu embedCONTROL shared core</description>
16-
<version>4.3.0</version>
16+
<version>4.3.1-SNAPSHOT</version>
1717
<url>https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/</url>
1818

1919
<licenses>

embeddedJavaExample/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<jdk.version>22</jdk.version>
1111
<jfx.version>22.0.2</jfx.version>
1212
<jserialcomm.version>2.11.0</jserialcomm.version>
13-
<tcmenu.api.version>4.3.0</tcmenu.api.version>
13+
<tcmenu.api.version>4.3.1-SNAPSHOT</tcmenu.api.version>
1414
<timestamp>${maven.build.timestamp}</timestamp>
1515
</properties>
1616

tcMenuGenerator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<name>menuEditorUI</name>
1313
<groupId>com.thecoderscorner.tcmenu</groupId>
1414
<description>JavaFX based menu editor UI</description>
15-
<version>4.3.0</version>
15+
<version>4.3.1-SNAPSHOT</version>
1616

1717
<properties>
1818
<timestamp>${maven.build.timestamp}</timestamp>

tcMenuGenerator/scripts/packager-all-platforms.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# How to build tcMenu Designer into a native package using OpenJDK 17 onwards.
22

3-
**For most users, we recommend using our pre-packaged software.** However, should you wish to build it yourself, follow these instructions, you'll end up with a native installer for Windows, a disk image for macOS, or a debian install archive for Linux. Please only use these steps to build a UI for you own purposes.
3+
**For most users, we recommend using our pre-packaged software.** However, should you wish to build it yourself, follow these instructions, you'll end up with a native executable for Windows, a disk image for macOS, or an archive for Linux. Please only use these steps to build a UI for you own purposes.
44

5-
Firstly, ensure that you have OpenJDK 18 and a recent maven 3 on your system, without these it will not be possible to build.
5+
Firstly, ensure that you have the most recent OpenJDK and a recent version of maven on your system, without these it will not be possible to build.
66

77
* All OpenJDK's that we've tested work for this, we've tried: Liberica, Adoptium, Amazon Corretto and Microsoft JDK.
88
* For Apache maven we recommend using [https://maven.apache.org/]
@@ -82,23 +82,3 @@ Drop to a command-line, in the tcMenu/embedCONTROLCore directory, run a local ma
8282
Testing before deployment
8383

8484
java --module-path ../deps "-Dprism.lcdtext=false" -m com.thecoderscorner.tcmenu.embedcontrolfx/com.thecoderscorner.embedcontrol.jfxapp.EmbedControlApp
85-
86-
### Building the embedCONTROLFx desktop UI for Windows
87-
88-
Ensure you are in the embedCONTROLFx/target directory.
89-
90-
cp classes/fximg/embedCONTROL.ico .
91-
92-
jpackage --type app-image -n embedCONTROL -p jfx/deps --input jfx/app --resource-dir .\classes\fximg\ --icon embedCONTROL.ico --app-version 4.1.2 --verbose --java-options "-Dprism.lcdtext=false" --add-modules "jdk.crypto.cryptoki" -m com.thecoderscorner.tcmenu.embedcontrolfx/com.thecoderscorner.embedcontrol.jfxapp.EmbedControlApp
93-
94-
### Building the embedCONTROLFx desktop for macOS
95-
96-
Ensure you are in the embedCONTROLFx/target directory.
97-
98-
jpackage -n embedCONTROL -p jfx/deps --input jfx/app --icon ./classes/fximg/MyIcon.icns --vendor TheCodersCorner --app-version 4.1.2 --verbose --license-file ../../LICENSE --java-options "-Dprism.lcdtext=false" --add-modules "jdk.crypto.cryptoki" -m com.thecoderscorner.tcmenu.embedcontrolfx/com.thecoderscorner.embedcontrol.jfxapp.EmbedControlApp
99-
100-
### Building the embedCONTROLFx desktop for Linux
101-
102-
Ensure you are in the embedCONTROLFx/target directory.
103-
104-
jpackage -n embedCONTROL -p jfx/deps --input jfx/app --icon ./classes/fximg/large_icon.png --verbose --license-file ../../LICENSE --linux-app-category Utility --linux-menu-group "Utility;" --java-options "-Dprism.lcdtext=false" --app-version 4.1.2 --add-modules "jdk.crypto.cryptoki" -m com.thecoderscorner.tcmenu.embedcontrolfx/com.thecoderscorner.embedcontrol.jfxapp.EmbedControlApp

tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/MenuEditorApp.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ public byte[] postRequestForBinaryData(String url, String parameter, HttpDataTyp
304304
throw new IOException("Boom");
305305
}
306306

307+
@Override
308+
public String getRequestForString(String url) throws IOException {
309+
throw new IOException("Boom");
310+
}
311+
307312
@Override
308313
public String postRequestForString(String url, String parameter, HttpDataType reqDataType) throws IOException {
309314
throw new IOException("Boom");

tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/controller/GeneralSettingsController.java

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
import com.thecoderscorner.embedcontrol.core.service.GlobalSettings;
44
import com.thecoderscorner.embedcontrol.core.util.TccDatabaseUtilities;
55
import com.thecoderscorner.menu.editorui.MenuEditorApp;
6-
import com.thecoderscorner.menu.editorui.generator.LibraryVersionDetector;
6+
import com.thecoderscorner.menu.editorui.generator.AppVersionDetector;
77
import com.thecoderscorner.menu.editorui.generator.arduino.ArduinoLibraryInstaller;
88
import com.thecoderscorner.menu.editorui.generator.plugin.CodePluginManager;
99
import com.thecoderscorner.menu.editorui.storage.ConfigurationStorage;
1010
import com.thecoderscorner.menu.editorui.util.StringHelper;
11-
import com.thecoderscorner.menu.persist.ReleaseType;
1211
import com.thecoderscorner.menu.persist.VersionInfo;
1312
import javafx.application.Platform;
1413
import javafx.beans.property.ReadOnlyObjectWrapper;
@@ -30,7 +29,8 @@
3029
import java.util.concurrent.Executors;
3130
import java.util.function.Supplier;
3231

33-
import static com.thecoderscorner.menu.editorui.generator.arduino.ArduinoLibraryInstaller.InstallationType.*;
32+
import static com.thecoderscorner.menu.editorui.generator.arduino.ArduinoLibraryInstaller.InstallationType.CURRENT_APP;
33+
import static com.thecoderscorner.menu.editorui.generator.arduino.ArduinoLibraryInstaller.InstallationType.CURRENT_LIB;
3434
import static com.thecoderscorner.menu.editorui.util.AlertUtil.showAlertAndWait;
3535
import static com.thecoderscorner.menu.persist.VersionInfo.ERROR_VERSION;
3636
import static java.lang.System.Logger.Level.ERROR;
@@ -55,9 +55,7 @@ public class GeneralSettingsController {
5555
public TextField libsTextField;
5656
public Button chooseArduinoButton;
5757
public Button chooseLibsButton;
58-
public ComboBox<ReleaseType> pluginStreamCombo;
5958
public TableColumn<NameWithVersion, String> libraryNameColumn;
60-
public TableColumn<NameWithVersion, String> expectedVerCol;
6159
public TableColumn<NameWithVersion, String> actualVerCol;
6260
public TableView<NameWithVersion> versionsTable;
6361
public ListView<String> additionalPathsList;
@@ -71,23 +69,23 @@ public class GeneralSettingsController {
7169
public Spinner<Integer> fontSizeSpinner;
7270
private ConfigurationStorage storage;
7371
private String homeDirectory;
74-
private LibraryVersionDetector versionDetector;
72+
private AppVersionDetector versionDetector;
7573
private CodePluginManager pluginManager;
7674
private ArduinoLibraryInstaller installer;
7775
private final ResourceBundle bundle = MenuEditorApp.getBundle();
7876
private GlobalSettings settings;
7977
private TccDatabaseUtilities databaseUtilities;
8078

81-
public void initialise(ConfigurationStorage storage, LibraryVersionDetector versionDetector,
79+
public void initialise(ConfigurationStorage storage, AppVersionDetector versionDetector,
8280
ArduinoLibraryInstaller installer, CodePluginManager pluginManager,
8381
GlobalSettings settings, TccDatabaseUtilities utilities, String homeDirectory) {
8482
this.installer = installer;
8583
this.pluginManager = pluginManager;
8684
this.storage = storage;
8785
this.homeDirectory = homeDirectory;
88-
this.versionDetector = versionDetector;
8986
this.settings = settings;
9087
this.databaseUtilities = utilities;
88+
this.versionDetector = versionDetector;
9189

9290
usingArduinoLibsCheck.setSelected(storage.isUsingArduinoIDE());
9391
useFullyQualifiedNamesField.setSelected(storage.isDefaultRecursiveNamingOn());
@@ -115,12 +113,8 @@ public void initialise(ConfigurationStorage storage, LibraryVersionDetector vers
115113
});
116114

117115
libraryNameColumn.setCellValueFactory(cell -> new ReadOnlyObjectWrapper<>(cell.getValue().name()));
118-
expectedVerCol.setCellValueFactory(cell -> new ReadOnlyObjectWrapper<>(cell.getValue().available().toString()));
119116
actualVerCol.setCellValueFactory(cell -> new ReadOnlyObjectWrapper<>(cell.getValue().installed().toString()));
120117

121-
pluginStreamCombo.setItems(FXCollections.observableList(Arrays.asList(ReleaseType.values())));
122-
pluginStreamCombo.getSelectionModel().select(versionDetector.getReleaseType());
123-
124118
additionalPathsList.getSelectionModel().selectedItemProperty().addListener((observableValue, s1, s2) ->
125119
removePathBtn.setDisable(additionalPathsList.getSelectionModel().getSelectedItem() == null));
126120

@@ -168,7 +162,7 @@ private LocaleWithDescription findLocaleInList(Locale chosenLocale) {
168162
for (var locDesc : availableLocales) {
169163
if(locDesc.locale().equals(chosenLocale)) return locDesc;
170164
}
171-
return availableLocales.get(0);
165+
return availableLocales.getFirst();
172166
}
173167

174168
private void setDirectoryPickerOrEmpty(TextField field, Optional<String> maybePath, Supplier<Optional<String>> defaulter) {
@@ -286,21 +280,13 @@ public void onClose(ActionEvent actionEvent) {
286280
s.close();
287281
}
288282

289-
public void onStreamChanged(ActionEvent actionEvent) {
290-
var newStream = pluginStreamCombo.getSelectionModel().getSelectedItem();
291-
if(newStream != null) {
292-
versionDetector.changeReleaseType(newStream);
293-
onRefreshLibraries(actionEvent);
294-
}
295-
}
296-
297283
public void onRefreshLibraries(ActionEvent actionEvent) {
298284
populateVersions();
299285
}
300286

301287
private void populateVersions() {
302288
var fr = executor.submit(() -> {
303-
versionDetector.acquireVersions();
289+
versionDetector.acquireVersion();
304290
Platform.runLater(this::populateListAfterRequest);
305291
});
306292
}
@@ -322,7 +308,6 @@ private void populateListAfterRequest() {
322308
versionsTable.getItems().add(new NameWithVersion(
323309
"TcMenuDesigner UI", "tcMenuDesigner",
324310
false,
325-
getVersionOfLibraryOrError("java-app", AVAILABLE_APP),
326311
getVersionOfLibraryOrError("java-app", CURRENT_APP)
327312
));
328313

@@ -334,13 +319,11 @@ private void populateListAfterRequest() {
334319
}
335320

336321
private NameWithVersion findLibVersion(String libName) throws IOException {
337-
var available = installer.getVersionOfLibrary(libName, AVAILABLE_LIB);
338322
var installed = installer.getVersionOfLibrary(libName, CURRENT_LIB);
339323

340-
if(available == null) available = ERROR_VERSION;
341324
if(installed == null) installed = ERROR_VERSION;
342325

343-
return new NameWithVersion(libName + " library", libName, false, available, installed);
326+
return new NameWithVersion(libName + " library", libName, false, installed);
344327
}
345328

346329
private VersionInfo getVersionOfLibraryOrError(String name, ArduinoLibraryInstaller.InstallationType type) {
@@ -403,7 +386,7 @@ public void onUuidChanged(ActionEvent actionEvent) {
403386
}
404387
}
405388

406-
public record NameWithVersion(String name, String underlyingId, boolean isPlugin, VersionInfo available, VersionInfo installed) { }
389+
public record NameWithVersion(String name, String underlyingId, boolean isPlugin, VersionInfo installed) { }
407390

408391
static class NameWithVersionValueFactory implements Callback<TableColumn.CellDataFeatures<NameWithVersion, NameWithVersion>, ObservableValue<NameWithVersion>> {
409392
@Override

tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/controller/MenuEditorController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import com.thecoderscorner.menu.editorui.dialog.ChooseIoExpanderDialog;
1818
import com.thecoderscorner.menu.editorui.dialog.EditMenuInMenuDialog;
1919
import com.thecoderscorner.menu.editorui.embed.FormManagerDialog;
20-
import com.thecoderscorner.menu.editorui.generator.LibraryVersionDetector;
20+
import com.thecoderscorner.menu.editorui.generator.AppVersionDetector;
2121
import com.thecoderscorner.menu.editorui.generator.arduino.ArduinoLibraryInstaller;
2222
import com.thecoderscorner.menu.editorui.generator.core.VariableNameGenerator;
2323
import com.thecoderscorner.menu.editorui.generator.plugin.CodePluginManager;
@@ -110,7 +110,7 @@ public class MenuEditorController {
110110
private CurrentProjectEditorUI editorUI;
111111
private CodePluginManager pluginManager;
112112
private JdbcTcMenuConfigurationStore configStore;
113-
private LibraryVersionDetector libVerDetector;
113+
private AppVersionDetector libVerDetector;
114114
private int menuToProjectMaxLevels = 1;
115115
private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
116116
private final ResourceBundle bundle = MenuEditorApp.getBundle();
@@ -119,7 +119,7 @@ public class MenuEditorController {
119119
public void initialise(CurrentEditorProject editorProject, ArduinoLibraryInstaller installer,
120120
CurrentProjectEditorUI editorUI, CodePluginManager pluginManager,
121121
JdbcTcMenuConfigurationStore storage,
122-
LibraryVersionDetector libraryVersionDetector, boolean initialWindow) {
122+
AppVersionDetector libraryVersionDetector, boolean initialWindow) {
123123
this.editorProject = editorProject;
124124
this.installer = installer;
125125
this.editorUI = editorUI;
@@ -681,7 +681,7 @@ public void onShowExpanders(ActionEvent actionEvent) {
681681
public void onPrepareDiagnostics(ActionEvent actionEvent) {
682682
try {
683683
StringBuilder sb = new StringBuilder(255);
684-
sb.append("tcMenu diagnostics - stream ").append(libVerDetector.getReleaseType()).append(LINE_BREAK);
684+
sb.append("tcMenu diagnostics").append(LINE_BREAK);
685685
sb.append("TcMenuDesigner Version - ").append(configStore.getVersion()).append(LINE_BREAK);
686686
sb.append("Plugin versions:").append(LINE_BREAK);
687687
for(var pl : pluginManager.getLoadedPlugins()) {

0 commit comments

Comments
 (0)