~jbicha/ubuntu-sso-client/lp-949978-improve-grammar

« back to all changes in this revision

Viewing changes to ubuntu_sso/qt/ssl_dialog.py

  • Committer: Tarmac
  • Author(s): Manuel de la Pena
  • Date: 2012-03-05 21:26:30 UTC
  • mfrom: (897.2.2 appname-ssl)
  • Revision ID: tarmac-20120305212630-qo1f3hotxo25j4cx
Ensure that the strings used in sso do not have ubuntu one in them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
from ubuntu_sso.qt.ui.ssl_dialog_ui import Ui_SSLDialog
36
36
from ubuntu_sso.utils.ui import (
37
37
    CANCEL_BUTTON,
 
38
    SSL_APPNAME_HELP,
38
39
    SSL_DETAILS_HELP,
39
40
    SSL_DIALOG_TITLE,
40
41
    SSL_DESCRIPTION,
64
65
class SSLDialog(QDialog):
65
66
    """"Dialog used to show SSL exceptions."""
66
67
 
67
 
    def __init__(self, domain=None, details=None, parent=None):
 
68
    def __init__(self, app_name, domain=None, details=None, parent=None):
68
69
        """Create a new instance."""
69
70
        super(SSLDialog, self).__init__()
70
71
        if domain is None:
75
76
            logger.debug('Details passed as None.')
76
77
            details = ''
77
78
        self.details = details
 
79
        self.app_name = app_name
78
80
        self.ssl_text = None
79
81
        self.expander = None
80
82
        self.ui = Ui_SSLDialog()
94
96
                                        second_reason=SSL_SECOND_REASON,
95
97
                                        third_reason=SSL_THIRD_REASON)
96
98
        self.ui.intro_label.setText(intro)
97
 
        self.ui.not_sure_label.setText(SSL_NOT_SURE)
 
99
        self.ui.not_sure_label.setText(SSL_NOT_SURE %
 
100
                                       {'app_name': self.app_name})
98
101
        self.ui.remember_checkbox.setText(SSL_REMEMBER_DECISION)
99
102
 
100
103
    def _on_cancel_clicked(self):
142
145
        help=SSL_DOMAIN_HELP)
143
146
    parser.add_argument('--details', required=True,
144
147
        help=SSL_DETAILS_HELP)
 
148
    parser.add_argument('--appname', required=True,
 
149
        help=SSL_APPNAME_HELP)
145
150
    return parser.parse_args()
146
151
 
147
152
 
151
156
    app = QApplication(sys.argv)
152
157
    # pylint: enable=W0612
153
158
    args = parse_args()
154
 
    win = SSLDialog(domain=args.domain, details=args.details)
 
159
    win = SSLDialog(args.appname, domain=args.domain, details=args.details)
155
160
    return_code = win.exec_()
156
161
    sys.exit(return_code)