only:threads are complicated
This commit is contained in:
parent
1e60ca7581
commit
4c3f40ed7a
|
@ -25,6 +25,7 @@ public class FrameHelper {
|
|||
}
|
||||
|
||||
public FrameHelper(int operation) {
|
||||
AutoupdateUtil.assertAwtThread();
|
||||
frame.setDefaultCloseOperation(operation);
|
||||
AutoupdateUtil.setAppIcon(frame);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ import com.rusefi.SerialPortScanner;
|
|||
import com.rusefi.maintenance.jobs.AsyncJobExecutor;
|
||||
import com.rusefi.maintenance.jobs.OpenBltManualJob;
|
||||
import com.rusefi.ui.StatusWindow;
|
||||
import com.rusefi.ui.widgets.ToolButtons;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
@ -35,13 +36,14 @@ public class MassUpdater {
|
|||
knownBlts.add(openBltPort.port);
|
||||
mainStatus.append("New OpenBlt " + openBltPort);
|
||||
|
||||
AsyncJobExecutor.INSTANCE.executeJob(new OpenBltManualJob(openBltPort, mainStatus.getContent()));
|
||||
SwingUtilities.invokeLater(() -> AsyncJobExecutor.INSTANCE.executeJob(new OpenBltManualJob(openBltPort, mainStatus.getContent())));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException, InvocationTargetException {
|
||||
ToolButtons.showDeviceManager();
|
||||
SwingUtilities.invokeAndWait(MassUpdater::new);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,15 +14,19 @@ public class ToolButtons {
|
|||
showDeviceManager.setMargin(new Insets(0, 0, 0, 0));
|
||||
showDeviceManager.setToolTipText("Show Device Manager");
|
||||
showDeviceManager.addActionListener(event -> {
|
||||
try {
|
||||
Runtime.getRuntime().exec(ExecHelper.getBatchCommand("devmgmt.msc"));
|
||||
} catch (IOException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
showDeviceManager();
|
||||
});
|
||||
return showDeviceManager;
|
||||
}
|
||||
|
||||
public static void showDeviceManager() {
|
||||
try {
|
||||
Runtime.getRuntime().exec(ExecHelper.getBatchCommand("devmgmt.msc"));
|
||||
} catch (IOException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static Component createPcanConnectorButton() {
|
||||
JButton button = new JButton("PCAN");
|
||||
button.setToolTipText("PCAN connector for TS");
|
||||
|
|
Loading…
Reference in New Issue