Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ jobs:
matrix:
include:
- os: ubuntu-latest
platform: linux
arch: x86_64
jpackage_goal: linux

- os: ubuntu-24.04-arm
platform: linux
arch: arm64
jpackage_goal: linux

runs-on: ${{ matrix.os }}

Expand All @@ -38,12 +34,28 @@ jobs:
cache: maven

- name: Build and package
run: mvn -Pdist package jpackage:jpackage@${{ matrix.jpackage_goal }}
run: mvn -Pdist package jpackage:jpackage@linux

- name: Add launcher script
shell: bash
run: |
cat > target/output/Nautilus/launch-nautilus.sh <<'EOF'
#!/bin/bash

SCRIPT_DIR="$(cd -- "$(dirname -- "$0")" && pwd)"

exec pkexec env \
DISPLAY="${DISPLAY}" \
XAUTHORITY="${XAUTHORITY}" \
_JAVA_AWT_WM_NONREPARENTING=1 \
"$SCRIPT_DIR/bin/Nautilus"
EOF

chmod +x target/output/Nautilus/launch-nautilus.sh

# ---------- Package output ----------
- name: Archive
if: matrix.platform == 'linux'
shell: pwsh
shell: bash
run: |
cd target/output/Nautilus
tar -czf ../../../nautilus-${{ github.ref_name }}-linux-${{ matrix.arch }}.tar.gz *
Expand All @@ -53,9 +65,9 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: nautilus-${{ matrix.platform }}-${{ matrix.arch }}
name: nautilus-linux-${{ matrix.arch }}
path: |
nautilus-${{ github.ref_name }}-${{ matrix.platform }}-${{ matrix.arch }}.*
nautilus-${{ github.ref_name }}-linux-${{ matrix.arch }}.*

release:
needs: build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class PhysicalMemoryPanelUI extends JPanel {

// handles
private final @NonNull JLabel memoryModuleNumberLabel = new JLabel("Memory #");
private final @NonNull JComboBox<String> memoryLocatorComboBox = new JComboBox<>();
private final @NonNull JComboBox<Integer> memoryModuleNumberComboBox = new JComboBox<>();

private final @NonNull JLabel setLabel = new JLabel("Set");
private final @NonNull JTextField setTextField = new JTextField();
Expand Down Expand Up @@ -155,7 +155,7 @@ private JPanel createHandlePanel() {
panel.setLayout(new MigLayout("insets 0", "[][grow]", "[][][][][][]"));

panel.add(memoryModuleNumberLabel, "cell 0 0,alignx leading");
panel.add(memoryLocatorComboBox, "cell 1 0,growx");
panel.add(memoryModuleNumberComboBox, "cell 1 0,growx");

panel.add(setLabel, "cell 0 1,alignx leading");
panel.add(setTextField, "cell 1 1,growx");
Expand Down Expand Up @@ -361,7 +361,7 @@ public PhysicalMemoryPanelUI setWorkers() {
memoryOperatingModeCapabilityTextField, errorHandleTextField, arrayHandleTextField
);

new DMIPhysicalMemoryWorker(memoryLocatorComboBox, textFields).execute();
new DMIPhysicalMemoryWorker(memoryModuleNumberComboBox, textFields).execute();

return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,36 @@
import javax.swing.SwingWorker;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

@RequiredArgsConstructor
@Slf4j
public class DMIPhysicalMemoryWorker extends SwingWorker<Map<String, DMIMemoryDevice>, Void> {
public class DMIPhysicalMemoryWorker extends SwingWorker<Map<Integer, DMIMemoryDevice>, Void> {

private final @NonNull JComboBox<String> memorySlotComboBox;
private final @NonNull JComboBox<Integer> memorySlotComboBox;
private final @NonNull List<JTextField> memoryFields;

@Override
protected @NonNull Map<String, DMIMemoryDevice> doInBackground() throws Exception {
protected @NonNull Map<Integer, DMIMemoryDevice> doInBackground() {
List<DMIMemoryDevice> dmiMemoryDeviceList = new DMIMemoryDeviceService().get(TerminalConstant.TIMEOUT_SIXTY_SECONDS);
log.info("Found {} DMIMemoryDevice entry(s)", dmiMemoryDeviceList.size());

return dmiMemoryDeviceList.stream()
.filter(Objects::nonNull)
.filter(device -> Objects.nonNull(device.locator()))
return IntStream.range(0, dmiMemoryDeviceList.size())
.boxed()
.collect(Collectors.toUnmodifiableMap(
device -> Objects.requireNonNull(device.locator()),
device -> device
index -> index + 1,
dmiMemoryDeviceList::get
));
}

@Override
protected void done() {

try {
Map<String, DMIMemoryDevice> memoryDeviceMap = get();
// populate the combo box with memory locator data
Map<Integer, DMIMemoryDevice> memoryDeviceMap = get();
// populate the combo box with keys
memoryDeviceMap.keySet().stream().sorted().forEach(memorySlotComboBox::addItem);
// populate fields for the first entry in the combo box
populateFieldsBasedOnMemory(memoryDeviceMap);
Expand All @@ -62,11 +61,11 @@ protected void done() {

}

private void populateFieldsBasedOnMemory(@NonNull Map<String, DMIMemoryDevice> memoryDeviceMap) {
private void populateFieldsBasedOnMemory(@NonNull Map<Integer, DMIMemoryDevice> memoryDeviceMap) {

String locator = String.valueOf(memorySlotComboBox.getSelectedItem());
Integer selectedItem = (Integer) memorySlotComboBox.getSelectedItem();

DMIMemoryDevice memory = memoryDeviceMap.get(locator);
DMIMemoryDevice memory = memoryDeviceMap.get(selectedItem);
if (memory == null) return;

memoryFields.get(0).setText(memory.set());
Expand Down
Loading