diff --git a/configure.in b/configure.in index f8962ad3..b047caaa 100644 --- a/configure.in +++ b/configure.in @@ -263,6 +263,35 @@ PKG_CHECK_EXISTS( ) +dnl Check for Gtk::Window::set_default_icon_name() method +dnl NOTE: +dnl The documentation says that set_default_icon_name() is available in gtkmm >= 2.6. +dnl gtkmm GTK::Window Class Reference +dnl https://developer.gnome.org/gtkmm/3.6/classGtk_1_1Window.html#a533d03e9b92d8ccd142ab3a44005cae4 +dnl However it is not available in RHEL/CentOS 5.9 with gtkmm 2.10. Therefore a package +dnl version check isn't sufficient. Instead perform a more accurate, but slower, compile +dnl and link a test program check. +AC_LANG_PUSH([C++]) +CXXFLAGS_save="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS `pkg-config gtkmm-2.4 --cflags --libs`" +AC_MSG_CHECKING([for Gtk::Window::set_default_icon_name method]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[Gtk::Window mywindow; + mywindow.set_default_icon_name("myappname"); + ]] + )], + [AC_DEFINE([HAVE_SET_DEFAULT_ICON_NAME], 1, + [Define to 1 if gtkmm-2.4 provides Gtk::Window::set_default_icon_name() method.]) + AC_MSG_RESULT([yes]) + ], + [AC_MSG_RESULT([no])] +) +CXXFLAGS="$CXXFLAGS_save" +AC_LANG_POP([C++]) + + dnl GTKMM 2.16 needed for gtk_show_uri() PKG_CHECK_EXISTS([gtkmm-2.4 >= 2.16.0], [AC_DEFINE([HAVE_GTK_SHOW_URI], 1, [Define to 1 if you have gtk_show_uri])], diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index 58936580..3e27ddad 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -75,14 +75,16 @@ Win_GParted::Win_GParted( const std::vector & user_devices ) this ->set_title( _("GParted") ); this ->set_default_size( 775, 500 ); +#ifdef HAVE_SET_DEFAULT_ICON_NAME try { this ->set_default_icon_name( "gparted" ) ; } catch ( Glib::Exception & e ) - { + { std::cout << e .what() << std::endl ; - } + } +#endif //Pack the main box this ->add( vbox_main );