glutanimate / progress-bar

Progress Bar add-on for Anki
https://ankiweb.net/shared/info/2091361802
Other
12 stars 0 forks source link

Progress bar is a separate window instead of being part of the main window. #32

Open AlexanderMamonov opened 3 years ago

AlexanderMamonov commented 3 years ago

Problem description

Please describe the issue concisely in here. In case of an error: Walk us through the steps you took to get there. What happened? What did you expect to happen?

The progress bar is not at the top of the main window but it is a separate window. I guess it cannot add itself as a child of the main window. Maybe when it tries to do it the main window doesn't exist? I'm using the latest version from this repository git HEAD is ed3731887a5e239efebc8e26d59e65a23be7a983 image

Checklist

Please replace the space inside the brackets with an x if the following items apply:

Information about your Anki set-up

Please open Anki, go to Help → About, click on "Copy Debug Info", and paste the result between the backticks below (if the button does not appear you are using an older version of Anki 2.1 and will need to update first):


    Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
    Platform: Mac 10.15.7
    Flags: frz=True ao=True sv=2
    Add-ons, last update check: 2021-05-30 09:47:52

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    '' ['progress_bar', 0, 'None', '']

    ===IDs of active AnkiWeb add-ons===

    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    '' ['reviewer_progress_bar', 0, 'None', '']
    Anki Simulator ['817108664', 2021-02-21T16:44, 'None', '']
    AwesomeTTS - Add speech to your flashcards ['1436550454', 2021-05-27T09:19, 'None', '']
    Custom Background Image and Gear Icon ['1210908941', 2021-04-02T18:21, 'None', mod]
    Customize Keyboard Shortcuts ['24411424', 2021-02-18T02:36, 'None', mod]
    Heatmap ['1722241614', 2019-08-18T17:35, 'None', '']
    Image Occlusion Enhanced for Anki 21 alpha ['1374772155', 2020-04-28T04:21, 'None', '']
    Puppy Reinforcement ['1722658993', 2020-03-02T21:23, 'None', mod]
    Syntax Highlighting for Code ['1463041493', 2018-10-07T03:31, 'None', '']
    The KING of Button Add-ons ['374005964', 2020-04-18T00:33, 'None', '']

Error message (if any)

If you've received an error message, please copy and paste it between the backticks below:

jaredagordon commented 3 years ago

@AlexanderMamonov, Same thing has happened to me but now the progress bar won't even show up anymore upon opening Anki. @glutanimate, using 2.1.35.

glutanimate commented 3 years ago

Thanks for the report, guys. Will look into this.

AlexanderMamonov commented 2 years ago

It seems that Anki or Qt saves state of QDockWidget before exit and it tries to restore it on start. It seems because of some update Qt wasn't able to find where the QDockWidget with the progress bar should be added and it decided to keep it as a separate window. Because of this line you cannot really drag and drop the QDockWidget. I commented this line and QDockWidget got title bar. I used drag and drop to dock the QDockWidget into the top of the main window. I closed Anki, uncommented the line and started Anki again. The progressbar located and looks exactly how it suppose to be.

I bet the same effect could be achieved by removing a file where Qt stores settings of QDockWidgets.

I am not sure should we do something to prevent this kind of behaviour? Does the QProgressBar really needed to be in the QDockWidget? Why? If Yes, then the Dock should be draggle by any part of the window not only by the title or it should get a title if the Dock detached from the main window.