Menu

#1038 Make segment numbers visible for all segments

3.1
closed-fixed
Yu Tang
None
5
2015-03-11
2014-10-29
No

Current behavior is that the segment number is only visible for the current segment. This is a request to add an option in the View menu, namely, "Display segment numbers for all segments".

Being able to see segment numbers for all segments would make more sense for the use of an already implemented feature, namely, "Go To Segment Number". The user must know the segment number beforehand in order to use that feature.

If this feature request is implemented, it would make more sense to move segment numbers to the start of the segment from their current position at the end of the segment.

The typical use case with current functionality would be as follows*:

1) The user scrolls up/down away from the currently active segment (either using the mouse or Page Up/Down keys)
2) S/he finds a segment of interest
3) S/he right-clicks the segment and selects "Go To Segment" from the pop-up menu.
OR
4) S/he double-clicks the segment.
5) The selected segment becomes active.

*Steps 2 through 4 can only be achieved using the mouse.

The new use case would be as follows*:

1) The user scrolls up/down away from the currently active segment
2) S/he finds a segment of interest
3) S/he presses the ctrl-J combination to call the "Go to Segment Number" feature
4) S/he inputs the selected segment's number in the box
5) The selected segments becomes active.

*The beauty of the new use case is that it can be achieved without moving the hands out of the keyboard and the time/effort used in the five steps is significantly reduced.

Discussion

  • Didier Briel

    Didier Briel - 2014-10-30

    If this feature request is implemented, it would make more sense to move segment numbers to the start of the segment from their current position at the end of the segment.

    It was in the front in the past, and it was changed because it hampered comparing the source and the target text, as it created a visual shift.

    Didier

     
    • Héctor Cartagena

      I kind of remember that. What about letting the numbers in their current position and making it possible to see them for all segments anyways?

      If that makes the editor window too cluttered, it could be activated only when the user hits Ctrl+J or hits "Go To - Segment Number", so they can see where they're going. After the cursor moves to the desired segment, segment numbers in other segments would not be visible anymore, until the user repeats the operation.

      Now, this is just a thought, but maybe a more elegant solution would be to change the editor window to a table with two columns (one for segment numbers, the other for segment texts) and as many rows as needed:

      0123 Source text for this segment.
      Target text for this segment.
      0124 Source text for this segment.
      Target text for this segment.

      I understand that would require quite a redevelopment, though.

       

      Last edit: Héctor Cartagena 2014-11-19
  • Yu Tang

    Yu Tang - 2014-11-04

    Probably it is easy to implement making "Go to Segment Number" dialog accepts any characters.
    If non-numeric characters are entered, it switches to "find the keyword in Editor" mode.
    Just a thought.

     
    • Héctor Cartagena

      Such a search may have multiple results, though. Segment numbers, on the other hand, are unique within a project.

       
  • Yu Tang

    Yu Tang - 2014-12-20

    How about this one?
    When "Go to Segment Number" dialog appears, also segment shortcut call-outs appears too.
    You could input segment number OR segment shortcut char in the box.

    Proof-of-Concept script is here.
    https://gist.github.com/yu-tang/7a5007c4d05ffbeada33
    Run this and see what happens.

     
    • Héctor Cartagena

      Great! Very nicely done, Yu! Having to type just a single letter is even better than a four digit number, thanks!

      I will definitely start using Ctrl+J quite often from now on!

       

      Last edit: Héctor Cartagena 2014-12-30
  • Yu Tang

    Yu Tang - 2014-12-31

    @Didier, feel free assign this to me if the concept is fine for you too.

     
  • Didier Briel

    Didier Briel - 2015-01-04
    • assigned_to: Yu Tang
    • Group: 2.6 --> 3.1
     
  • Aaron Madlon-Kay

    Commit r6916 introduces an NPE every time the Go To Segment Number dialog is opened on OS X. The following patch fixes it, and the feature still seems to work, but I'm posting this here in the hopes that Yu Tang can solve the issue appropriately.

    diff --git a/src/org/omegat/gui/main/MainWindowMenuHandler.java b/src/org/omegat/gui/main/MainWindowMenuHandler.java
    index a989b47..5e151a1 100644
    --- a/src/org/omegat/gui/main/MainWindowMenuHandler.java
    +++ b/src/org/omegat/gui/main/MainWindowMenuHandler.java
    @@ -588,6 +588,9 @@ public class MainWindowMenuHandler {
                         final KeyboardFocusManager keyboardFocusManager =
                                 KeyboardFocusManager.getCurrentKeyboardFocusManager();
                         final JTextField f = (JTextField) keyboardFocusManager.getFocusOwner();
    +                    if (f == null) {
    +                        return;
    +                    }
                         f.addKeyListener(new KeyAdapter() {
    
                             @Override
    
     
    • Yu Tang

      Yu Tang - 2015-02-18

      Hi Aaron,

      Good catch!
      I think that basically I must subclass JDialog for the workaround but I feel it's too much.
      Your patch seems fine to me for avoiding NPE. I just have commited the fix to /trunk.
      Sorry for inconvenience. It's so hard to make sure about UI-thing without the right platform, so you've been very helpful.
      Let me buy you a drink in Shibuya next week. :)

       
  • Didier Briel

    Didier Briel - 2015-03-11
    • status: open --> closed-fixed
     
  • Didier Briel

    Didier Briel - 2015-03-11

    Closed in the released version 3.1.9 of OmegaT.

    Didier

     

Log in to post a comment.