From 96942e4ddfa330bb339d13d0ac2c0a8941db168a Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Mon, 4 Jan 2016 18:52:35 +0100 Subject: managed also relative pathnamed icons --- lib/ManaTools/MainDisplay.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/ManaTools/MainDisplay.pm') diff --git a/lib/ManaTools/MainDisplay.pm b/lib/ManaTools/MainDisplay.pm index 5be17d01..59915b69 100644 --- a/lib/ManaTools/MainDisplay.pm +++ b/lib/ManaTools/MainDisplay.pm @@ -641,6 +641,10 @@ sub _loadSettings { ); $self->logger()->I($self->loc()->N("Load settings: %s content is <<%s>>", $key, $settings->{$key})); } + elsif (($key eq "icon" || $key eq "logo") && (substr( $read->{$key}, 0, 1) ne '/')) { + # icon with relative path? + $settings->{$key} = File::ShareDir::dist_file(ManaTools::Shared::distName(), $read->{$key}); + } else { $settings->{$key} = $read->{$key}; } @@ -825,11 +829,17 @@ sub _loadCategories { $tmp, 'title' ); + my $icon = $tmp->{icon}; + if ((substr( $icon, 0, 1) ne '/')) { + # icon with relative path? + $icon = File::ShareDir::dist_file(ManaTools::Shared::distName(), $tmp->{icon}); + } + $self->logger()->D($self->loc()->N("Load categories: module title is <<%s>>", $title)); if (not $currCategory->moduleLoaded($title)) { $tmpMod = ManaTools::Module->create( name => $title, - icon => $tmp->{icon}, + icon => $icon, launch => $tmp->{launcher} ); } -- cgit v1.2.1