1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2010 Nedko Arnaudov <nedko@arnaudov.name>
7 **************************************************************************
8 * This file contains the code that implements the about dialog
9 **************************************************************************
11 * LADI Session Handler is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * LADI Session Handler is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
23 * or write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include <sys/types.h>
34 #include "gtk_builder.h"
37 #include "../common/file.h"
38 #include "../common/catdup.h"
40 #define ABOUT_DIALOG_LOGO "ladish-logo-128x128.png"
46 const char * authors
[] =
50 _("Filipe Alexandre Lopes Coelho"),
53 const char * artists
[] =
55 _("Lapo Calamandrei"),
56 _("Nadejda Pancheva-Arnaudova"),
59 const char * translators_array
[] =
62 _("Alexandre Prokoudine"),
72 char timestamp_str
[26];
75 pixbuf
= load_pixbuf(ABOUT_DIALOG_LOGO
);
76 license
= read_file_contents(DATA_DIR
"/COPYING");
78 dialog
= get_gtk_builder_widget("about_win");
81 stat("/proc/self/exe", &st
);
82 ctime_r(&st
.st_mtime
, timestamp_str
);
83 timestamp_str
[24] = 0;
85 sprintf(built_str
, _("gladish is built on %s from %s"), timestamp_str
, GIT_VERSION
);
87 gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog
), PACKAGE_VERSION
);
88 gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(dialog
), built_str
);
92 gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(dialog
), pixbuf
);
93 g_object_unref(pixbuf
);
98 gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(dialog
), license
);
102 gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(dialog
), authors
);
103 gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(dialog
), artists
);
105 translators
= catdup_array(translators_array
, "\n");
106 if (translators
!= NULL
)
108 gtk_about_dialog_set_translator_credits(GTK_ABOUT_DIALOG(dialog
), translators
);
111 gtk_widget_show(dialog
);
112 gtk_dialog_run(GTK_DIALOG(dialog
));
113 gtk_widget_hide(dialog
);