Philipp Hörist pushed to branch master at gajim / gajim
Commits: 2439a8b8 by Emmanuel Gil Peyrot at 2017-01-08T00:41:54+00:00 Make dialogs.AboutDialog inherit directly from GtkAboutDialog. - - - - - fd167974 by Emmanuel Gil Peyrot at 2017-01-08T00:41:54+00:00 Fix website URL (missing https:). - - - - - 553fd8f7 by Emmanuel Gil Peyrot at 2017-01-08T00:45:37+00:00 Add the actual GtkApplicationWindow to the GtkApplication. - - - - - 30f8a76b by Philipp Hörist at 2017-01-08T14:46:52+01:00 Merge branch 'gtk-application' into 'master' Misc simple GTK+ fixes. See merge request !24 - - - - - 3 changed files: - data/gui/roster_window.ui - src/dialogs.py - src/roster_window.py Changes: ===================================== data/gui/roster_window.ui ===================================== --- a/data/gui/roster_window.ui +++ b/data/gui/roster_window.ui @@ -3,7 +3,7 @@ <interface> <requires lib="gtk+" version="3.12"/> <object class="GtkAccelGroup" id="accelgroup1"/> - <object class="GtkWindow" id="roster_window"> + <object class="GtkApplicationWindow" id="roster_window"> <property name="width_request">85</property> <property name="height_request">200</property> <property name="can_focus">False</property> ===================================== src/dialogs.py ===================================== --- a/src/dialogs.py +++ b/src/dialogs.py @@ -1283,32 +1283,32 @@ class AddNewContactWindow: if obj.prompt: self.gateway_prompt[obj.jid]['prompt'] = obj.prompt -class AboutDialog: +class AboutDialog(Gtk.AboutDialog): """ Class for about dialog """ def __init__(self): - dlg = Gtk.AboutDialog() - dlg.set_transient_for(gajim.interface.roster.window) - dlg.set_name('Gajim') - dlg.set_version(gajim.version) + Gtk.AboutDialog.__init__(self) + self.set_transient_for(gajim.interface.roster.window) + self.set_name('Gajim') + self.set_version(gajim.version) s = 'Copyright © 2003-2014 Gajim Team' - dlg.set_copyright(s) + self.set_copyright(s) copying_file_path = self.get_path('COPYING') if copying_file_path: with open(copying_file_path) as a_file: text = a_file.read() - dlg.set_license(text) + self.set_license(text) gtk_ver = '%i.%i.%i' % (Gtk.get_major_version(), Gtk.get_minor_version(), Gtk.get_micro_version()) gobject_ver = self.tuple2str(GObject.pygobject_version) nbxmpp_ver = nbxmpp.__version__ - dlg.set_comments('%s\n%s %s\n%s %s\n%s %s' % (_('A GTK+ Jabber/XMPP client'), + self.set_comments('%s\n%s %s\n%s %s\n%s %s' % (_('A GTK+ Jabber/XMPP client'), _('GTK+ Version:'), gtk_ver, _('PyGobject Version:'), gobject_ver, _('python-nbxmpp Version:'), nbxmpp_ver)) - dlg.set_website('http://gajim.org/') + self.set_website('https://gajim.org/') authors_file_path = self.get_path('AUTHORS') if authors_file_path: @@ -1336,25 +1336,25 @@ class AboutDialog: 'thank all the package maintainers.') authors.append(text) - dlg.set_authors(authors) + self.set_authors(authors) - dlg.props.wrap_license = True + self.props.wrap_license = True pixbuf = gtkgui_helpers.get_icon_pixmap('gajim', 128) - dlg.set_logo(pixbuf) + self.set_logo(pixbuf) #here you write your name in the form Name FamilyName <someone@somewhere> - dlg.set_translator_credits(_('translator-credits')) + self.set_translator_credits(_('translator-credits')) thanks_artists_file_path = self.get_path('THANKS.artists') if thanks_artists_file_path: with open(thanks_artists_file_path) as a_file: artists_text = a_file.read() artists = artists_text.split('\n') - dlg.set_artists(artists) + self.set_artists(artists) - dlg.connect('response', self.on_response) - dlg.show_all() + self.connect('response', self.on_response) + self.show_all() def on_response(self, dialog, response_id): if response_id == Gtk.ResponseType.DELETE_EVENT: ===================================== src/roster_window.py ===================================== --- a/src/roster_window.py +++ b/src/roster_window.py @@ -94,7 +94,7 @@ empty_pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 1, 1) empty_pixbuf.fill(0xffffff00) -class RosterWindow(Gtk.ApplicationWindow): +class RosterWindow: """ Class for main window of the GTK+ interface """ @@ -6178,7 +6178,7 @@ class RosterWindow(Gtk.ApplicationWindow): ### ################################################################################ - def __init__(self, app): + def __init__(self, app: Gtk.Application): self.application = app self.filtering = False self.starting = False @@ -6195,8 +6195,8 @@ class RosterWindow(Gtk.ApplicationWindow): GdkPixbuf.Pixbuf, GdkPixbuf.Pixbuf] self.xml = gtkgui_helpers.get_gtk_builder('roster_window.ui') self.window = self.xml.get_object('roster_window') + app.add_window(self.window) self.hpaned = self.xml.get_object('roster_hpaned') - self.window.set_application(app) gajim.interface.msg_win_mgr = MessageWindowMgr(self.window, self.hpaned) gajim.interface.msg_win_mgr.connect('window-delete', self.on_message_window_delete) View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/f8a314b5f242f9201c1b7c0fc0f6c26490f90654...30f8a76b4d2272daef42d3545bba5aa16c13708f
_______________________________________________ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits