Commit 24dcd5c8 authored by Stepan Salenikovich's avatar Stepan Salenikovich

gnome: add about dialog

Refs #69343

Change-Id: I3ef4e4af22c503d5fb92ab544afca43a8b195a32
parent 213fd917
......@@ -2,6 +2,7 @@ Current authors
---------------
Stepan Salenikovich <stepan dot salenikovich at savoirfairelinux dot com>
Eloi BAIL <eloi dot bail at savoirfairelinux dot com>
Eloi BaiL <eloi dot bail at savoirfairelinux dot com>
Guillaume Roguez <guillaume dot roguez at savoirfairelinux dot com>
Emmanuel Lepage <emmanuel dot lepage at savoirfairelinux dot com>
Alexandre Lision <alexandre dot lision at savoirfairelinux dot com>
......@@ -31,6 +31,8 @@
#include "dialogs.h"
#include <gtk/gtk.h>
#include <glib/gprintf.h>
#include "config.h"
GtkWidget *
ring_dialog_working(GtkWidget *parent, const gchar *msg)
......@@ -70,4 +72,54 @@ ring_dialog_working(GtkWidget *parent, const gchar *msg)
gtk_widget_show_all(content_area);
return dialog;
}
\ No newline at end of file
}
void
ring_about_dialog(GtkWidget *parent)
{
/* get parent window */
if (parent && GTK_IS_WIDGET(parent))
parent = gtk_widget_get_toplevel(GTK_WIDGET(parent));
/* get logo */
GError *error = NULL;
GdkPixbuf* logo = gdk_pixbuf_new_from_resource("/cx/ring/RingGnome/ring-logo-blue", &error);
if (logo == NULL) {
g_debug("Could not load logo: %s", error->message);
g_error_free(error);
}
gchar *version = g_strdup_printf("%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
const gchar *authors[] = {
[0] = "Stepan Salenikovich",
[1] = "Éloi Bail",
[2] = "Guillaume Roguez",
[3] = "Emmanuel Lepage",
[4] = "Alexandre Lision",
[5] = "Thibault Cohen",
[6] = NULL,
};
const gchar *artists[] = {
[0] = "Marianne Forget",
[1] = NULL,
};
gtk_show_about_dialog(
GTK_WINDOW(parent),
"program-name", "Gnome Ring",
"copyright", "© 2015 Savoir-faire Linux",
"license-type", GTK_LICENSE_GPL_3_0,
"logo", logo,
"version", version,
"comments", "The GNOME client for Ring.\nRing is a Voice-over-IP software phone.",
"authors", authors,
"website", "http://www.ring.cx/",
"website-label", "www.ring.cx",
"artists", artists,
NULL
);
g_free(version);
}
......@@ -36,6 +36,7 @@
G_BEGIN_DECLS
GtkWidget *ring_dialog_working(GtkWidget *parent, const gchar *msg);
void ring_about_dialog(GtkWidget *parent);
G_END_DECLS
......
......@@ -44,6 +44,7 @@
#include "ring_client_options.h"
#include "ringmainwindow.h"
#include "backends/minimalhistorybackend.h"
#include "dialogs.h"
struct _RingClientClass
{
......@@ -111,12 +112,24 @@ action_quit(G_GNUC_UNUSED GSimpleAction *simple,
#endif
}
static void
action_about(G_GNUC_UNUSED GSimpleAction *simple,
G_GNUC_UNUSED GVariant *parameter,
gpointer user_data)
{
g_return_if_fail(G_IS_APPLICATION(user_data));
RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(user_data);
ring_about_dialog(priv->win);
}
static const GActionEntry ring_actions[] =
{
{ "accept", NULL, NULL, NULL, NULL, {0} },
{ "hangup", NULL, NULL, NULL, NULL, {0} },
{ "hold", NULL, NULL, "false", NULL, {0} },
{ "quit", action_quit, NULL, NULL, NULL, {0} }
{ "accept", NULL, NULL, NULL, NULL, {0} },
{ "hangup", NULL, NULL, NULL, NULL, {0} },
{ "hold", NULL, NULL, "false", NULL, {0} },
{ "quit", action_quit, NULL, NULL, NULL, {0} },
{ "about", action_about, NULL, NULL, NULL, {0} }
/* TODO implement the other actions */
// { "mute_audio", NULL, NULL, "false", NULL, {0} },
// { "mute_video", NULL, NULL, "false", NULL, {0} },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment