Skip to content

Commit

Permalink
Fixed bug #3519711 in InfoPannel
Browse files Browse the repository at this point in the history
2012-05-07  Juan A. Moreno <[email protected]>
    * src/ui/info_pannel.cpp:
    Bug #3519711 has been corrected. If "gtk-missing-image" was not located in
    the IconTheme, Gelide can't be started.

    * ui/icons/gelide-no-image.png:
    Added as default image for the info pannel.
  • Loading branch information
Juan Ángel Moreno Fernández committed May 7, 2012
1 parent 7a5ac56 commit 495deb1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2012-05-07 Juan A. Moreno <[email protected]>
* src/ui/info_pannel.cpp:
Bug #3519711 has been corrected. If "gtk-missing-image" was not located in
the IconTheme, Gelide can't be started.

* ui/icons/gelide-no-image.png:
Added as default image for the info pannel.

2012-04-21 Juan A. Moreno <[email protected]>
* src/gelide.hpp:
Corrected a bug who broke the debug mode.
Expand Down
31 changes: 30 additions & 1 deletion src/ui/info_pannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ void CInfoPannel::initDescription(void){
}

void CInfoPannel::initImages(void){
Glib::RefPtr<Gtk::IconTheme> l_icon_theme;
Gtk::Image* l_i;
bool l_continue;

l_i = Gtk::manage(new Gtk::Image());

Expand All @@ -419,7 +421,34 @@ void CInfoPannel::initImages(void){
m_notebook_images.append_page(m_image_media, _("Media"));

//m_default = Gdk::Pixbuf::create_from_file(GELIDE_DEFAULT_IMAGE);
m_default = Gtk::IconTheme::get_default()->load_icon("gtk-missing-image", 200, Gtk::ICON_LOOKUP_USE_BUILTIN);
//m_default = Gtk::IconTheme::get_default()->load_icon("gtk-missing-image", 200, Gtk::ICON_LOOKUP_USE_BUILTIN);


l_icon_theme = Gtk::IconTheme::get_default();
l_continue = false;
// Comprobamos si se pudo obtener el icontheme
if(l_icon_theme){
// Intentamos cargar el icono
try{
m_default = l_icon_theme->load_icon("gtk-missing-image", 200, Gtk::ICON_LOOKUP_USE_BUILTIN);
l_continue = true;
}
catch(...){
l_continue = false;
}
}
// Si no se pudo añadir el icono del tema, lo añadimos del fichero
if(!l_continue){
try
{
m_default = Gdk::Pixbuf::create_from_file(GELIDE_UI_ICONS "gelide-no-image.png");
}
catch(const Glib::Exception& l_exception)
{
GELIDE_WARNING("InfoPannel loading default image (" << l_exception.what().c_str() << ")");
return;
}
}

m_pixbuf_snapshot = m_default->copy();
m_pixbuf_tittle = m_default->copy();
Expand Down
1 change: 1 addition & 0 deletions ui/icons/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ui_icons_DATA = \
gelide-favorite.png \
gelide-horizontal-browser.png \
gelide-import-systems.png \
gelide-no-image.png \
gelide-played.png \
gelide-rank.png \
gelide-show-browser.png \
Expand Down
Binary file added ui/icons/gelide-no-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 495deb1

Please sign in to comment.