~dobey/ubuntuone-control-panel/update-3-0

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/gui/qt/main/__init__.py

  • Committer: Natalia B. Bidart
  • Date: 2012-02-15 16:18:25 UTC
  • mfrom: (247.1.2 stable-3-0-update-2.99.4)
  • Revision ID: natalia.bidart@canonical.com-20120215161825-vzld15ehhy96zhsd
- Updating from trunk up to revno 259:

[ Natalia B. Bidart <natalia.bidart@canonical.com> ]
  - Install the uniqueapp module (LP: #930269).
  - Replaced custom webclient with the one from ubuntu-sso-client
    (LP: #926311).
  - Removed the dependency on qt4reactor for Linux implementation.
  - Avoid TypeError when fetching credentials in the Gtk OverviewPanel
     (LP: #927743).
  - Run the whole test suite with a single command (LP: #927770).
  - Do proper cleanup when dealing with UIs (LP: #925617).

[ Manuel de la Pena <manuel.delapena@canonical.com> ]
  - Forward extra params to u1trial (LP: #924384).

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# You should have received a copy of the GNU General Public License along
15
15
# with this program.  If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
 
"""Provide the correct reactor and ui integration."""
 
17
"""Provide the correct ui main module."""
18
18
 
19
19
import sys
20
20
 
37
37
 
38
38
 
39
39
def main(switch_to='', alert=False, minimized=False, with_icon=False):
40
 
    """Start the Qt reactor and open the main window."""
 
40
    """Start the Qt mainloop and open the main window."""
41
41
    # The following cannot be imported outside this function
42
42
    # because u1trial already provides a reactor.
43
43
 
44
 
    # The main loop MUST be initialized before importing the reactor
45
44
    app = UniqueApplication(sys.argv, "ubuntuone-control-panel")
46
45
    source.main(app)
 
46
 
47
47
    qss = QtCore.QResource(":/ubuntuone.qss")
48
48
    app.setStyleSheet(qss.data())
49
49
 
50
 
    # Reimport 'qt4reactor', 'reactor', 'start', pylint: disable=W0404, F0401
51
 
    import qt4reactor
52
 
    qt4reactor.install()
53
 
 
54
 
    from twisted.internet import reactor
55
50
    from ubuntuone.controlpanel.gui.qt.gui import start
56
 
    # pylint: enable=W0404, F0401
57
 
 
58
 
    # Module 'reactor' has no 'run'/'stop' member, pylint: disable=E1101
59
51
 
60
52
    # Unused variable 'window', 'icon', pylint: disable=W0612
61
 
    icon, window = start(reactor.stop,
 
53
    icon, window = start(lambda: source.main_quit(app),
62
54
                         minimized=minimized, with_icon=with_icon)
63
55
    # pylint: enable=W0612
64
56
    if icon:
65
57
        app.new_instance.connect(icon.restore_window)
66
58
 
67
 
    reactor.run()
68
 
    # pylint: enable=E1101
 
59
    source.main_start(app)