Add translation and donation links to AboutDialog

webkit2png
somas95 2018-07-02 01:02:41 +02:00
parent 52def543fe
commit 9e4be3e0c5
2 changed files with 144 additions and 10 deletions

139
data/ui/About.ui 100644
View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkAboutDialog" id="AboutDialog">
<property name="can_focus">False</property>
<property name="modal">True</property>
<property name="window_position">center</property>
<property name="type_hint">dialog</property>
<property name="program_name">Uberwriter</property>
<property name="version">2.0.3</property>
<property name="copyright" translatable="yes">Copyright (C) 2018, Wolf Vollprecht</property>
<property name="website">http://uberwriter.github.io/uberwriter</property>
<property name="website_label" translatable="yes">Uberwriter website</property>
<property name="authors">Wolf Vollprecht &lt;w.vollprecht@gmail.com&gt;
Manuel Genovés &lt;manuel.genoves@gmail.com&gt;</property>
<property name="logo_icon_name">image-missing</property>
<property name="license_type">gpl-3-0</property>
<child type="titlebar">
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="About_main">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="About_buttons">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="About_links">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkGrid" id="About_links_donations">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="column_homogeneous">True</property>
<child>
<object class="GtkLabel" id="donations_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Donations:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="donations_link">
<property name="label" translatable="yes">Liberapay</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">start</property>
<property name="relief">none</property>
<property name="uri">https://liberapay.com/UberWriter/donate</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="About_links_translations">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="column_homogeneous">True</property>
<child>
<object class="GtkLabel" id="translations_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Help to translate:</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLinkButton" id="translations_link">
<property name="label" translatable="yes">Poeditor</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">start</property>
<property name="relief">none</property>
<property name="uri">https://poeditor.com/join/project/gxVzFyXb2x</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

View File

@ -172,7 +172,7 @@ class Application(Gtk.Application):
action.connect("change-state", self.on_spellcheck)
self.add_action(action)
'''Left Menu Actions'''
'''Menu Actions'''
action = Gio.SimpleAction.new("new", None)
action.connect("activate", self.on_new)
@ -260,15 +260,10 @@ class Application(Gtk.Application):
def on_about(self, action, param):
about_dialog = Gtk.AboutDialog(transient_for=self.window, modal=True)
about_dialog.set_program_name("Uberwriter")
about_dialog.set_version("2.0.3")
about_dialog.set_copyright("Copyright (C) 2018, Wolf Vollprecht")
about_dialog.set_license_type(Gtk.License.GPL_3_0)
about_dialog.set_website("Uberwriter website http://uberwriter.github.io/uberwriter")
about_dialog.set_authors(["Wolf Vollprecht <w.vollprecht@gmail.com>",
"Manuel Genovés <manuel.genoves@gmail.com>"])
builder = get_builder('About')
about_dialog = builder.get_object("AboutDialog")
about_dialog.set_transient_for(self.window)
logo_file = get_media_path("uberwriter.svg")
logo = GdkPixbuf.Pixbuf.new_from_file(logo_file)