~gary-lasker/software-center/fix-dbus-crash-reinstall-prev-lp863898

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/app.py

  • Committer: Gary Lasker
  • Date: 2011-10-20 00:00:21 UTC
  • Revision ID: gary.lasker@canonical.com-20111020000021-09hm4lk93rbdgwqg
don't reuse the dbus proxy object for SSO, this prevents the crash

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
 
89
89
from softwarecenter.config import get_config
90
90
from softwarecenter.backend import get_install_backend
 
91
from softwarecenter.backend.login_sso import get_sso_backend
91
92
 
92
93
from softwarecenter.backend.channel import AllInstalledChannel
93
94
from softwarecenter.backend.reviews import get_review_loader, UsefulnessCache
699
700
        d = LoginDialog(self.glaunchpad, self.datadir, parent=self.window_main)
700
701
        d.login()
701
702
 
702
 
    def _create_dbus_sso_if_needed(self):
703
 
        if not self.sso:
704
 
            from softwarecenter.backend.login_sso import get_sso_backend
705
 
            # see bug #773214 for the rational
706
 
            #appname = _("Ubuntu Software Center Store")
707
 
            appname = "Ubuntu Software Center Store"
708
 
            help_text = _("To reinstall previous purchases, sign in to the "
709
 
                          "Ubuntu Single Sign-On account you used to pay for them.")
710
 
            #window = self.window_main.get_window()
711
 
            #xid = self.get_window().xid
712
 
            xid = 0
713
 
            self.sso = get_sso_backend(xid,
714
 
                                       appname,
715
 
                                       help_text)
716
 
            self.sso.connect("login-successful", self._on_sso_login)
 
703
    def _create_dbus_sso(self):
 
704
        # see bug #773214 for the rationale
 
705
        #appname = _("Ubuntu Software Center Store")
 
706
        appname = "Ubuntu Software Center Store"
 
707
        help_text = _("To reinstall previous purchases, sign in to the "
 
708
                      "Ubuntu Single Sign-On account you used to pay for them.")
 
709
        #window = self.window_main.get_window()
 
710
        #xid = self.get_window().xid
 
711
        xid = 0
 
712
        self.sso = get_sso_backend(xid,
 
713
                                   appname,
 
714
                                   help_text)
 
715
        self.sso.connect("login-successful", self._on_sso_login)
717
716
 
718
717
    def _login_via_dbus_sso(self):
719
 
        self._create_dbus_sso_if_needed()
 
718
        self._create_dbus_sso()
720
719
        self.sso.login()
721
720
 
722
721
    def _create_scagent_if_needed(self):