summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-02-18 15:08:21 +0100
committerraveit65 <[email protected]>2019-02-18 17:49:36 +0100
commita56d506ff56f79bbea0bbaf8861dc48d7cf77f79 (patch)
tree9584ea270449e53c86acf1357d0dda77f8f7bada
parente27a451893ce6f772feb284fbb0d740fe23c003e (diff)
downloadpluma-a56d506ff56f79bbea0bbaf8861dc48d7cf77f79.tar.bz2
pluma-a56d506ff56f79bbea0bbaf8861dc48d7cf77f79.tar.xz
Read authors (updated) from pluma.about file
-rw-r--r--pluma/Makefile.am7
-rw-r--r--pluma/pluma-commands-help.c36
-rw-r--r--pluma/pluma-dirs.c2
-rw-r--r--pluma/pluma.about2
4 files changed, 33 insertions, 14 deletions
diff --git a/pluma/Makefile.am b/pluma/Makefile.am
index 63b91b8e..3baa21a0 100644
--- a/pluma/Makefile.am
+++ b/pluma/Makefile.am
@@ -13,6 +13,7 @@ AM_CPPFLAGS = \
$(WARN_CFLAGS) \
$(INTROSPECTION_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
+ -DPLUMA_DATADIR=\""$(datadir)/pluma"\" \
-DLIBDIR=\""$(libdir)"\"
pluma_SOURCES = \
@@ -172,6 +173,11 @@ pluma-marshal.c: pluma-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) echo "#include \"pluma-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=pluma_marshal >> $@
+aboutdir = $(datadir)/pluma/
+about_DATA = \
+ pluma.about \
+ $(NULL)
+
uidir = $(datadir)/pluma/ui/
ui_DATA = \
pluma-ui.xml \
@@ -179,6 +185,7 @@ ui_DATA = \
EXTRA_DIST = \
$(ui_DATA) \
+ $(about_DATA) \
pluma-enum-types.h.template \
pluma-enum-types.c.template \
pluma-marshal.list \
diff --git a/pluma/pluma-commands-help.c b/pluma/pluma-commands-help.c
index a04a5daa..93205704 100644
--- a/pluma/pluma-commands-help.c
+++ b/pluma/pluma-commands-help.c
@@ -35,6 +35,7 @@
#include <config.h>
#endif
+#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
@@ -50,21 +51,11 @@ void _pluma_cmd_help_contents(GtkAction* action, PlumaWindow* window)
pluma_help_display(GTK_WINDOW(window), NULL, NULL);
}
+#define ABOUT_GROUP "About"
+#define EMAILIFY(string) (g_strdelimit ((string), "%", '@'))
+
void _pluma_cmd_help_about(GtkAction* action, PlumaWindow* window)
{
- static const gchar* const authors[] = {
- "Paolo Maggi <[email protected]>",
- "Paolo Borelli <[email protected]>",
- "Steve Fr\303\251cinaux <[email protected]>",
- "Jesse van den Kieboom <[email protected]>",
- "Ignacio Casal Quinteiro <[email protected]>",
- "James Willcox <[email protected]>",
- "Chema Celorio",
- "Federico Mena Quintero <[email protected]>",
- "Perberos <[email protected]>",
- NULL
- };
-
static const gchar* documenters[] = {
N_("MATE Documentation Team"),
N_("GNOME Documentation Team"),
@@ -90,10 +81,28 @@ void _pluma_cmd_help_about(GtkAction* action, PlumaWindow* window)
};
gchar *license_trans;
+ GKeyFile *key_file;
+ GError *error = NULL;
+ char **authors;
+ gsize n_authors = 0, i;
static const gchar **p;
pluma_debug (DEBUG_COMMANDS);
+ key_file = g_key_file_new ();
+ if (!g_key_file_load_from_file (key_file, PLUMA_DATADIR G_DIR_SEPARATOR_S "pluma.about", 0, &error)) {
+ g_warning ("Couldn't load about data: %s\n", error->message);
+ g_error_free (error);
+ g_key_file_free (key_file);
+ return;
+ }
+
+ authors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Authors", &n_authors, NULL);
+ g_key_file_free (key_file);
+
+ for (i = 0; i < n_authors; ++i)
+ authors[i] = EMAILIFY (authors[i]);
+
license_trans = g_strjoin ("\n\n", _(license[0]), _(license[1]), _(license[2]), NULL);
for (p = documenters; *p; ++p)
@@ -119,5 +128,6 @@ void _pluma_cmd_help_about(GtkAction* action, PlumaWindow* window)
"website", "http://mate-desktop.org",
NULL);
+ g_strfreev (authors);
g_free (license_trans);
}
diff --git a/pluma/pluma-dirs.c b/pluma/pluma-dirs.c
index aebf5150..96f46a0b 100644
--- a/pluma/pluma-dirs.c
+++ b/pluma/pluma-dirs.c
@@ -69,7 +69,7 @@ gchar* pluma_dirs_get_user_accels_file(void)
gchar* pluma_dirs_get_pluma_data_dir(void)
{
- return g_build_filename(DATADIR, "pluma", NULL);
+ return g_build_filename(PLUMA_DATADIR, NULL);
}
gchar* pluma_dirs_get_pluma_locale_dir(void)
diff --git a/pluma/pluma.about b/pluma/pluma.about
new file mode 100644
index 00000000..6e07499a
--- /dev/null
+++ b/pluma/pluma.about
@@ -0,0 +1,2 @@
+[About]
+Authors=Adam Erdman <hekel%archlinux.info>;Alexander van der Meij <alexandervdm%gliese.me>;Alexander von Gluck IV <kallisti5%unixzen.com>;Andrew Fowlie <andrew.j.fowlie%qq.com>;Balló György <ballogyor%gmail.com>;Björn Esser <besser82%fedoraproject.org>;Clement Lefebvre <clement.lefebvre%linuxmint.com>;Daggerbot <daggerbot%gmail.com>;Gabriel Cormier-Affleck <bl0ckedusersoft%gmail.com>;Ignacio Casal Quinteiro <icq%gnome.org>;John Church <sleeveroller%gmail.com>;Marcel Dijkstra <marcel.dykstra%gmail.com>;Martin Wimpress <martin%mate-desktop.org>;OBATA Akio <obache%users.noreply.github.com>;Pablo Barciela <scow%riseup.net>;Paolo Borelli <pborelli%gnome.org>;Patrick Monnerat <pm%datasphere.ch>;Perberos <perberos%gmail.com>;Piotr Drąg <piotrdrag%gmail.com>;Robert Buj <robert.buj%gmail.com>;Ryan Q <ryan.q%linux.com>;Sander Sweers <infirit%gmail.com>;Sorokin Alexei <sor.alexei%meowr.ru>;Stefano Karapetsas <stefano%karapetsas.com>;Steve Zesch <stevezesch2%gmail.com>;Sébastien Wilmet <wilmet%gnome.org>;V.Barkov <neverscaired%gmail.com>;Vadim Barkov <vbrkov%gmail.com>;Vlad Orlov <monsta%inbox.ru>;Wolfgang Ulbrich <mate%raveit.de>;Wu Xiaotian <yetist%gmail.com>;Yaakov Selkowitz <yselkowitz%users.sourceforge.net>;ZenWalker <scow%riseup.net>;