summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-02-16 10:09:54 +0100
committerraveit65 <[email protected]>2020-02-27 11:59:49 +0100
commit770aff7cfae9822209e6bf45071c7473e628f7dd (patch)
treee79d1e7a0527aa79a483f3fc8a55f289837a804c
parent919f39972c45a501606680fb6f6c1fe5a6b8a27c (diff)
downloadmate-power-manager-770aff7cfae9822209e6bf45071c7473e628f7dd.tar.bz2
mate-power-manager-770aff7cfae9822209e6bf45071c7473e628f7dd.tar.xz
Read authors (updated) from mate-power-manager.about
-rw-r--r--data/Makefile.am4
-rw-r--r--data/mate-power-manager.about2
-rw-r--r--data/org.mate.power-manager.manager.gresource.xml22
-rw-r--r--src/Makefile.am10
-rw-r--r--src/gpm-tray-icon.c36
-rwxr-xr-xupdate-authors.pl78
6 files changed, 144 insertions, 8 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index 7225949..03f40f2 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -41,10 +41,12 @@ EXTRA_DIST = \
$(gsettings_schemas_in_files) \
$(pkgdata_DATA) \
$(man_MANS) \
+ org.mate.power-manager.manager.gresource.xml \
org.mate.power-manager.preferences.gresource.xml \
org.mate.power-manager.statistics.gresource.xml \
gpm-prefs.ui \
- gpm-statistics.ui
+ gpm-statistics.ui \
+ mate-power-manager.about
clean-local :
rm -f *~
diff --git a/data/mate-power-manager.about b/data/mate-power-manager.about
new file mode 100644
index 0000000..a04843c
--- /dev/null
+++ b/data/mate-power-manager.about
@@ -0,0 +1,2 @@
+[About]
+Authors=Antoine Jacoutot <ajacoutot%openbsd.org>;Anton V. Boyarshinov <boyarsh%altlinux.org>;Brent Hull <bhull2010%live.com>;Clement Lefebvre <clement.lefebvre%linuxmint.com>;Colomban Wendling <cwendling%hypra.fr>;Dan Mashal <dan.mashal%fedoraproject.org>;Denis Gorodnichev <denis.gorodnichev%gmail.com>;Edward Betts <edward%4angle.com>;Elan Ruusamäe <glen%delfi.ee>;Fabio Erculiani <lxnay%sabayon.org>;György Balló <ballogyor%gmail.com>;Jack Steele <jacks4899%gmail.com>;Laine Walker-Avina <lwalkera%ieee.org>;Laurent Napias <tamplan%free.fr>;Marcel Dijkstra <marcel.dykstra%gmail.com>;Martin Wimpress <martin%mate-desktop.org>;Matt Spaulding <mspaulding06%gmail.com>;Matthew Pottage <matthewpottage%invincitech.com>;Mike Gabriel <mike.gabriel%das-netzwerkteam.de>;Mikhail Shevtsov <mesouug%gmail.com>;Nelson Marques <nmo.marques%gmail.com>;Nutchanon Wetchasit https://github.com/nachanon;Pablo Barciela <scow%riseup.net>;Pedro Martinez-Julia <pedromj%um.es>;Piotr Drąg <piotrdrag%gmail.com>;Robert Buj <robert.buj%gmail.com>;Robert Nagy <robert%openbsd.org>;Roy Zhang <pudh4418%gmail.com>;Sander Sweers <infirit%gmail.com>;Sorokin Alexei <sor.alexei%meowr.ru>;Stefan Seyfried <seife+dev%b1-systems.com>;Stefano Karapetsas <stefano%karapetsas.com>;Stephen Kent <smkent%smkent.net>;Steve Zesch <stevezesch2%gmail.com>;Victor Kareh <vkareh%redhat.com>;Vlad Orlov <monsta%inbox.ru>;William Brown <william%firstyear.id.au>;Wolfgang Ulbrich <mate%raveit.de>;Wu Xiaotian <yetist%gmail.com>;Yaakov Selkowitz <yselkowitz%users.sourceforge.net>;Zhang Xianwei <zhang.xianwei8%zte.com.cn>;fhucho <fhucho%gmail.com>;lukefromdc <lukefromdc%hushmail.com>;
diff --git a/data/org.mate.power-manager.manager.gresource.xml b/data/org.mate.power-manager.manager.gresource.xml
new file mode 100644
index 0000000..d880c9b
--- /dev/null
+++ b/data/org.mate.power-manager.manager.gresource.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This file is part of MATE Power Manager.
+
+ MATE Power Manager is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ MATE Power Manager is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with MATE Power Manager. If not, see <http://www.gnu.org/licenses/>.
+-->
+<gresources>
+ <gresource prefix="/org/mate/powermanager/manager/">
+ <file compressed="true">mate-power-manager.about</file>
+ </gresource>
+</gresources>
diff --git a/src/Makefile.am b/src/Makefile.am
index aed9cc9..1778cef 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -151,6 +151,14 @@ mate_power_preferences_CFLAGS = \
$(WARN_CFLAGS) \
$(NULL)
+mate-power-manager-resources.h mate-power-manager-resources.c: $(srcdir)/../data/org.mate.power-manager.manager.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir)/../data $(srcdir)/../data/org.mate.power-manager.manager.gresource.xml)
+ $(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir)/../data --generate --c-name preferences $<
+
+nodist_mate_power_manager_SOURCES = \
+ mate-power-manager-resources.h \
+ mate-power-manager-resources.c \
+ $(NULL)
+
mate_power_manager_SOURCES = \
gpm-dpms.h \
gpm-dpms.c \
@@ -316,6 +324,8 @@ clean-local:
CLEANFILES = \
$(BUILT_SOURCES) \
+ mate-power-manager-resources.h \
+ mate-power-manager-resources.c \
mate-power-preferences-resources.h \
mate-power-preferences-resources.c \
mate-power-statistics-resources.h \
diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c
index f87506f..56e87b4 100644
--- a/src/gpm-tray-icon.c
+++ b/src/gpm-tray-icon.c
@@ -165,6 +165,9 @@ gpm_tray_icon_show_preferences_cb (GtkMenuItem *item, gpointer data)
egg_warning ("Couldn't execute command: %s", command);
}
+#define ABOUT_GROUP "About"
+#define EMAILIFY(string) (g_strdelimit ((string), "%", '@'))
+
/**
* gpm_tray_icon_show_about_cb:
* @action: A valid GtkAction
@@ -172,13 +175,30 @@ gpm_tray_icon_show_preferences_cb (GtkMenuItem *item, gpointer data)
static void
gpm_tray_icon_show_about_cb (GtkMenuItem *item, gpointer data)
{
- const gchar *authors[] =
- {
- "Perberos",
- "Steve Zesch",
- "Stefano Karapetsas",
- NULL
- };
+ GKeyFile *key_file;
+ GBytes *bytes;
+ const guint8 *data_resource;
+ gsize data_resource_len;
+ GError *error = NULL;
+ char **authors;
+ gsize n_authors = 0, i;
+
+ bytes = g_resources_lookup_data ("/org/mate/powermanager/manager/mate-power-manager.about",
+ G_RESOURCE_LOOKUP_FLAGS_NONE, &error);
+ g_assert_no_error (error);
+
+ data_resource = g_bytes_get_data (bytes, &data_resource_len);
+ key_file = g_key_file_new ();
+ g_key_file_load_from_data (key_file, (const char *) data_resource, data_resource_len, 0, &error);
+ g_assert_no_error (error);
+
+ authors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Authors", &n_authors, NULL);
+
+ g_key_file_free (key_file);
+ g_bytes_unref (bytes);
+
+ for (i = 0; i < n_authors; ++i)
+ authors[i] = EMAILIFY (authors[i]);
gtk_show_about_dialog (NULL,
"program-name", _("Power Manager"),
@@ -195,6 +215,8 @@ gpm_tray_icon_show_about_cb (GtkMenuItem *item, gpointer data)
"logo-icon-name", "mate-power-manager",
"website", "https://mate-desktop.org",
NULL);
+
+ g_strfreev (authors);
}
/**
diff --git a/update-authors.pl b/update-authors.pl
new file mode 100755
index 0000000..3fb9a9d
--- /dev/null
+++ b/update-authors.pl
@@ -0,0 +1,78 @@
+#!/usr/bin/perl
+=pod
+
+ update-authors.pl is part of MATE Power Manager.
+
+ MATE Power Manager is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ MATE Power Manager is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with MATE Power Manager. If not, see <http://www.gnu.org/licenses/>.
+
+=cut
+use strict;
+use warnings;
+
+sub ReplaceAuthors {
+ my @authors = @_;
+ $_ eq 'Alexander <sanek23994%gmail.com>' and $_ = 'Alexander Ovchinnikov <sanek23994%gmail.com>' for @authors;
+ $_ eq 'bl0ckeduser <bl0ckedusersoft%gmail.com>' and $_ = 'Gabriel Cormier-Affleck <bl0ckedusersoft%gmail.com>' for @authors;
+ $_ eq 'Glorf <michal1.bien%gmail.com>' and $_ = 'Michał Bień <michal1.bien%gmail.com>' for @authors;
+ $_ eq 'hekel <hekel%archlinux.info>' and $_ = 'Adam Erdman <hekel%archlinux.info>' for @authors;
+ $_ eq 'infirit <infirit%gmail.com>' and $_ = 'Sander Sweers <infirit%gmail.com>' for @authors;
+ $_ eq 'Jason Crain <jason%inspiresomeone.us>' and $_ = 'Jason Crain <jason%aquaticape.us>' for @authors;
+ $_ eq 'José Aliste <jaliste%src.gnome.org>' and $_ = 'José Aliste <jaliste%gnome.org>' for @authors;
+ $_ eq 'leigh123linux <leigh123linux%googlemail.com>' and $_ = 'Leigh Scott <leigh123linux%googlemail.com>' for @authors;
+ $_ eq 'lyokha <alexey.radkov%gmail.com>' and $_ = 'Alexey Radkov <alexey.radkov%gmail.com>' for @authors;
+ $_ eq 'Martin Wimpress <code%flexion.org>' and $_ = 'Martin Wimpress <martin%mate-desktop.org>' for @authors;
+ $_ eq 'monsta <monsta%inbox.ru>' and $_ = 'Vlad Orlov <monsta%inbox.ru>' for @authors;
+ $_ eq 'Monsta <monsta%inbox.ru>' and $_ = 'Vlad Orlov <monsta%inbox.ru>' for @authors;
+ $_ eq 'Nachanon Vetjasit <nachanon%users.noreply.github.com>' and $_ = 'Nutchanon Wetchasit <nachanon%users.noreply.github.com>' for @authors;
+ $_ eq 'oz123 <nahumoz%gmail.com>' and $_ = 'Oz N Tiram <nahumoz%gmail.com>' for @authors;
+ $_ eq 'Piiit <pitiz29a%gmail.com>' and $_ = 'Peter Moser <pitiz29a%gmail.com>' for @authors;
+ $_ eq 'rootavish <avishkar_gupta%outlook.com>' and $_ = 'Avishkar Gupta <rootavish%gmail.com>' for @authors;
+ $_ eq 'rootavish <rootavish%gmail.com>' and $_ = 'Avishkar Gupta <rootavish%gmail.com>' for @authors;
+ $_ eq 'raveit <chat-to-me%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors;
+ $_ eq 'raveit65 <chat-to-me%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors;
+ $_ eq 'raveit65 <mate%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors;
+ $_ eq 'rbuj <robert.buj%gmail.com>' and $_ = 'Robert Buj <robert.buj%gmail.com>' for @authors;
+ $_ eq 'Scott Balneaves <sbalneav%ltsp.org>' and $_ = 'Scott Balneaves <sbalneav%mate-desktop.org>' for @authors;
+ $_ eq 'Victor Kareh <vkareh%vkareh.net>'and $_ = 'Victor Kareh <vkareh%redhat.com>' for @authors;
+ $_ eq 'Wolfgang Ulbrich <chat-to-me%raveit.de>' and $_ = 'Wolfgang Ulbrich <mate%raveit.de>' for @authors;
+ $_ eq 'ZenWalker <scow%riseup.net>' and $_ = 'Pablo Barciela <scow%riseup.net>' for @authors;
+ return @authors;
+}
+
+sub GetCurrentAuthors {
+ my @authors;
+ open(FILE,"data/mate-power-manager.about") or die "Can't open data/mate-power-manager.about";
+ while (<FILE>) {
+ if (/^Authors=*(.+)$/) {
+ @authors=split(";",$1);
+ }
+ }
+ close FILE;
+ return ReplaceAuthors(@authors);
+}
+
+sub GetNewAuthors {
+ my @authors = `git log --pretty="%an <%ae>" --since "2012-01-01" -- . "_.h" "_.c" | sort | uniq | sed 's/@/%/g' | sed '/^mate-i18n.*/d'`;
+ chomp @authors;
+ return ReplaceAuthors(@authors);
+}
+
+my @A = GetCurrentAuthors;
+my @B = GetNewAuthors;
+for (@B) {
+ s/<\d+\+(.+?)%users\.noreply\.github\.com>/<$1%users\.noreply\.github\.com>/;
+ s/<(.+?)%users\.noreply\.github\.com>/https:\/\/github.com\/$1/;
+}
+my @merged = sort { $a cmp $b } keys %{{map {($_ => 1)} (@A, @B)}};
+print join(';',@merged) . ';';