Menu

#1345 Remember Statistics dialog geometry

4.1
closed-fixed
None
5
2017-12-04
2017-10-21
No

Every time Statistics is called, the dialog position and size is reset. Under some window managers on Linux it's possible to resize the dialog with a titlebar button, on Windows the dialog can be resized by dragging one of its corners. It would be useful if the dialog's last geometry was remembered.

--
Kos

Discussion

  • Kos Ivantsov

    Kos Ivantsov - 2017-10-21

    I'm attaching a diff where this RFE is implemented. Please review if this can be committed. Thanks.

    --
    Kos

     
  • Aaron Madlon-Kay

    Using persistGeometry will remember both the size and the location, but the Statistics window is modal, so it doesn't make sense for the location to be anywhere other than the default, i.e. centered over the main window. When multiple instances of OmegaT are open, their Statistics windows would all be shown in the same place, which would be confusing.

    If your goal is just to remember the size, then I think adding a persistSize method would be more appropriate.

    Regarding your patch: the preference key is not consistent with the rest of the code:

    1. The window in question is called StatisticsWindow but the key string is "stats_dialog"
    2. (Almost) all of the existing _GEOMETRY keys have WINDOW in the field name, but this one doesn't
     

    Last edit: Aaron Madlon-Kay 2017-10-22
    • Kos Ivantsov

      Kos Ivantsov - 2017-10-24

      Thanks for the comments, Aaron! Here's another diff with hopefully proper preference key. Instead of adding another method, I moved persistGeomtry call before setLocationRelativeTo(parent), so even thought the window's location is being saved, it's ignored.

       
      • Aaron Madlon-Kay

        I had briefly looked at implementing persistSize but it would have been either a lot of duplicate code or a lot of extra switches. Your workaround is much better. The only thing I would add is a comment pointing out that you are calling setLocationRelativeTo afterwards on purpose because you only want to persist the size. With that I think it would be ready to commit to trunk.

         
        • Kos Ivantsov

          Kos Ivantsov - 2017-10-24

          Thank you, Aaron, for revising the patch.
          Comment added and code commited.

           
  • Kos Ivantsov

    Kos Ivantsov - 2017-10-24
    • status: open --> open-fixed
    • assigned_to: Kos Ivantsov
     
  • Aaron Madlon-Kay

    • Group: future --> 4.1
     
  • Didier Briel

    Didier Briel - 2017-12-04
    • status: open-fixed --> closed-fixed
     
  • Didier Briel

    Didier Briel - 2017-12-04

    Implemented in the released version 4.1.3 of OmegaT.

    Didier

     

Log in to post a comment.