Skip to content

Commit

Permalink
Read authors (updated) from pluma.about file
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuj authored and raveit65 committed Feb 18, 2019
1 parent e27a451 commit a56d506
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
7 changes: 7 additions & 0 deletions pluma/Makefile.am
Expand Up @@ -13,6 +13,7 @@ AM_CPPFLAGS = \
$(WARN_CFLAGS) \ $(WARN_CFLAGS) \
$(INTROSPECTION_CFLAGS) \ $(INTROSPECTION_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \ -DDATADIR=\""$(datadir)"\" \
-DPLUMA_DATADIR=\""$(datadir)/pluma"\" \
-DLIBDIR=\""$(libdir)"\" -DLIBDIR=\""$(libdir)"\"


pluma_SOURCES = \ pluma_SOURCES = \
Expand Down Expand Up @@ -172,13 +173,19 @@ pluma-marshal.c: pluma-marshal.list $(GLIB_GENMARSHAL)
$(AM_V_GEN) echo "#include \"pluma-marshal.h\"" > $@ && \ $(AM_V_GEN) echo "#include \"pluma-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=pluma_marshal >> $@ $(GLIB_GENMARSHAL) $< --body --prefix=pluma_marshal >> $@


aboutdir = $(datadir)/pluma/
about_DATA = \
pluma.about \
$(NULL)

uidir = $(datadir)/pluma/ui/ uidir = $(datadir)/pluma/ui/
ui_DATA = \ ui_DATA = \
pluma-ui.xml \ pluma-ui.xml \
pluma-print-preferences.ui pluma-print-preferences.ui


EXTRA_DIST = \ EXTRA_DIST = \
$(ui_DATA) \ $(ui_DATA) \
$(about_DATA) \
pluma-enum-types.h.template \ pluma-enum-types.h.template \
pluma-enum-types.c.template \ pluma-enum-types.c.template \
pluma-marshal.list \ pluma-marshal.list \
Expand Down
36 changes: 23 additions & 13 deletions pluma/pluma-commands-help.c
Expand Up @@ -35,6 +35,7 @@
#include <config.h> #include <config.h>
#endif #endif


#include <glib.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>


Expand All @@ -50,21 +51,11 @@ void _pluma_cmd_help_contents(GtkAction* action, PlumaWindow* window)
pluma_help_display(GTK_WINDOW(window), NULL, NULL); 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) void _pluma_cmd_help_about(GtkAction* action, PlumaWindow* window)
{ {
static const gchar* const authors[] = {
"Paolo Maggi <paolo@gnome.org>",
"Paolo Borelli <pborelli@katamail.com>",
"Steve Fr\303\251cinaux <steve@istique.net>",
"Jesse van den Kieboom <jessevdk@gnome.org>",
"Ignacio Casal Quinteiro <icq@gnome.org>",
"James Willcox <jwillcox@gnome.org>",
"Chema Celorio",
"Federico Mena Quintero <federico@novell.com>",
"Perberos <perberos@gmail.com>",
NULL
};

static const gchar* documenters[] = { static const gchar* documenters[] = {
N_("MATE Documentation Team"), N_("MATE Documentation Team"),
N_("GNOME Documentation Team"), N_("GNOME Documentation Team"),
Expand All @@ -90,10 +81,28 @@ void _pluma_cmd_help_about(GtkAction* action, PlumaWindow* window)
}; };


gchar *license_trans; gchar *license_trans;
GKeyFile *key_file;
GError *error = NULL;
char **authors;
gsize n_authors = 0, i;
static const gchar **p; static const gchar **p;


pluma_debug (DEBUG_COMMANDS); 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); license_trans = g_strjoin ("\n\n", _(license[0]), _(license[1]), _(license[2]), NULL);


for (p = documenters; *p; ++p) for (p = documenters; *p; ++p)
Expand All @@ -119,5 +128,6 @@ void _pluma_cmd_help_about(GtkAction* action, PlumaWindow* window)
"website", "http://mate-desktop.org", "website", "http://mate-desktop.org",
NULL); NULL);


g_strfreev (authors);
g_free (license_trans); g_free (license_trans);
} }
2 changes: 1 addition & 1 deletion pluma/pluma-dirs.c
Expand Up @@ -69,7 +69,7 @@ gchar* pluma_dirs_get_user_accels_file(void)


gchar* pluma_dirs_get_pluma_data_dir(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) gchar* pluma_dirs_get_pluma_locale_dir(void)
Expand Down
2 changes: 2 additions & 0 deletions 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>;

0 comments on commit a56d506

Please sign in to comment.