Philipp Hörist pushed to branch master at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/data/gui/certificate_dialog.ui
    1 1
     <?xml version="1.0" encoding="UTF-8"?>
    
    2
    -<!-- Generated with glade 3.22.1 -->
    
    2
    +<!-- Generated with glade 3.22.2 -->
    
    3 3
     <interface>
    
    4 4
       <requires lib="gtk+" version="3.20"/>
    
    5 5
       <object class="GtkBox" id="certificate_box">
    
    ... ... @@ -32,7 +32,6 @@
    32 32
               <object class="GtkLabel" id="label_cert_for_account">
    
    33 33
                 <property name="visible">True</property>
    
    34 34
                 <property name="can_focus">False</property>
    
    35
    -            <property name="label">&lt;Certificate for account %s&gt;</property>
    
    36 35
                 <property name="justify">center</property>
    
    37 36
                 <style>
    
    38 37
                   <class name="large-header"/>
    
    ... ... @@ -63,6 +62,7 @@
    63 62
                 <property name="visible">True</property>
    
    64 63
                 <property name="can_focus">False</property>
    
    65 64
                 <property name="halign">end</property>
    
    65
    +            <property name="valign">start</property>
    
    66 66
                 <property name="label" translatable="yes">Common Name (CN)</property>
    
    67 67
                 <style>
    
    68 68
                   <class name="dim-label"/>
    
    ... ... @@ -91,6 +91,7 @@
    91 91
                 <property name="visible">True</property>
    
    92 92
                 <property name="can_focus">False</property>
    
    93 93
                 <property name="halign">end</property>
    
    94
    +            <property name="valign">start</property>
    
    94 95
                 <property name="label" translatable="yes">Organization (O)</property>
    
    95 96
                 <style>
    
    96 97
                   <class name="dim-label"/>
    
    ... ... @@ -119,6 +120,7 @@
    119 120
                 <property name="visible">True</property>
    
    120 121
                 <property name="can_focus">False</property>
    
    121 122
                 <property name="halign">end</property>
    
    123
    +            <property name="valign">start</property>
    
    122 124
                 <property name="label" translatable="yes">Organizational Unit (OU)</property>
    
    123 125
                 <style>
    
    124 126
                   <class name="dim-label"/>
    
    ... ... @@ -147,6 +149,7 @@
    147 149
                 <property name="visible">True</property>
    
    148 150
                 <property name="can_focus">False</property>
    
    149 151
                 <property name="halign">end</property>
    
    152
    +            <property name="valign">start</property>
    
    150 153
                 <property name="label" translatable="yes">Serial Number</property>
    
    151 154
                 <style>
    
    152 155
                   <class name="dim-label"/>
    
    ... ... @@ -164,10 +167,12 @@
    164 167
                 <property name="halign">start</property>
    
    165 168
                 <property name="label">&lt;&gt;</property>
    
    166 169
                 <property name="wrap">True</property>
    
    167
    -            <property name="wrap_mode">char</property>
    
    170
    +            <property name="wrap_mode">word-char</property>
    
    168 171
                 <property name="selectable">True</property>
    
    169
    -            <property name="max_width_chars">30</property>
    
    170 172
                 <property name="xalign">0</property>
    
    173
    +            <attributes>
    
    174
    +              <attribute name="font-desc" value="Monospace 8"/>
    
    175
    +            </attributes>
    
    171 176
               </object>
    
    172 177
               <packing>
    
    173 178
                 <property name="left_attach">1</property>
    
    ... ... @@ -179,6 +184,7 @@
    179 184
                 <property name="visible">True</property>
    
    180 185
                 <property name="can_focus">False</property>
    
    181 186
                 <property name="halign">end</property>
    
    187
    +            <property name="valign">start</property>
    
    182 188
                 <property name="label" translatable="yes">Common Name (CN)</property>
    
    183 189
                 <style>
    
    184 190
                   <class name="dim-label"/>
    
    ... ... @@ -207,6 +213,7 @@
    207 213
                 <property name="visible">True</property>
    
    208 214
                 <property name="can_focus">False</property>
    
    209 215
                 <property name="halign">end</property>
    
    216
    +            <property name="valign">start</property>
    
    210 217
                 <property name="label" translatable="yes">Organization (O)</property>
    
    211 218
                 <style>
    
    212 219
                   <class name="dim-label"/>
    
    ... ... @@ -235,6 +242,7 @@
    235 242
                 <property name="visible">True</property>
    
    236 243
                 <property name="can_focus">False</property>
    
    237 244
                 <property name="halign">end</property>
    
    245
    +            <property name="valign">start</property>
    
    238 246
                 <property name="label" translatable="yes">Organizational Unit (OU)</property>
    
    239 247
                 <style>
    
    240 248
                   <class name="dim-label"/>
    
    ... ... @@ -263,6 +271,7 @@
    263 271
                 <property name="visible">True</property>
    
    264 272
                 <property name="can_focus">False</property>
    
    265 273
                 <property name="halign">end</property>
    
    274
    +            <property name="valign">start</property>
    
    266 275
                 <property name="label" translatable="yes">Issued on</property>
    
    267 276
                 <style>
    
    268 277
                   <class name="dim-label"/>
    
    ... ... @@ -291,6 +300,7 @@
    291 300
                 <property name="visible">True</property>
    
    292 301
                 <property name="can_focus">False</property>
    
    293 302
                 <property name="halign">end</property>
    
    303
    +            <property name="valign">start</property>
    
    294 304
                 <property name="label" translatable="yes">Expires on</property>
    
    295 305
                 <style>
    
    296 306
                   <class name="dim-label"/>
    
    ... ... @@ -318,7 +328,8 @@
    318 328
               <object class="GtkLabel">
    
    319 329
                 <property name="visible">True</property>
    
    320 330
                 <property name="can_focus">False</property>
    
    321
    -            <property name="halign">baseline</property>
    
    331
    +            <property name="halign">end</property>
    
    332
    +            <property name="valign">start</property>
    
    322 333
                 <property name="label" translatable="yes">SHA-1</property>
    
    323 334
                 <style>
    
    324 335
                   <class name="dim-label"/>
    
    ... ... @@ -327,57 +338,53 @@
    327 338
               <packing>
    
    328 339
                 <property name="left_attach">0</property>
    
    329 340
                 <property name="top_attach">13</property>
    
    330
    -            <property name="width">2</property>
    
    331 341
               </packing>
    
    332 342
             </child>
    
    333 343
             <child>
    
    334 344
               <object class="GtkLabel">
    
    335 345
                 <property name="visible">True</property>
    
    336 346
                 <property name="can_focus">False</property>
    
    337
    -            <property name="halign">baseline</property>
    
    338 347
                 <property name="margin_top">6</property>
    
    339
    -            <property name="label" translatable="yes">SHA-256</property>
    
    348
    +            <property name="label" translatable="yes">Issued to</property>
    
    340 349
                 <style>
    
    341
    -              <class name="dim-label"/>
    
    350
    +              <class name="bold"/>
    
    342 351
                 </style>
    
    343 352
               </object>
    
    344 353
               <packing>
    
    345 354
                 <property name="left_attach">0</property>
    
    346
    -            <property name="top_attach">15</property>
    
    355
    +            <property name="top_attach">0</property>
    
    347 356
                 <property name="width">2</property>
    
    348 357
               </packing>
    
    349 358
             </child>
    
    350 359
             <child>
    
    351
    -          <object class="GtkLabel" id="data_sha1">
    
    360
    +          <object class="GtkLabel">
    
    352 361
                 <property name="visible">True</property>
    
    353 362
                 <property name="can_focus">False</property>
    
    354
    -            <property name="halign">center</property>
    
    355
    -            <property name="label">&lt;&gt;</property>
    
    356
    -            <property name="wrap">True</property>
    
    357
    -            <property name="wrap_mode">char</property>
    
    358
    -            <property name="selectable">True</property>
    
    359
    -            <property name="max_width_chars">52</property>
    
    363
    +            <property name="margin_top">12</property>
    
    364
    +            <property name="label" translatable="yes">Issued by</property>
    
    365
    +            <style>
    
    366
    +              <class name="bold"/>
    
    367
    +            </style>
    
    360 368
               </object>
    
    361 369
               <packing>
    
    362 370
                 <property name="left_attach">0</property>
    
    363
    -            <property name="top_attach">14</property>
    
    371
    +            <property name="top_attach">5</property>
    
    364 372
                 <property name="width">2</property>
    
    365 373
               </packing>
    
    366 374
             </child>
    
    367 375
             <child>
    
    368
    -          <object class="GtkLabel" id="data_sha256">
    
    376
    +          <object class="GtkLabel">
    
    369 377
                 <property name="visible">True</property>
    
    370 378
                 <property name="can_focus">False</property>
    
    371
    -            <property name="halign">center</property>
    
    372
    -            <property name="label">&lt;&gt;</property>
    
    373
    -            <property name="wrap">True</property>
    
    374
    -            <property name="wrap_mode">char</property>
    
    375
    -            <property name="selectable">True</property>
    
    376
    -            <property name="max_width_chars">52</property>
    
    379
    +            <property name="margin_top">12</property>
    
    380
    +            <property name="label" translatable="yes">Validity</property>
    
    381
    +            <style>
    
    382
    +              <class name="bold"/>
    
    383
    +            </style>
    
    377 384
               </object>
    
    378 385
               <packing>
    
    379 386
                 <property name="left_attach">0</property>
    
    380
    -            <property name="top_attach">16</property>
    
    387
    +            <property name="top_attach">9</property>
    
    381 388
                 <property name="width">2</property>
    
    382 389
               </packing>
    
    383 390
             </child>
    
    ... ... @@ -385,68 +392,68 @@
    385 392
               <object class="GtkLabel">
    
    386 393
                 <property name="visible">True</property>
    
    387 394
                 <property name="can_focus">False</property>
    
    388
    -            <property name="halign">baseline</property>
    
    389
    -            <property name="margin_top">6</property>
    
    390
    -            <property name="label" translatable="yes">Issued to</property>
    
    395
    +            <property name="margin_top">12</property>
    
    396
    +            <property name="label" translatable="yes">Fingerprints</property>
    
    391 397
                 <style>
    
    392 398
                   <class name="bold"/>
    
    393 399
                 </style>
    
    394 400
               </object>
    
    395 401
               <packing>
    
    396 402
                 <property name="left_attach">0</property>
    
    397
    -            <property name="top_attach">0</property>
    
    403
    +            <property name="top_attach">12</property>
    
    398 404
                 <property name="width">2</property>
    
    399 405
               </packing>
    
    400 406
             </child>
    
    401 407
             <child>
    
    402
    -          <object class="GtkLabel">
    
    408
    +          <object class="GtkLabel" id="data_sha1">
    
    403 409
                 <property name="visible">True</property>
    
    404 410
                 <property name="can_focus">False</property>
    
    405
    -            <property name="halign">baseline</property>
    
    406
    -            <property name="margin_top">12</property>
    
    407
    -            <property name="label" translatable="yes">Issued by</property>
    
    408
    -            <style>
    
    409
    -              <class name="bold"/>
    
    410
    -            </style>
    
    411
    +            <property name="halign">start</property>
    
    412
    +            <property name="label">&lt;&gt;</property>
    
    413
    +            <property name="wrap">True</property>
    
    414
    +            <property name="wrap_mode">char</property>
    
    415
    +            <property name="selectable">True</property>
    
    416
    +            <attributes>
    
    417
    +              <attribute name="font-desc" value="Monospace 8"/>
    
    418
    +            </attributes>
    
    411 419
               </object>
    
    412 420
               <packing>
    
    413
    -            <property name="left_attach">0</property>
    
    414
    -            <property name="top_attach">5</property>
    
    415
    -            <property name="width">2</property>
    
    421
    +            <property name="left_attach">1</property>
    
    422
    +            <property name="top_attach">13</property>
    
    416 423
               </packing>
    
    417 424
             </child>
    
    418 425
             <child>
    
    419 426
               <object class="GtkLabel">
    
    420 427
                 <property name="visible">True</property>
    
    421 428
                 <property name="can_focus">False</property>
    
    422
    -            <property name="halign">baseline</property>
    
    423
    -            <property name="margin_top">12</property>
    
    424
    -            <property name="label" translatable="yes">Validity</property>
    
    429
    +            <property name="halign">end</property>
    
    430
    +            <property name="valign">start</property>
    
    431
    +            <property name="label" translatable="yes">SHA-256</property>
    
    425 432
                 <style>
    
    426
    -              <class name="bold"/>
    
    433
    +              <class name="dim-label"/>
    
    427 434
                 </style>
    
    428 435
               </object>
    
    429 436
               <packing>
    
    430 437
                 <property name="left_attach">0</property>
    
    431
    -            <property name="top_attach">9</property>
    
    432
    -            <property name="width">2</property>
    
    438
    +            <property name="top_attach">14</property>
    
    433 439
               </packing>
    
    434 440
             </child>
    
    435 441
             <child>
    
    436
    -          <object class="GtkLabel">
    
    442
    +          <object class="GtkLabel" id="data_sha256">
    
    437 443
                 <property name="visible">True</property>
    
    438 444
                 <property name="can_focus">False</property>
    
    439
    -            <property name="halign">baseline</property>
    
    440
    -            <property name="margin_top">12</property>
    
    441
    -            <property name="label" translatable="yes">Fingerprints</property>
    
    442
    -            <style>
    
    443
    -              <class name="bold"/>
    
    444
    -            </style>
    
    445
    +            <property name="halign">start</property>
    
    446
    +            <property name="label">&lt;&gt;</property>
    
    447
    +            <property name="wrap">True</property>
    
    448
    +            <property name="wrap_mode">char</property>
    
    449
    +            <property name="selectable">True</property>
    
    450
    +            <attributes>
    
    451
    +              <attribute name="font-desc" value="Monospace 8"/>
    
    452
    +            </attributes>
    
    445 453
               </object>
    
    446 454
               <packing>
    
    447
    -            <property name="left_attach">0</property>
    
    448
    -            <property name="top_attach">12</property>
    
    449
    -            <property name="width">2</property>
    
    455
    +            <property name="left_attach">1</property>
    
    456
    +            <property name="top_attach">14</property>
    
    450 457
               </packing>
    
    451 458
             </child>
    
    452 459
             <child>
    
    ... ... @@ -468,7 +475,7 @@
    468 475
               </object>
    
    469 476
               <packing>
    
    470 477
                 <property name="left_attach">1</property>
    
    471
    -            <property name="top_attach">17</property>
    
    478
    +            <property name="top_attach">15</property>
    
    472 479
               </packing>
    
    473 480
             </child>
    
    474 481
             <child>
    

  • gajim/gtk/dialogs.py
    ... ... @@ -215,20 +215,19 @@ class ErrorDialog(HigDialog):
    215 215
     class CertificateDialog(Gtk.ApplicationWindow):
    
    216 216
         def __init__(self, transient_for, account, cert):
    
    217 217
             Gtk.ApplicationWindow.__init__(self)
    
    218
    +        self.account = account
    
    218 219
             self.set_name('CertificateDialog')
    
    219 220
             self.set_application(app.app)
    
    220 221
             self.set_show_menubar(False)
    
    221 222
             self.set_resizable(False)
    
    222 223
             self.set_position(Gtk.WindowPosition.CENTER)
    
    223 224
             self.set_title(_('Certificate'))
    
    224
    -        self.account = account
    
    225 225
     
    
    226 226
             self._ui = get_builder('certificate_dialog.ui')
    
    227 227
             self.add(self._ui.certificate_box)
    
    228 228
     
    
    229 229
             self.connect('key-press-event', self._on_key_press)
    
    230 230
     
    
    231
    -        self.account = account
    
    232 231
             self._clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
    
    233 232
     
    
    234 233
             cert = convert_gio_to_openssl_cert(cert)
    
    ... ... @@ -236,11 +235,15 @@ class CertificateDialog(Gtk.ApplicationWindow):
    236 235
             issuer = cert.get_issuer()
    
    237 236
             subject = cert.get_subject()
    
    238 237
     
    
    239
    -        self._headline = _('Certificate for account\n%s') % account
    
    238
    +        self._headline = _('Certificate for \n%s') % self.account
    
    240 239
             self._it_common_name = subject.commonName or ''
    
    241 240
             self._it_organization = subject.organizationName or ''
    
    242 241
             self._it_org_unit = subject.organizationalUnitName or ''
    
    243
    -        self._it_serial_number = str(cert.get_serial_number())
    
    242
    +        it_serial_no = str(cert.get_serial_number())
    
    243
    +        it_serial_no_half = int(len(it_serial_no) / 2)
    
    244
    +        self._it_serial_number = '%s\n%s' % (
    
    245
    +            it_serial_no[:it_serial_no_half],
    
    246
    +            it_serial_no[it_serial_no_half:])
    
    244 247
             self._ib_common_name = issuer.commonName or ''
    
    245 248
             self._ib_organization = issuer.organizationName or ''
    
    246 249
             self._ib_org_unit = issuer.organizationalUnitName or ''
    
    ... ... @@ -250,8 +253,11 @@ class CertificateDialog(Gtk.ApplicationWindow):
    250 253
             expires = datetime.strptime(cert.get_notAfter().decode('ascii'),
    
    251 254
                                         '%Y%m%d%H%M%SZ')
    
    252 255
             self._expires = expires.strftime('%c %Z')
    
    253
    -        self._sha1 = cert.digest('sha1').decode('utf-8')
    
    254
    -        self._sha256 = cert.digest('sha256').decode('utf-8')
    
    256
    +        sha1 = cert.digest('sha1').decode('utf-8')
    
    257
    +        self._sha1 = '%s\n%s' % (sha1[:29], sha1[30:])
    
    258
    +        sha256 = cert.digest('sha256').decode('utf-8')
    
    259
    +        self._sha256 = '%s\n%s\n%s\n%s' % (
    
    260
    +            sha256[:23], sha256[24:47], sha256[48:71], sha256[72:])
    
    255 261
     
    
    256 262
             # Set labels
    
    257 263
             self._ui.label_cert_for_account.set_text(self._headline)