diff options
Diffstat (limited to 'src/libaudgui/about.cc')
-rw-r--r-- | src/libaudgui/about.cc | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/libaudgui/about.cc b/src/libaudgui/about.cc index dcc025b..9787871 100644 --- a/src/libaudgui/about.cc +++ b/src/libaudgui/about.cc @@ -22,13 +22,14 @@ #include <libaudcore/audstrings.h> #include <libaudcore/i18n.h> #include <libaudcore/runtime.h> +#include <libaudcore/vfs.h> #include "internal.h" #include "libaudgui.h" #include "libaudgui-gtk.h" static const char about_text[] = "<big><b>Audacious " VERSION "</b></big>\n" COPYRIGHT; -static const char website[] = "http://audacious-media-player.org"; +static const char website[] = "https://audacious-media-player.org"; static GtkWidget * create_credits_notebook (const char * credits, const char * license) { @@ -77,8 +78,9 @@ static GtkWidget * create_about_window () GtkWidget * vbox = gtk_vbox_new (false, 6); gtk_container_add ((GtkContainer *) about_window, vbox); - StringBuf logo_path = filename_build ({data_dir, "images", "about-logo.png"}); - GtkWidget * image = gtk_image_new_from_file (logo_path); + AudguiPixbuf logo (gdk_pixbuf_new_from_resource_at_scale + ("/org/audacious/about-logo.svg", 4 * dpi, 2 * dpi, true, nullptr)); + GtkWidget * image = gtk_image_new_from_pixbuf (logo.get ()); gtk_box_pack_start ((GtkBox *) vbox, image, false, false, 0); GtkWidget * label = gtk_label_new (nullptr); @@ -92,26 +94,13 @@ static GtkWidget * create_about_window () GtkWidget * button = gtk_link_button_new (website); gtk_container_add ((GtkContainer *) align, button); - char * credits, * license; + auto credits = VFSFile::read_file (filename_build ({data_dir, "AUTHORS"}), VFS_APPEND_NULL); + auto license = VFSFile::read_file (filename_build ({data_dir, "COPYING"}), VFS_APPEND_NULL); - StringBuf credits_path = filename_build ({data_dir, "AUTHORS"}); - if (! g_file_get_contents (credits_path, & credits, nullptr, nullptr)) - credits = g_strdup_printf ("Unable to load %s; check your installation.", (const char *) credits_path); - - StringBuf license_path = filename_build ({data_dir, "COPYING"}); - if (! g_file_get_contents (license_path, & license, nullptr, nullptr)) - license = g_strdup_printf ("Unable to load %s; check your installation.", (const char *) license_path); - - g_strchomp (credits); - g_strchomp (license); - - GtkWidget * notebook = create_credits_notebook (credits, license); + GtkWidget * notebook = create_credits_notebook (credits.begin (), license.begin ()); gtk_widget_set_size_request (notebook, 6 * dpi, 2 * dpi); gtk_box_pack_start ((GtkBox *) vbox, notebook, true, true, 0); - g_free (credits); - g_free (license); - return about_window; } |