Fix display of window icon
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 25 Feb 2009 07:45:06 +0000 (16:45 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 25 Feb 2009 07:45:06 +0000 (16:45 +0900)
Makefile.am
doc/automake.mk
src/ui/gui/about.c
src/ui/gui/automake.mk
src/ui/gui/psppire-dialog.c
src/ui/gui/psppire-window.c
tests/automake.mk

index 06ae2e00973749d9ef17a094bb88662c37906634..f606cbf1123b5d8c8d8f468fd6fadb90dc1c2512 100644 (file)
@@ -37,9 +37,10 @@ noinst_PROGRAMS=
 check_PROGRAMS=
 bin_PROGRAMS=
 DIST_HOOKS =
+INSTALL_DATA_HOOKS = 
+UNINSTALL_DATA_HOOKS =
 PHONY =
 
-DIST_HOOKS += generate-changelog
 generate-changelog:
        if test -d $(top_srcdir)/.git; then                     \
          $(top_srcdir)/gitlog-to-changelog --since=2008-07-27  \
@@ -48,6 +49,9 @@ generate-changelog:
          mv $(distdir)/cl-t $(distdir)/ChangeLog;              \
        fi
 
+DIST_HOOKS += generate-changelog
+
+
 include $(top_srcdir)/lib/automake.mk
 include $(top_srcdir)/doc/automake.mk
 include $(top_srcdir)/config/automake.mk
@@ -64,6 +68,15 @@ if WITH_PERL_MODULE
 include $(top_srcdir)/perl-module/automake.mk
 endif
 
-PHONY += $(DIST_HOOKS)
-dist-hook: $(DIST_HOOKS)
+PHONY += $(DIST_HOOKS) $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS)
+
 .PHONY: $(PHONY)
+
+dist-hook: $(DIST_HOOKS)
+
+install-data-hook: $(INSTALL_DATA_HOOKS)
+
+uninstall-hook: $(UNINSTALL_DATA_HOOKS)
+
+
+
index c25e0cb3cb610b0657223abf2e85467ce3807770..f6f669b1ef42c80be37da834b3ff0bdec833f6ac 100644 (file)
@@ -46,22 +46,19 @@ doc/ni.texi: $(top_srcdir)/src/language/command.def doc/get-commands.pl
        @$(MKDIR_P)  doc
        @PERL@ $(top_srcdir)/doc/get-commands.pl $(top_srcdir)/src/language/command.def > $@
 
-# It seems that recent versions of yelp, upon which the gui relies to display the reference
-# manual, are broken.  It only works on compressed info files.  So we must compress them.
-if WITHGUI
-YELP_CHECK = yelp-check
-else
-YELP_CHECK =
-endif
-install-data-hook:: $(YELP_CHECK)
-       for ifile in $(DESTDIR)$(infodir)/pspp.info-[0-9] \
-               $(DESTDIR)$(infodir)/pspp.info  ; do \
+
+install-info-file:
+       for ifile in $(DESTDIR)$(infodir)/pspp.info-[0-9] $(DESTDIR)$(infodir)/pspp.info  ; do \
          gzip -f $$ifile ; \
-       done
+       done 
+
+INSTALL_DATA_HOOKS += install-info-file
+
+uninstall-info-file:
+       $(RM) $(DESTDIR)$(infodir)/pspp.info-[0-9].gz ; \
+       $(RM) $(DESTDIR)$(infodir)/pspp.info.gz ;
 
-uninstall-hook::
-       rm -f $(DESTDIR)$(infodir)/pspp.info-[0-9].gz
-       rm -f $(DESTDIR)$(infodir)/pspp.info.gz
+UNINSTALL_DATA_HOOKS += uninstall-info-file
 
 EXTRA_DIST += doc/OChangeLog
 CLEANFILES += pspp-dev.dvi
index 23ae5b0679077e3538df11e569277980ade964c4..8ca91cbe8281d56a14eea230f39fe6afcbb46546 100644 (file)
@@ -41,8 +41,7 @@ about_new (GtkMenuItem *m, GtkWindow *parent)
   gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (about), pb);
 
 
-  gtk_window_set_icon_from_file (GTK_WINDOW (about),
-                                relocate (PKGDATADIR "/psppicon.png"), 0);
+  gtk_window_set_icon_name (GTK_WINDOW (about), "psppicon");
 
   gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (about),
                                "http://www.gnu.org/software/pspp");
