Skip to content

Commit

Permalink
Add compatibility warning, closes #92
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Feb 18, 2024
1 parent 32f6db1 commit d042063
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/main/java/mpo/dayon/assistant/gui/Assistant.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private void initGui() {
if (frame != null) {
frame.setVisible(false);
}
frame = new AssistantFrame(createAssistantActions(), counters, createLanguageSelection());
frame = new AssistantFrame(createAssistantActions(), counters, createLanguageSelection(), compatibilityModeActive.get());
FatalErrorHandler.attachFrame(frame);
frame.addListener(new ControlEngine(network));
frame.setVisible(true);
Expand Down Expand Up @@ -644,6 +644,10 @@ private Action createToggleCompatibilityModeAction() {
@Override
public void actionPerformed(ActionEvent ev) {
compatibilityModeActive.set(!compatibilityModeActive.get());
if (compatibilityModeActive.get()) {
JOptionPane.showMessageDialog(frame, translate("compatibility.mode.info"),
translate("compatibility.mode.active"), JOptionPane.WARNING_MESSAGE);
}
frame.repaint();
}
};
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/mpo/dayon/assistant/gui/AssistantFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class AssistantFrame extends BaseFrame {

private final JToggleButton controlToggleButton;

private final JToggleButton compatibilityToggleButton;

private final JToggleButton windowsKeyToggleButton;

private final JToggleButton ctrlKeyToggleButton;
Expand Down Expand Up @@ -80,12 +82,13 @@ class AssistantFrame extends BaseFrame {

private final JComboBox<Language> languageSelection;

AssistantFrame(AssistantActions actions, Set<Counter<?>> counters, JComboBox<Language> languageSelection) {
AssistantFrame(AssistantActions actions, Set<Counter<?>> counters, JComboBox<Language> languageSelection, boolean compatibilityModeActive) {
RepeatingReleasedEventsFixer.install();
super.setFrameType(FrameType.ASSISTANT);
this.actions = actions;
this.startButton = createButton(actions.getStartAction());
this.stopButton = createButton(actions.getStopAction(), false);
this.compatibilityToggleButton = createToggleButton(actions.getToggleCompatibilityModeAction(), true, compatibilityModeActive);
this.controlToggleButton = createToggleButton(createToggleControlMode());
this.fitToScreenToggleButton = createToggleButton(createToggleFixScreenAction());
this.keepAspectRatioToggleButton = createToggleButton(createToggleKeepAspectRatioAction(), false);
Expand Down Expand Up @@ -227,7 +230,7 @@ private JTabbedPane createTabbedPane() {
connectionPanel.add(stopButton);
connectionPanel.add(createButton(actions.getTokenAction()));
connectionPanel.add(createButton(actions.getIpAddressAction()));
connectionPanel.add(createToggleButton(actions.getToggleCompatibilityModeAction()));
connectionPanel.add(compatibilityToggleButton);

JPanel sessionPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
sessionPanel.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/mpo/dayon/common/gui/common/BaseFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ protected JToggleButton createToggleButton(Action action, boolean visible) {
return button;
}

protected JToggleButton createToggleButton(Action action, boolean visible, boolean selected) {
final JToggleButton button = createToggleButton(action, visible);
button.setSelected(selected);
return button;
}

private void addButtonProperties(Action action, AbstractButton button) {
button.setMargin(ZERO_INSETS);
button.setHideActionText(true);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/Babylon.properties
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ share.all.screens = Share all screens

compatibility.mode = Compatibility mode for previous versions
compatibility.mode.enable = Enable compatibility mode!
compatibility.mode.active = Compatibility mode active
compatibility.mode.info = Please consider updating Assisted to the latest version to minimize risks.

changeLanguage = Change language
startChat = Start a chat
2 changes: 2 additions & 0 deletions src/main/resources/Babylon_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ share.all.screens = Alle Bildschirme teilen

compatibility.mode = Kompatibilit\u00E4tsmodus f\u00FCr Vorg\u00E4ngerversionen
compatibility.mode.enable = Kompatibilit\u00E4tsmodus aktivieren!
compatibility.mode.active = Kompatibilit\u00E4tsmodus aktiv
compatibility.mode.info = Um Sicherheitsrisiken zu minimieren, aktualisieren Sie doch biite den Assistierten auf die neueste Version.

changeLanguage = Sprache \u00E4ndern
startChat = Chat starten
2 changes: 2 additions & 0 deletions src/main/resources/Babylon_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ share.all.screens = Compartir todas las pantallas

compatibility.mode = Modo de compatibilidad para versiones anteriores
compatibility.mode.enable = \u00A1Habilite el modo de compatibilidad!
compatibility.mode.active = Modo de compatibilidad activo
compatibility.mode.info = Por favor, considere actualizar Assisted a la \u00FAltima versi\u00F3n para minimizar los riesgos.

changeLanguage = Cambiar el idioma
startChat = Iniciar un chat
2 changes: 2 additions & 0 deletions src/main/resources/Babylon_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ share.all.screens = Partager tous les \u00E9crans

compatibility.mode = Mode de compatibilit\u00E9 pour les versions pr\u00E9c\u00E9dentes
compatibility.mode.enable = Activez le mode compatibilit\u00E9!
compatibility.mode.active = Mode de compatibilit\u00E9 actif
compatibility.mode.info = Veuillez consid\u00E9rer la mise \u00E0 jour de l'assist\u00E9 vers la derni\u00E8re version afin de minimiser les risques.

changeLanguage = Changer la langue
startChat = Commencer un chat
2 changes: 2 additions & 0 deletions src/main/resources/Babylon_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ share.all.screens = Condividi tutti gli schermi

compatibility.mode = Modalit\u00E0 di compatibilit\u00E0 per le versioni precedenti
compatibility.mode.enable = Abilita la modalit\u00E0 compatibilit\u00E0!
compatibility.mode.active = Modalit\u00E0 di compatibilit\u00E0 attiva
compatibility.mode.info = Si consiglia di aggiornare assistito alla versione pi\u00F9 recente per ridurre al minimo i rischi.

changeLanguage = Cambiare la lingua
startChat = Iniziare una chat
2 changes: 2 additions & 0 deletions src/main/resources/Babylon_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ share.all.screens = \u0414\u0435\u043B\u0438\u0442\u0435\u0441\u044C \u0432\u044

compatibility.mode = \u0420\u0435\u0436\u0438\u043C \u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u0438 \u0441 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u043C\u0438 \u0432\u0435\u0440\u0441\u0438\u044F\u043C\u0438
compatibility.mode.enable = \u0412\u043A\u043B\u044E\u0447\u0438\u0442\u0435 \u0440\u0435\u0436\u0438\u043C \u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u0438!
compatibility.mode.active = \u0420\u0435\u0436\u0438\u043C \u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u0438 \u0430\u043A\u0442\u0438\u0432\u0435\u043D
compatibility.mode.info = \u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u041F\u043E\u043C\u043E\u0433\u0430\u043B \u0434\u043E \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0447\u0442\u043E\u0431\u044B \u043C\u0438\u043D\u0438\u043C\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0438\u0441\u043A\u0438.

changeLanguage = \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u044F\u0437\u044B\u043A
startChat = \u043D\u0430\u0447\u0430\u0442\u044C \u0447\u0430\u0442
2 changes: 2 additions & 0 deletions src/main/resources/Babylon_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ share.all.screens = Dela alla sk\u00E4rmar

compatibility.mode = Kompatibelt l\u00E4ge f\u00F6r tidigare versioner
compatibility.mode.enable = Aktivera kompatibilitetsl\u00E4ge!
compatibility.mode.active = Kompatibelt l\u00E4ge aktivt
compatibility.mode.info = V\u00E4nligen \u00F6verv\u00E4ga att uppdatera Hj\u00E4lptagare till den senaste versionen f\u00F6r att minimera riskerna.

changeLanguage = V\u00E4xla spr\u00E5kl\u00E4ge
startChat = Starta en chatt
2 changes: 2 additions & 0 deletions src/main/resources/Babylon_tr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ share.all.screens = T\u00FCm ekranlar\u0131 payla\u015F

compatibility.mode = \u00D6nceki s\u00FCr\u00FCmler i\u00E7in uyumluluk modu
compatibility.mode.enable = Uyumluluk modunu etkinle\u015Ftirin!
compatibility.mode.active = Uyumluluk modu etkin
compatibility.mode.info = Riskleri en aza indirmek i\u00E7in l\u00FCtfen yard\u0131ml\u0131 en son s\u00FCr\u00FCme g\u00FCncellemeyi d\u00FC\u015F\u00FCn\u00FCn.

changeLanguage = Dili de\u011Fi\u015Ftir
startChat = Sohbet ba\u015Flat
2 changes: 2 additions & 0 deletions src/main/resources/Babylon_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ share.all.screens = \u5171\u4EAB\u6240\u6709\u5C4F\u5E55

compatibility.mode = \u4EE5\u524D\u7248\u672C\u7684\u517C\u5BB9\u6A21\u5F0F
compatibility.mode.enable = \u542F\u7528\u517C\u5BB9\u6A21\u5F0F\uFF01
compatibility.mode.active = \u517C\u5BB9\u6A21\u5F0F\u5DF2\u6FC0\u6D3B
compatibility.mode.info = \u8BF7\u8003\u8651\u5C06\u60A8\u7684\u540C\u884C\u7CFB\u7EDF\u5347\u7EA7\u5230\u6700\u65B0\u7248\u672C\uFF0C\u4EE5\u6700\u5927\u9650\u5EA6\u5730\u964D\u4F4E\u98CE\u9669\u3002

changeLanguage = \u6539\u53D8\u8BED\u8A00
startChat = \u5F00\u59CB\u804A\u5929

0 comments on commit d042063

Please sign in to comment.