Stepan Salenikovich | bd02958 | 2015-03-24 11:00:56 -0400 | [diff] [blame] | 1 | /* |
Stepan Salenikovich | be87d2c | 2016-01-25 14:14:34 -0500 | [diff] [blame] | 2 | * Copyright (C) 2015-2016 Savoir-faire Linux Inc. |
Stepan Salenikovich | bd02958 | 2015-03-24 11:00:56 -0400 | [diff] [blame] | 3 | * Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
Stepan Salenikovich | bd02958 | 2015-03-24 11:00:56 -0400 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #include "dialogs.h" |
| 21 | |
| 22 | #include <gtk/gtk.h> |
Stepan Salenikovich | a1b8cb3 | 2015-09-11 14:58:35 -0400 | [diff] [blame] | 23 | #include <glib/gi18n.h> |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 24 | #include <glib/gprintf.h> |
| 25 | #include "config.h" |
Stepan Salenikovich | e40e48d | 2015-09-17 18:38:25 -0400 | [diff] [blame] | 26 | #include "revision.h" |
Stepan Salenikovich | bd02958 | 2015-03-24 11:00:56 -0400 | [diff] [blame] | 27 | |
| 28 | GtkWidget * |
| 29 | ring_dialog_working(GtkWidget *parent, const gchar *msg) |
| 30 | { |
| 31 | GtkWidget *dialog = gtk_dialog_new(); |
| 32 | gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE); |
Stepan Salenikovich | 83e187b | 2015-03-26 12:10:14 -0400 | [diff] [blame] | 33 | gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
Stepan Salenikovich | bd02958 | 2015-03-24 11:00:56 -0400 | [diff] [blame] | 34 | |
| 35 | if (parent && GTK_IS_WIDGET(parent)) { |
| 36 | /* get parent window so we can center on it */ |
| 37 | parent = gtk_widget_get_toplevel(GTK_WIDGET(parent)); |
| 38 | if (gtk_widget_is_toplevel(parent)) { |
| 39 | gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent)); |
| 40 | gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | GtkWidget *content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); |
| 45 | gtk_box_set_spacing(GTK_BOX(content_area), 10); |
Stepan Salenikovich | 83e187b | 2015-03-26 12:10:14 -0400 | [diff] [blame] | 46 | gtk_widget_set_size_request(content_area, 250, -1); |
| 47 | gtk_widget_set_margin_top(content_area, 25); |
Stepan Salenikovich | bd02958 | 2015-03-24 11:00:56 -0400 | [diff] [blame] | 48 | |
| 49 | GtkWidget *message = NULL; |
| 50 | if (msg) { |
| 51 | message = gtk_label_new(msg); |
| 52 | } else { |
Stepan Salenikovich | a1b8cb3 | 2015-09-11 14:58:35 -0400 | [diff] [blame] | 53 | message = gtk_label_new(_("Working...")); |
Stepan Salenikovich | bd02958 | 2015-03-24 11:00:56 -0400 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | gtk_box_pack_start(GTK_BOX(content_area), message, FALSE, TRUE, 0); |
| 57 | |
| 58 | GtkWidget *spinner = gtk_spinner_new(); |
| 59 | gtk_spinner_start(GTK_SPINNER(spinner)); |
| 60 | |
| 61 | gtk_box_pack_start(GTK_BOX(content_area), spinner, FALSE, TRUE, 0); |
| 62 | |
| 63 | gtk_widget_show_all(content_area); |
| 64 | |
| 65 | return dialog; |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | void |
| 69 | ring_about_dialog(GtkWidget *parent) |
| 70 | { |
| 71 | /* get parent window */ |
| 72 | if (parent && GTK_IS_WIDGET(parent)) |
| 73 | parent = gtk_widget_get_toplevel(GTK_WIDGET(parent)); |
| 74 | |
| 75 | /* get logo */ |
| 76 | GError *error = NULL; |
| 77 | GdkPixbuf* logo = gdk_pixbuf_new_from_resource("/cx/ring/RingGnome/ring-logo-blue", &error); |
| 78 | if (logo == NULL) { |
| 79 | g_debug("Could not load logo: %s", error->message); |
Stepan Salenikovich | 8a287fc | 2015-05-01 16:53:20 -0400 | [diff] [blame] | 80 | g_clear_error(&error); |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 81 | } |
| 82 | |
Guillaume Roguez | 1af2885 | 2016-11-02 19:26:20 -0400 | [diff] [blame] | 83 | gchar *version = g_strdup_printf(C_("Do not translate the release name nor the status (beta, final, ...)", |
Guillaume Roguez | f32c2d9 | 2016-11-03 13:36:33 -0400 | [diff] [blame] | 84 | "Gaston Miron - Beta 2\nbuilt on %.25s"), |
Guillaume Roguez | 1af2885 | 2016-11-02 19:26:20 -0400 | [diff] [blame] | 85 | RING_CLIENT_BUILD_DATE); |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 86 | |
| 87 | const gchar *authors[] = { |
Guillaume Roguez | 3ca693a | 2016-11-03 13:35:43 -0400 | [diff] [blame] | 88 | "Adrien Béraud", |
Guillaume Roguez | c87c63b | 2016-11-03 16:21:56 -0400 | [diff] [blame] | 89 | "Alexandr Sergheev", |
Guillaume Roguez | 3ca693a | 2016-11-03 13:35:43 -0400 | [diff] [blame] | 90 | "Alexandre Lision", |
Guillaume Roguez | 3ca693a | 2016-11-03 13:35:43 -0400 | [diff] [blame] | 91 | "Alexandre Viau", |
| 92 | "Aline Bonnet", |
Guillaume Roguez | c87c63b | 2016-11-03 16:21:56 -0400 | [diff] [blame] | 93 | "Andreas Traczyk", |
Guillaume Roguez | 3ca693a | 2016-11-03 13:35:43 -0400 | [diff] [blame] | 94 | "Anthony Léonard", |
| 95 | "Cyrille Béraud", |
Dorina Mosku | 8b75a4c | 2016-11-10 15:49:44 -0500 | [diff] [blame] | 96 | "Dorina Mosku", |
Guillaume Roguez | 3ca693a | 2016-11-03 13:35:43 -0400 | [diff] [blame] | 97 | "Edric Milaret", |
| 98 | "Éloi Bail", |
| 99 | "Emmanuel Lepage-Vallée", |
| 100 | "Frédéric Guimont", |
| 101 | "Guillaume Roguez", |
| 102 | "Julien Grossholtz", |
| 103 | "Loïc Siret", |
| 104 | "Nicolas Jäger", |
| 105 | "Nicolas Reynaud" |
| 106 | "Olivier Gregoire", |
| 107 | "Olivier Soldano", |
| 108 | "Patrick Keroulas", |
| 109 | "Philippe Gorley", |
| 110 | "Romain Bertozzi", |
| 111 | "Seva Ivanov", |
| 112 | "Simon Désaulniers", |
| 113 | "Stepan Salenikovich", |
| 114 | "Simon Zeni", |
| 115 | "Thibault Wittemberg", |
| 116 | "Based on the SFLPhone project", |
| 117 | NULL, |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 118 | }; |
| 119 | |
| 120 | const gchar *artists[] = { |
Guillaume Roguez | 3ca693a | 2016-11-03 13:35:43 -0400 | [diff] [blame] | 121 | "Marianne Forget", |
| 122 | NULL, |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 123 | }; |
| 124 | |
| 125 | gtk_show_about_dialog( |
| 126 | GTK_WINDOW(parent), |
Guillaume Roguez | f32c2d9 | 2016-11-03 13:36:33 -0400 | [diff] [blame] | 127 | "program-name", "", |
Stepan Salenikovich | be87d2c | 2016-01-25 14:14:34 -0500 | [diff] [blame] | 128 | "copyright", "© 2016 Savoir-faire Linux", |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 129 | "license-type", GTK_LICENSE_GPL_3_0, |
| 130 | "logo", logo, |
Stepan Salenikovich | e40e48d | 2015-09-17 18:38:25 -0400 | [diff] [blame] | 131 | "version", version, |
Stepan Salenikovich | d4d19d6 | 2016-11-03 11:12:22 -0400 | [diff] [blame] | 132 | "comments", _("The GNOME client for Ring.\nRing is free software for universal communication which respects the freedoms and privacy of its users."), |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 133 | "authors", authors, |
| 134 | "website", "http://www.ring.cx/", |
| 135 | "website-label", "www.ring.cx", |
| 136 | "artists", artists, |
Stepan Salenikovich | d080d6d | 2015-11-13 10:46:24 -0500 | [diff] [blame] | 137 | "translator-credits", "https://www.transifex.com/savoirfairelinux/ring", |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 138 | NULL |
| 139 | ); |
| 140 | |
Stepan Salenikovich | e40e48d | 2015-09-17 18:38:25 -0400 | [diff] [blame] | 141 | g_free(version); |
Stepan Salenikovich | 24dcd5c | 2015-03-26 17:40:34 -0400 | [diff] [blame] | 142 | } |