index e664ab9d06fd385b33994cf4be156aae81924274..92acbd69409776f1cb2e092d0e7892ad5dcc162f 100644 (file)
@@ -33,6 +33,29 @@ src_ui_gui_psppire_LDADD = \
 
 src_ui_gui_psppiredir = $(pkgdatadir)
 
+
+themedir = $(DESTDIR)$(datadir)/icons/hicolor
+context = apps
+
+
+install-icons:
+       for size in 16x16 ; do \
+         $(MKDIR_P) $(themedir)/$$size/$(context) ; \
+          $(INSTALL) $(top_srcdir)/src/ui/gui/psppicon.png $(themedir)/$$size/$(context) ; \
+       done 
+       gtk-update-icon-cache --ignore-theme-index $(themedir)
+
+INSTALL_DATA_HOOKS += install-icons
+
+uninstall-icons:
+       for size in 16x16 ; do \
+          $(RM) $(themedir)/$$size/$(context)/psppicon.png ; \
+       done 
+       gtk-update-icon-cache --ignore-theme-index $(themedir)
+
+UNINSTALL_DATA_HOOKS += uninstall-icons
+
+
 nodist_src_ui_gui_psppire_DATA = \
        $(top_builddir)/src/ui/gui/crosstabs.ui \
        $(top_builddir)/src/ui/gui/descriptives-dialog.ui \
@@ -52,7 +75,6 @@ nodist_src_ui_gui_psppire_DATA = \
 
 dist_src_ui_gui_psppire_DATA = \
        $(top_srcdir)/src/ui/gui/text-data-import.glade \
-       $(top_srcdir)/src/ui/gui/psppicon.png \
        $(top_srcdir)/src/ui/gui/pspplogo.png \
        $(top_srcdir)/src/ui/gui/icons/value-labels.png \
        $(top_srcdir)/src/ui/gui/icons/goto-variable.png\
@@ -214,6 +236,7 @@ yelp-check:
                echo '    Yelp is available from the GNOME project.  ftp://ftp.gnome.org/pub/gnome/sources/yelp' ; \
                echo ; \
        fi
+
 PHONY += yelp-check
 
 AM_CPPFLAGS += -Isrc
@@ -228,6 +251,7 @@ src/ui/gui/psppire-marshal.h: src/ui/gui/marshaller-list
        gtk-builder-convert $< $@
 
 EXTRA_DIST += src/ui/gui/OChangeLog\
+       src/ui/gui/psppicon.png \
        src/ui/gui/marshaller-list
 
 BUILT_SOURCES += src/ui/gui/psppire-marshal.c src/ui/gui/psppire-marshal.h
index 84f9e5de489459a86c702c912a32d7c882a3fc17..6945c2a901fdf2cc28c7a1e5e20d25223ba2a80f 100644 (file)
@@ -289,6 +289,8 @@ psppire_dialog_init (PsppireDialog *dialog)
   gtk_window_set_type_hint (GTK_WINDOW (dialog),
        GDK_WINDOW_TYPE_HINT_DIALOG);
 
+  g_object_set (dialog, "icon-name", "psppicon", NULL);
+
   gtk_widget_show_all (dialog->box);
 }
 
@@ -298,7 +300,8 @@ psppire_dialog_new (void)
 {
   PsppireDialog *dialog ;
 
-  dialog = g_object_new (psppire_dialog_get_type (), NULL);
+  dialog = g_object_new (psppire_dialog_get_type (),
+                        NULL);
 
   return GTK_WIDGET (dialog) ;
 }
index 1e2e75d3570902c0146539dafd7c07fa7e0ea9d9..6945914a5e294aec189f3ff521b923c1483b3826 100644 (file)
@@ -387,6 +387,8 @@ psppire_window_init (PsppireWindow *window)
   window->unsaved = FALSE;
 
   g_signal_connect (window, "delete-event", G_CALLBACK (on_delete), window);
+
+  g_object_set (window, "icon-name", "psppicon", NULL);
 }
 
 
index 61c66bd56d65098792f3a0e91dda51736f99ecfa..4c3899b144f4147e4c91162962651444ea8d998d 100644 (file)
@@ -341,11 +341,12 @@ EXTRA_DIST += \
 
 CLEANFILES += *.save pspp.* foo*
 
-DIST_HOOKS += check-for-export-var-val
 check-for-export-var-val:
        @if grep -q 'export .*=' $(dist_TESTS) ; then \
         echo 'One or more tests contain non-portable "export VAR=val" syntax' ; \
         false ; \
        fi
 
+DIST_HOOKS += check-for-export-var-val
+
 EXTRA_DIST += tests/OChangeLog