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

Commits:

3 changed files:

Changes:

  • data/gui/roster_window.ui
    ... ... @@ -3,7 +3,7 @@
    3 3
     <interface>
    
    4 4
       <requires lib="gtk+" version="3.12"/>
    
    5 5
       <object class="GtkAccelGroup" id="accelgroup1"/>
    
    6
    -  <object class="GtkWindow" id="roster_window">
    
    6
    +  <object class="GtkApplicationWindow" id="roster_window">
    
    7 7
         <property name="width_request">85</property>
    
    8 8
         <property name="height_request">200</property>
    
    9 9
         <property name="can_focus">False</property>
    

  • src/dialogs.py
    ... ... @@ -1283,32 +1283,32 @@ class AddNewContactWindow:
    1283 1283
                 if obj.prompt:
    
    1284 1284
                     self.gateway_prompt[obj.jid]['prompt'] = obj.prompt
    
    1285 1285
     
    
    1286
    -class AboutDialog:
    
    1286
    +class AboutDialog(Gtk.AboutDialog):
    
    1287 1287
         """
    
    1288 1288
         Class for about dialog
    
    1289 1289
         """
    
    1290 1290
     
    
    1291 1291
         def __init__(self):
    
    1292
    -        dlg = Gtk.AboutDialog()
    
    1293
    -        dlg.set_transient_for(gajim.interface.roster.window)
    
    1294
    -        dlg.set_name('Gajim')
    
    1295
    -        dlg.set_version(gajim.version)
    
    1292
    +        Gtk.AboutDialog.__init__(self)
    
    1293
    +        self.set_transient_for(gajim.interface.roster.window)
    
    1294
    +        self.set_name('Gajim')
    
    1295
    +        self.set_version(gajim.version)
    
    1296 1296
             s = 'Copyright © 2003-2014 Gajim Team'
    
    1297
    -        dlg.set_copyright(s)
    
    1297
    +        self.set_copyright(s)
    
    1298 1298
             copying_file_path = self.get_path('COPYING')
    
    1299 1299
             if copying_file_path:
    
    1300 1300
                 with open(copying_file_path) as a_file:
    
    1301 1301
                     text = a_file.read()
    
    1302
    -            dlg.set_license(text)
    
    1302
    +            self.set_license(text)
    
    1303 1303
     
    
    1304 1304
             gtk_ver = '%i.%i.%i' % (Gtk.get_major_version(),
    
    1305 1305
                 Gtk.get_minor_version(), Gtk.get_micro_version())
    
    1306 1306
             gobject_ver = self.tuple2str(GObject.pygobject_version)
    
    1307 1307
             nbxmpp_ver = nbxmpp.__version__
    
    1308
    -        dlg.set_comments('%s\n%s %s\n%s %s\n%s %s' % (_('A GTK+ Jabber/XMPP client'),
    
    1308
    +        self.set_comments('%s\n%s %s\n%s %s\n%s %s' % (_('A GTK+ Jabber/XMPP client'),
    
    1309 1309
                 _('GTK+ Version:'), gtk_ver, _('PyGobject Version:'), gobject_ver,
    
    1310 1310
                 _('python-nbxmpp Version:'), nbxmpp_ver))
    
    1311
    -        dlg.set_website('http://gajim.org/')
    
    1311
    +        self.set_website('https://gajim.org/')
    
    1312 1312
     
    
    1313 1313
             authors_file_path = self.get_path('AUTHORS')
    
    1314 1314
             if authors_file_path:
    
    ... ... @@ -1336,25 +1336,25 @@ class AboutDialog:
    1336 1336
                         'thank all the package maintainers.')
    
    1337 1337
                     authors.append(text)
    
    1338 1338
     
    
    1339
    -            dlg.set_authors(authors)
    
    1339
    +            self.set_authors(authors)
    
    1340 1340
     
    
    1341
    -        dlg.props.wrap_license = True
    
    1341
    +        self.props.wrap_license = True
    
    1342 1342
     
    
    1343 1343
             pixbuf = gtkgui_helpers.get_icon_pixmap('gajim', 128)
    
    1344 1344
     
    
    1345
    -        dlg.set_logo(pixbuf)
    
    1345
    +        self.set_logo(pixbuf)
    
    1346 1346
             #here you write your name in the form Name FamilyName <someone@somewhere>
    
    1347
    -        dlg.set_translator_credits(_('translator-credits'))
    
    1347
    +        self.set_translator_credits(_('translator-credits'))
    
    1348 1348
     
    
    1349 1349
             thanks_artists_file_path = self.get_path('THANKS.artists')
    
    1350 1350
             if thanks_artists_file_path:
    
    1351 1351
                 with open(thanks_artists_file_path) as a_file:
    
    1352 1352
                     artists_text = a_file.read()
    
    1353 1353
                 artists = artists_text.split('\n')
    
    1354
    -            dlg.set_artists(artists)
    
    1354
    +            self.set_artists(artists)
    
    1355 1355
     
    
    1356
    -        dlg.connect('response', self.on_response)
    
    1357
    -        dlg.show_all()
    
    1356
    +        self.connect('response', self.on_response)
    
    1357
    +        self.show_all()
    
    1358 1358
     
    
    1359 1359
         def on_response(self, dialog, response_id):
    
    1360 1360
             if response_id == Gtk.ResponseType.DELETE_EVENT:
    

  • src/roster_window.py
    ... ... @@ -94,7 +94,7 @@ empty_pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 1, 1)
    94 94
     empty_pixbuf.fill(0xffffff00)
    
    95 95
     
    
    96 96
     
    
    97
    -class RosterWindow(Gtk.ApplicationWindow):
    
    97
    +class RosterWindow:
    
    98 98
         """
    
    99 99
         Class for main window of the GTK+ interface
    
    100 100
         """
    
    ... ... @@ -6178,7 +6178,7 @@ class RosterWindow(Gtk.ApplicationWindow):
    6178 6178
     ###
    
    6179 6179
     ################################################################################
    
    6180 6180
     
    
    6181
    -    def __init__(self, app):
    
    6181
    +    def __init__(self, app: Gtk.Application):
    
    6182 6182
             self.application = app
    
    6183 6183
             self.filtering = False
    
    6184 6184
             self.starting = False
    
    ... ... @@ -6195,8 +6195,8 @@ class RosterWindow(Gtk.ApplicationWindow):
    6195 6195
                 GdkPixbuf.Pixbuf, GdkPixbuf.Pixbuf]
    
    6196 6196
             self.xml = gtkgui_helpers.get_gtk_builder('roster_window.ui')
    
    6197 6197
             self.window = self.xml.get_object('roster_window')
    
    6198
    +        app.add_window(self.window)
    
    6198 6199
             self.hpaned = self.xml.get_object('roster_hpaned')
    
    6199
    -        self.window.set_application(app)
    
    6200 6200
             gajim.interface.msg_win_mgr = MessageWindowMgr(self.window, self.hpaned)
    
    6201 6201
             gajim.interface.msg_win_mgr.connect('window-delete',
    
    6202 6202
                 self.on_message_window_delete)