UI does not update after credentials RPC on darwin
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Ubuntu One Control Panel | Status tracked in Trunk | |||||
Stable-4-0 |
Fix Released
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
High
|
Mike McCracken |
Bug Description
running control panel will show UI and make an RPC call to SSO client to get credentials, but after that call returns the UI is frozen and no progress is made.
The application is not totally frozen however, qevents are still being sent, but nothing is updating.
Cause:
In bin/ubuntuone-
reactor before we have created a QApplication() instance (via the
UniqueApplic
instance for us. Unfortunately, it creates a QCoreApplication,
which doesn't update the UI.
Complication:
We can't just reorder these, because
importing ubuntuone.
brings a lot with it, eventually including ubuntuone.
and ubuntu_
reactor, and we get a "reactor already installed" error, as seen in
bug 942655. (I'm not sure why the code that works on Windows doesn't
work on darwin.)
This means that small changes that just change the order of
qt4reactor.
because of the import dependencies.
Related branches
- Manuel de la Peña (community): Approve
- Diego Sarmentero (community): Approve
-
Diff: 98 lines (+48/-3)3 files modifiedbin/ubuntuone-control-panel-qt (+2/-2)
ubuntuone/controlpanel/gui/qt/main/__init__.py (+13/-1)
ubuntuone/controlpanel/gui/qt/main/tests/test_main.py (+33/-0)
Changed in ubuntuone-control-panel: | |
assignee: | nobody → Mike McCracken (mikemc) |
Changed in ubuntuone-control-panel: | |
status: | In Progress → Fix Committed |
One way to fix this is to change qt4reactor to let us pass in whether we want a QApplication or QCoreApplication.
However, it seems better to try to fix this in our own code instead of worrying about patches to other code.
Another way is to move UniqueApplication up out of the controlpanel/gui/ tree.
This way it won't import all that crap it doesn't need before it can initialize the QApplication instance.
Then we can create the UniqueApplication in the toplevel script before any reactors are created.
I've done this by changing main.main() to take the app instead of argv.
I've tried this - I moved ubuntuone/ controlpanel/ gui/qt/ uniqueapp/ to ubuntuone/ controlpanel/ uniqueapp, and it works on darwin, but it needs fixes for the tests in controlpanel/ gui/qt/ main/tests/ test_main. py because I'm now passing the app to main instead of argv.
I'm noting all this before I make those test changes because I'm curious if anyone has objections to the change.
See the linked branch to see what I've done so far.