Commit 30f8a76b authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Merge branch 'gtk-application' into 'master'

Misc simple GTK+ fixes.

See merge request !24
parents f8a314b5 553fd8f7
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<object class="GtkAccelGroup" id="accelgroup1"/> <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="width_request">85</property>
<property name="height_request">200</property> <property name="height_request">200</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
......
...@@ -1283,32 +1283,32 @@ class AddNewContactWindow: ...@@ -1283,32 +1283,32 @@ class AddNewContactWindow:
if obj.prompt: if obj.prompt:
self.gateway_prompt[obj.jid]['prompt'] = obj.prompt self.gateway_prompt[obj.jid]['prompt'] = obj.prompt
class AboutDialog: class AboutDialog(Gtk.AboutDialog):
""" """
Class for about dialog Class for about dialog
""" """
def __init__(self): def __init__(self):
dlg = Gtk.AboutDialog() Gtk.AboutDialog.__init__(self)
dlg.set_transient_for(gajim.interface.roster.window) self.set_transient_for(gajim.interface.roster.window)
dlg.set_name('Gajim') self.set_name('Gajim')
dlg.set_version(gajim.version) self.set_version(gajim.version)
s = 'Copyright © 2003-2014 Gajim Team' s = 'Copyright © 2003-2014 Gajim Team'
dlg.set_copyright(s) self.set_copyright(s)
copying_file_path = self.get_path('COPYING') copying_file_path = self.get_path('COPYING')
if copying_file_path: if copying_file_path:
with open(copying_file_path) as a_file: with open(copying_file_path) as a_file:
text = a_file.read() text = a_file.read()
dlg.set_license(text) self.set_license(text)
gtk_ver = '%i.%i.%i' % (Gtk.get_major_version(), gtk_ver = '%i.%i.%i' % (Gtk.get_major_version(),
Gtk.get_minor_version(), Gtk.get_micro_version()) Gtk.get_minor_version(), Gtk.get_micro_version())
gobject_ver = self.tuple2str(GObject.pygobject_version) gobject_ver = self.tuple2str(GObject.pygobject_version)
nbxmpp_ver = nbxmpp.__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, _('GTK+ Version:'), gtk_ver, _('PyGobject Version:'), gobject_ver,
_('python-nbxmpp Version:'), nbxmpp_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') authors_file_path = self.get_path('AUTHORS')
if authors_file_path: if authors_file_path:
...@@ -1336,25 +1336,25 @@ class AboutDialog: ...@@ -1336,25 +1336,25 @@ class AboutDialog:
'thank all the package maintainers.') 'thank all the package maintainers.')
authors.append(text) 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) 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> #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') thanks_artists_file_path = self.get_path('THANKS.artists')
if thanks_artists_file_path: if thanks_artists_file_path:
with open(thanks_artists_file_path) as a_file: with open(thanks_artists_file_path) as a_file:
artists_text = a_file.read() artists_text = a_file.read()
artists = artists_text.split('\n') artists = artists_text.split('\n')
dlg.set_artists(artists) self.set_artists(artists)
dlg.connect('response', self.on_response) self.connect('response', self.on_response)
dlg.show_all() self.show_all()
def on_response(self, dialog, response_id): def on_response(self, dialog, response_id):
if response_id == Gtk.ResponseType.DELETE_EVENT: if response_id == Gtk.ResponseType.DELETE_EVENT:
......
...@@ -94,7 +94,7 @@ empty_pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 1, 1) ...@@ -94,7 +94,7 @@ empty_pixbuf = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 1, 1)
empty_pixbuf.fill(0xffffff00) empty_pixbuf.fill(0xffffff00)
class RosterWindow(Gtk.ApplicationWindow): class RosterWindow:
""" """
Class for main window of the GTK+ interface Class for main window of the GTK+ interface
""" """
...@@ -6178,7 +6178,7 @@ class RosterWindow(Gtk.ApplicationWindow): ...@@ -6178,7 +6178,7 @@ class RosterWindow(Gtk.ApplicationWindow):
### ###
################################################################################ ################################################################################
def __init__(self, app): def __init__(self, app: Gtk.Application):
self.application = app self.application = app
self.filtering = False self.filtering = False
self.starting = False self.starting = False
...@@ -6195,8 +6195,8 @@ class RosterWindow(Gtk.ApplicationWindow): ...@@ -6195,8 +6195,8 @@ class RosterWindow(Gtk.ApplicationWindow):
GdkPixbuf.Pixbuf, GdkPixbuf.Pixbuf] GdkPixbuf.Pixbuf, GdkPixbuf.Pixbuf]
self.xml = gtkgui_helpers.get_gtk_builder('roster_window.ui') self.xml = gtkgui_helpers.get_gtk_builder('roster_window.ui')
self.window = self.xml.get_object('roster_window') self.window = self.xml.get_object('roster_window')
app.add_window(self.window)
self.hpaned = self.xml.get_object('roster_hpaned') 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 = MessageWindowMgr(self.window, self.hpaned)
gajim.interface.msg_win_mgr.connect('window-delete', gajim.interface.msg_win_mgr.connect('window-delete',
self.on_message_window_delete) self.on_message_window_delete)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment