Add fallback method for specifying GParted icon (#695279)
On RHEL / CentOS 5.9 GParted couldn't set an icon as the set_default_icon_name() method is not available. See commit [1] for details. Re-add the old set_icon_from_file() method as a fallback and re-install a GParted pixmap as was used before commit [2]. Commit [1]:a042107883
Only use Gtk::Window::set_default_icon_name method when available Commit [2]:f5a80bc904
Enabled GParted to use themed app icon (Tango theme) Bug #695279 - GParted doesn't compile on RHEL / CentOS 5.9
This commit is contained in:
parent
bae9db222b
commit
b09d6035cd
|
@ -16,12 +16,23 @@ public_icons = \
|
||||||
private_icons = \
|
private_icons = \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
# Name of the fallback icon to install in /usr/share/pixmaps [1]
|
||||||
|
# --
|
||||||
|
# The GNOME 2 desktop wants a 16x16 "Menu" type icon [2] for the title
|
||||||
|
# bar and the open window list, and a 32x32 icon for the Alt-Tab task
|
||||||
|
# switcher. GParted only specifies a single icon file in the fallback
|
||||||
|
# case so just use the 16x16 one and let it be scaled as required.
|
||||||
|
# [1] https://developer.gnome.org/icon-theme-spec/
|
||||||
|
# [2] https://developer.gnome.org/hig-book/2.32/hig-book.html#icons
|
||||||
|
pixmap = hicolor_apps_16x16_gparted.png
|
||||||
|
|
||||||
noinst_DATA = \
|
noinst_DATA = \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
$(public_icons) \
|
$(public_icons) \
|
||||||
$(private_icons) \
|
$(private_icons) \
|
||||||
|
$(pixmap) \
|
||||||
$(noinst_DATA) \
|
$(noinst_DATA) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
@ -76,6 +87,13 @@ uninstall-icons:
|
||||||
rm -f $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
|
rm -f $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
|
||||||
done
|
done
|
||||||
|
|
||||||
install-data-local: install-icons update-icon-cache
|
install-pixmap:
|
||||||
|
mkdir -p $(DESTDIR)$(datadir)/pixmaps; \
|
||||||
|
$(INSTALL_DATA) $(srcdir)/$(pixmap) $(DESTDIR)$(datadir)/pixmaps/gparted.png
|
||||||
|
|
||||||
uninstall-local: uninstall-icons update-icon-cache
|
uninstall-pixmap:
|
||||||
|
rm -f $(DESTDIR)$(datadir)/pixmaps/gparted.png
|
||||||
|
|
||||||
|
install-data-local: install-icons install-pixmap update-icon-cache
|
||||||
|
|
||||||
|
uninstall-local: uninstall-icons uninstall-pixmap update-icon-cache
|
||||||
|
|
|
@ -2,6 +2,7 @@ INCLUDES = \
|
||||||
$(GTHREAD_CFLAGS) \
|
$(GTHREAD_CFLAGS) \
|
||||||
$(GTKMM_CFLAGS) \
|
$(GTKMM_CFLAGS) \
|
||||||
-DGPARTED_DATADIR=\""$(datadir)"\" \
|
-DGPARTED_DATADIR=\""$(datadir)"\" \
|
||||||
|
-DGNOME_ICONDIR=\""$(datadir)/pixmaps"\" \
|
||||||
-DGNOMELOCALEDIR=\""$(datadir)/locale"\"
|
-DGNOMELOCALEDIR=\""$(datadir)/locale"\"
|
||||||
|
|
||||||
AM_CFLAGS = -Wall
|
AM_CFLAGS = -Wall
|
||||||
|
|
|
@ -75,16 +75,18 @@ Win_GParted::Win_GParted( const std::vector<Glib::ustring> & user_devices )
|
||||||
this ->set_title( _("GParted") );
|
this ->set_title( _("GParted") );
|
||||||
this ->set_default_size( 775, 500 );
|
this ->set_default_size( 775, 500 );
|
||||||
|
|
||||||
#ifdef HAVE_SET_DEFAULT_ICON_NAME
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_SET_DEFAULT_ICON_NAME
|
||||||
this ->set_default_icon_name( "gparted" ) ;
|
this ->set_default_icon_name( "gparted" ) ;
|
||||||
|
#else
|
||||||
|
this ->set_icon_from_file( GNOME_ICONDIR "/gparted.png" ) ;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
catch ( Glib::Exception & e )
|
catch ( Glib::Exception & e )
|
||||||
{
|
{
|
||||||
std::cout << e .what() << std::endl ;
|
std::cout << e .what() << std::endl ;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//Pack the main box
|
//Pack the main box
|
||||||
this ->add( vbox_main );
|
this ->add( vbox_main );
|
||||||
|
|
Loading…
Reference in New Issue