Skip to content

Commit

Permalink
Revert "[PR#950] Suggested changes"
Browse files Browse the repository at this point in the history
- OmegaT core is not mature for marker to enable plugin fully.
- I withdraw my previous suggestion

This reverts commit 87c722e.

Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Jul 11, 2024
1 parent c3a8525 commit 6263635
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
4 changes: 4 additions & 0 deletions src/org/omegat/gui/editor/IEditorSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public interface IEditorSettings {

void setMarkBidi(boolean markBidi);

boolean isMarkAltTranslations();

void setMarkAltTranslations(boolean markAltTranslations);

boolean isAutoSpellChecking();

void setAutoSpellChecking(boolean isNeedToSpell);
Expand Down
1 change: 1 addition & 0 deletions src/org/omegat/gui/editor/MarkerController.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public static void init() throws Exception {
Core.registerMarker(new ComesFromMTMarker());
Core.registerMarker(new FontFallbackMarker());
Core.registerMarker(new SpellCheckerMarker());
Core.registerMarker(new AltTranslationsMarker());
}


Expand Down
9 changes: 1 addition & 8 deletions src/org/omegat/gui/editor/mark/AltTranslationsMarker.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import org.omegat.core.Core;
import org.omegat.core.data.SourceTextEntry;
import org.omegat.gui.editor.EditorSettings;
import org.omegat.util.gui.Styles;

import javax.swing.text.Highlighter;
Expand All @@ -39,19 +38,13 @@ public class AltTranslationsMarker extends AbstractMarker {
private final Highlighter.HighlightPainter painter = new TransparentHighlightPainter(
Styles.EditorColor.COLOR_MARK_ALT_TRANSLATION.getColor(), 0.5F);

public static void loadPlugins() {
Core.registerMarkerClass(AltTranslationsMarker.class);
}
public static void unloadPlugins() {
}

public AltTranslationsMarker() throws Exception {
super();
}

@Override
protected boolean isEnabled() {
return ((EditorSettings) Core.getEditor().getSettings()).isMarkAltTranslations();
return Core.getEditor().getSettings().isMarkAltTranslations();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/org/omegat/gui/main/BaseMainWindowMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ protected void updateCheckboxesOnStart() {
viewMarkNotedSegmentsCheckBoxMenuItem
.setSelected(Core.getEditor().getSettings().isMarkNotedSegments());
viewMarkAlternativeTranslationsCheckBoxMenuItem
.setSelected(((EditorSettings) Core.getEditor().getSettings()).isMarkAltTranslations());
.setSelected(Core.getEditor().getSettings().isMarkAltTranslations());
viewMarkNBSPCheckBoxMenuItem.setSelected(Core.getEditor().getSettings().isMarkNBSP());
viewMarkWhitespaceCheckBoxMenuItem.setSelected(Core.getEditor().getSettings().isMarkWhitespace());
viewMarkBidiCheckBoxMenuItem.setSelected(Core.getEditor().getSettings().isMarkBidi());
Expand Down
3 changes: 2 additions & 1 deletion src/org/omegat/gui/main/MainWindowMenuHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,8 @@ public void viewMarkBidiCheckBoxMenuItemActionPerformed() {
}

public void viewMarkAlternativeTranslationsCheckBoxMenuItemActionPerformed() {
((EditorSettings) Core.getEditor().getSettings())
Core.getEditor()
.getSettings()
.setMarkAltTranslations(
mainWindow.menu.viewMarkAlternativeTranslationsCheckBoxMenuItem.isSelected());
}
Expand Down

0 comments on commit 6263635

Please sign in to comment.