[gedit/wip/logo-resource: 3/3] Use GResource for the gedit logo



commit ad1075742d6376a32513e65e8a4694f755562bd7
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Nov 28 19:19:29 2015 +0100

    Use GResource for the gedit logo
    
    And keep all pixmaps together, to not have two different directories.

 Makefile.am                                        |    1 -
 gedit/Makefile.am                                  |    1 +
 gedit/gedit-commands-help.c                        |   19 ++++++++-----------
 gedit/gedit.rc                                     |    2 +-
 gedit/resources/gedit.gresource.xml.in             |    1 +
 .../resources/pixmaps}/gedit-logo.png              |  Bin 25918 -> 25918 bytes
 .../resources/pixmaps}/gedit-logo.svgz             |  Bin 8608 -> 8608 bytes
 {pixmaps => gedit/resources/pixmaps}/gedit.ico     |  Bin 9662 -> 9662 bytes
 pixmaps/Makefile.am                                |    4 ----
 win32/qt-ifw/config/config.xml                     |    4 ++--
 10 files changed, 13 insertions(+), 19 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 5f10764..78238f7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -88,7 +88,6 @@ BUILT_SOURCES             =
 CLEANFILES                =
 
 include data/Makefile.am
-include pixmaps/Makefile.am
 include win32/Makefile.am
 include osx/bundle/data/Makefile.am
 include plugins/Makefile.am
diff --git a/gedit/Makefile.am b/gedit/Makefile.am
index a502e8c..42c1cfc 100644
--- a/gedit/Makefile.am
+++ b/gedit/Makefile.am
@@ -260,6 +260,7 @@ EXTRA_DIST +=                                       \
        gedit/gedit.rc                          \
        gedit/Gedit-3.0.metadata                \
        gedit/resources/gedit.gresource.xml.in  \
+       gedit/resources/pixmaps/gedit.ico       \
        $(gedit_dist_resource_deps)
 
 if HAVE_INTROSPECTION
diff --git a/gedit/gedit-commands-help.c b/gedit/gedit-commands-help.c
index 75d0c3c..5f45f9c 100644
--- a/gedit/gedit-commands-help.c
+++ b/gedit/gedit-commands-help.c
@@ -79,18 +79,16 @@ _gedit_cmd_help_about (GeditWindow *window)
                N_("gedit is a small and lightweight text editor for the GNOME Desktop");
 
        GdkPixbuf *logo;
-       const gchar *data_dir;
-       gchar *logo_file;
+       GError *error = NULL;
 
        gedit_debug (DEBUG_COMMANDS);
 
-       data_dir = gedit_dirs_get_gedit_data_dir ();
-       logo_file = g_build_filename (data_dir,
-                                     "logo",
-                                     "gedit-logo.png",
-                                     NULL);
-       logo = gdk_pixbuf_new_from_file (logo_file, NULL);
-       g_free (logo_file);
+       logo = gdk_pixbuf_new_from_resource ("/org/gnome/gedit/pixmaps/gedit-logo.png", &error);
+       if (error != NULL)
+       {
+               g_warning ("Error when loading the gedit logo: %s", error->message);
+               g_clear_error (&error);
+       }
 
        gtk_show_about_dialog (GTK_WINDOW (window),
                               "program-name", "gedit",
@@ -106,8 +104,7 @@ _gedit_cmd_help_about (GeditWindow *window)
                               "website-label", "www.gedit.org",
                               NULL);
 
-       if (logo)
-               g_object_unref (logo);
+       g_clear_object (&logo);
 }
 
 /* ex:set ts=8 noet: */
diff --git a/gedit/gedit.rc b/gedit/gedit.rc
index 17d8eb1..28cac88 100644
--- a/gedit/gedit.rc
+++ b/gedit/gedit.rc
@@ -1 +1 @@
-A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "../pixmaps/gedit.ico"
+A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "resources/pixmaps/gedit.ico"
diff --git a/gedit/resources/gedit.gresource.xml.in b/gedit/resources/gedit.gresource.xml.in
index 2fde722..9191e31 100644
--- a/gedit/resources/gedit.gresource.xml.in
+++ b/gedit/resources/gedit.gresource.xml.in
@@ -3,6 +3,7 @@
   <gresource prefix="/org/gnome/gedit">
     <file preprocess="xml-stripblanks">gtk/menus.ui</file>
     <file preprocess="xml-stripblanks">gtk/menus-common.ui</file>
+    <file preprocess="to-pixdata">pixmaps/gedit-logo.png</file>
     <file preprocess="xml-stripblanks">ui/gedit-encodings-dialog.ui</file>
     <file preprocess="xml-stripblanks">ui/gedit-preferences-dialog.ui</file>
     <file preprocess="xml-stripblanks">ui/gedit-replace-dialog.ui</file>
diff --git a/win32/qt-ifw/config/config.xml b/win32/qt-ifw/config/config.xml
index 4de4cf4..1d83c07 100644
--- a/win32/qt-ifw/config/config.xml
+++ b/win32/qt-ifw/config/config.xml
@@ -9,6 +9,6 @@
     <StartMenuDir>gedit Text Editor</StartMenuDir>
     <RunProgram>@TargetDir@/bin/gedit.exe</RunProgram>
     <RunProgramArguments></RunProgramArguments>
-    <InstallerApplicationIcon>../../../pixmaps/gedit.ico</InstallerApplicationIcon>
-    <InstallerWindowIcon>../../../pixmaps/gedit.ico</InstallerWindowIcon>
+    <InstallerApplicationIcon>../../../gedit/resources/pixmaps/gedit.ico</InstallerApplicationIcon>
+    <InstallerWindowIcon>../../../gedit/resources/pixmaps/gedit.ico</InstallerWindowIcon>
 </Installer>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]