From 2439a8b807c5c8ef481c2f8911864b337700b538 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 7 Jan 2017 13:24:34 +0000 Subject: [PATCH 1/3] Make dialogs.AboutDialog inherit directly from GtkAboutDialog. --- src/dialogs.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index c358cc12a..8ea85b504 100644 --- 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('http://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 - 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: From fd167974211221b9d68c6aae94cb4db5d8eb8765 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 7 Jan 2017 13:26:30 +0000 Subject: [PATCH 2/3] Fix website URL (missing https:). --- src/dialogs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dialogs.py b/src/dialogs.py index 8ea85b504..494e1bb99 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -1308,7 +1308,7 @@ class AboutDialog(Gtk.AboutDialog): 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)) - self.set_website('http://gajim.org/') + self.set_website('https://gajim.org/') authors_file_path = self.get_path('AUTHORS') if authors_file_path: From 553fd8f7b18f17d4f229561e08a3740224eb2e0b Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 7 Jan 2017 13:14:43 +0000 Subject: [PATCH 3/3] Add the actual GtkApplicationWindow to the GtkApplication. --- data/gui/roster_window.ui | 2 +- src/roster_window.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/gui/roster_window.ui b/data/gui/roster_window.ui index f7bd24a56..747720e5c 100644 --- a/data/gui/roster_window.ui +++ b/data/gui/roster_window.ui @@ -3,7 +3,7 @@ - + 85 200 False diff --git a/src/roster_window.py b/src/roster_window.py index 4ca0a644e..b169e0073 100644 --- 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)