Ver Fonte

tools: add Help > Donate... menu item

Daniele Bartolini há 2 anos atrás
pai
commit
bcee4b9592

+ 10 - 0
tools/level_editor/level_editor.vala

@@ -410,6 +410,7 @@ public class LevelEditorApplication : Gtk.Application
 		{ "report-issue", on_report_issue, null, null },
 		{ "browse-logs",  on_browse_logs,  null, null },
 		{ "changelog",    on_changelog,    null, null },
+		{ "donate",       on_donate,       null, null },
 		{ "about",        on_about,        null, null }
 	};
 
@@ -2401,6 +2402,15 @@ public class LevelEditorApplication : Gtk.Application
 		}
 	}
 
+	private void on_donate(GLib.SimpleAction action, GLib.Variant? param)
+	{
+		try {
+			AppInfo.launch_default_for_uri("https://crownengine.org/fund", null);
+		} catch (Error e) {
+			loge(e.message);
+		}
+	}
+
 	private void on_about(GLib.SimpleAction action, GLib.Variant? param)
 	{
 		Gtk.AboutDialog dlg = new Gtk.AboutDialog();

+ 4 - 0
tools/level_editor/resources/gtk/menus.ui

@@ -458,6 +458,10 @@
           <attribute name="label" translatable="yes">Changelog...</attribute>
           <attribute name="action">app.changelog</attribute>
         </item>
+        <item>
+          <attribute name="label" translatable="yes">Donate...</attribute>
+          <attribute name="action">app.donate</attribute>
+        </item>
         <item>
           <attribute name="label" translatable="yes">About</attribute>
           <attribute name="action">app.about</attribute>