2020-05-19 23:32:14 -07:00
|
|
|
package com.rusefi.ui;
|
|
|
|
|
2020-07-02 19:22:50 -07:00
|
|
|
import com.rusefi.binaryprotocol.MsqFactory;
|
2020-05-19 23:51:14 -07:00
|
|
|
import com.rusefi.tools.online.Online;
|
|
|
|
import com.rusefi.tune.xml.Msq;
|
2020-06-02 20:19:25 -07:00
|
|
|
import com.rusefi.ui.util.Misc;
|
2020-05-19 23:32:14 -07:00
|
|
|
import org.putgemin.VerticalFlowLayout;
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
|
|
|
|
public class OnlineTab {
|
|
|
|
|
|
|
|
private final JPanel content = new JPanel(new VerticalFlowLayout());
|
|
|
|
|
2020-06-25 17:33:25 -07:00
|
|
|
public OnlineTab(UIContext uiContext) {
|
2020-06-03 21:32:35 -07:00
|
|
|
AuthTokenPanel authTokenPanel = new AuthTokenPanel();
|
2020-05-22 10:45:11 -07:00
|
|
|
|
2020-06-02 20:19:25 -07:00
|
|
|
content.add(Misc.getRusEFI_online_manual());
|
2020-05-19 23:32:14 -07:00
|
|
|
|
2020-06-03 21:32:35 -07:00
|
|
|
content.add(authTokenPanel.getContent());
|
2020-05-19 23:51:14 -07:00
|
|
|
|
|
|
|
JButton upload = new JButton("Upload");
|
|
|
|
upload.addActionListener(new AbstractAction() {
|
|
|
|
@Override
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
2023-06-16 13:38:48 -07:00
|
|
|
Msq tune = MsqFactory.valueOf(uiContext.getLinkManager().getCurrentStreamState().getControllerConfiguration(), uiContext.getIni());
|
2024-02-16 13:19:15 -08:00
|
|
|
Online.uploadTune(tune, content, null);
|
2020-05-19 23:51:14 -07:00
|
|
|
}
|
|
|
|
});
|
|
|
|
content.add(upload);
|
2020-05-19 23:32:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public JPanel getContent() {
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
}
|