🎉 Add link to sponsors list to the main menu

This commit is contained in:
Simon Schneegans
2023-09-21 19:28:55 +02:00
parent 80ca2b9af0
commit 278c89981b
4 changed files with 27 additions and 127 deletions
+3 -29
View File
@@ -433,6 +433,7 @@ GitHub: <a href='https://github.com/sponsors/schneegans'>https://github.com/spon
addURIAction('donate-kofi', 'https://ko-fi.com/schneegans');
addURIAction('donate-github', 'https://github.com/sponsors/Schneegans');
addURIAction('donate-paypal', 'https://www.paypal.me/simonschneegans');
addURIAction('show-sponsors', 'https://schneegans.github.io/sponsors');
addURIAction('wallpapers', 'https://github.com/Schneegans/ai-wallpapers');
addURIAction('profile-dir', `file://${GLib.get_user_config_dir()}/burn-my-windows/profiles`);
// clang-format on
@@ -464,41 +465,14 @@ GitHub: <a href='https://github.com/sponsors/schneegans'>https://github.com/spon
}
});
const sponsors = this._getJSONResource('/credits/sponsors.json');
let dialog;
let formatSponsors = (sponsors) => {
return sponsors.map(s => {
if (s.url == '')
return s.name;
else
return `${s.name} ${s.url}`;
});
};
dialog = new Adw.AboutWindow({transient_for: window, modal: true});
const dialog = new Adw.AboutWindow({transient_for: window, modal: true});
dialog.set_application_icon('burn-my-windows-symbolic');
dialog.set_application_name('Burn-My-Windows');
dialog.set_version(`${this.metadata.version}`);
dialog.set_developer_name('Simon Schneegans');
dialog.set_issue_url('https://github.com/Schneegans/Burn-My-Windows/issues');
if (sponsors.gold.length > 0) {
dialog.add_credit_section(_('Gold Sponsors'), formatSponsors(sponsors.gold));
}
if (sponsors.silver.length > 0) {
dialog.add_credit_section(_('Silver Sponsors'),
formatSponsors(sponsors.silver));
}
if (sponsors.bronze.length > 0) {
dialog.add_credit_section(_('Bronze Sponsors'),
formatSponsors(sponsors.bronze));
}
if (sponsors.past.length > 0) {
dialog.add_credit_section(_('Past Sponsors'), formatSponsors(sponsors.past));
}
dialog.set_translator_credits([...translators].join('\n'));
dialog.set_copyright('© 2022 Simon Schneegans');
dialog.set_copyright('© 2023 Simon Schneegans');
dialog.set_website('https://github.com/Schneegans/Burn-My-Windows');
dialog.set_license_type(Gtk.License.GPL_3_0);