Commit 4a712960 authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Refine handling of the libdir for icon purposes

parent 2ebfd0e7
......@@ -30,6 +30,7 @@ sub Populate {
$self->SUPER::Populate($args);
$self->{'label'} = $self->add('Label', -text => $text, -justify => 'left', )->pack(-side => 'right') if (defined $text);
Tk::FIJIUtils::set_icon($self);
$self->{'label'}->configure(-wraplength => $wraplength) if (defined $wraplength);
$self->{'image'} = $self->add('Label', -image => $image)->pack(-side => 'left') if (defined $image);
}
......
......@@ -82,7 +82,7 @@ sub Populate {
$self->{'delete_mw'} = delete $args->{'-delete_mw'};
$self->{'mw'} = delete $args->{'-mw'};
my $icon_path = delete $args->{'-icon_path'};
my $lib_path = delete $args->{'-lib_path'};
if (!defined($settings) || !blessed($settings) || !$settings->isa("FIJI::Settings")) {
$logger->error("Given settings are not of type FIJI::Settings. No way to report this back from the constructor...");
......@@ -114,9 +114,9 @@ sub Populate {
);
$self->update();
$self->{'mw'} = $self->toplevel;
$delete_image = $self->Photo(-file => File::Spec->catfile($icon_path, 'delete_48x48.xpm'), -format => 'XPM');
$error_image = $self->Photo(-file => File::Spec->catfile($icon_path, 'stop_48x48.xpm'), -format => 'XPM');
$alert_image = $self->Photo(-file => File::Spec->catfile($icon_path, 'alert_48x48.xpm'), -format => 'XPM');
$delete_image = $self->Photo(-file => File::Spec->catfile($lib_path, 'delete_48x48.xpm'), -format => 'XPM');
$error_image = $self->Photo(-file => File::Spec->catfile($lib_path, 'stop_48x48.xpm'), -format => 'XPM');
$alert_image = $self->Photo(-file => File::Spec->catfile($lib_path, 'alert_48x48.xpm'), -format => 'XPM');
}
sub netlist {
......
......@@ -120,7 +120,7 @@ sub Populate {
$self->{'queue_from_worker'} = delete $args->{'-queue_from_worker'};
$self->{'log_queue'} = delete $args->{'-log_queue'};
$self->{'open_pdf_sub'} = delete $args->{'-open_pdf_sub'};
my $icon_path = delete $args->{'-icon_path'};
my $lib_path = delete $args->{'-lib_path'};
if (!defined $self->{'open_pdf_sub'}) {
$self->{'open_pdf_sub'} = sub { $logger->error("No CODE reference passed in -open_pdf_sub"); };
......@@ -160,7 +160,7 @@ sub Populate {
$self->{'Downloader'} = FIJI::Downloader->new(undef, undef, $self->{'tests'}, undef, $self->{'settings'});
}
$error_image = $self->Photo(-file => File::Spec->catfile($icon_path, 'stop_48x48.xpm'), -format => 'XPM');
$error_image = $self->Photo(-file => File::Spec->catfile($lib_path, 'stop_48x48.xpm'), -format => 'XPM');
$self->SUPER::Populate($args);
$self->_populate_widget($self);
......
......@@ -2,9 +2,11 @@ package Tk::FIJIUtils;
use Scalar::Util 'blessed';
use constant SCROLL => 5;
use FIJI qw(:fiji_dir);
sub set_icon ($$) {
my ($mw, $libdir) = @_;
sub set_icon ($) {
my ($mw) = @_;
my $libdir = File::Spec->catdir(FIJI_DIR, "media");
my $fiji_icon;
if ($^O eq "MSWin32") {
my $icon_base = File::Spec->rel2abs('fiji_logo', $libdir);
......
......@@ -243,7 +243,7 @@ sub main {
$save_image = $mw->Photo(-file => File::Spec->catfile($libdir, 'save_24x24.xpm'), -format => 'XPM');
$dummy_image = $mw->Photo(-file => File::Spec->catfile($libdir, 'dummy_24x24.xpm'), -format => 'XPM');
Tk::FIJIUtils::set_icon($mw, $libdir);
Tk::FIJIUtils::set_icon($mw);
### Load settings
......@@ -335,7 +335,7 @@ sub main {
-test_callback => sub { my $value = shift; $self->{'export_menuentry'}->configure(-state => ($value > 0) ? "normal" : "disabled")},
-mw => $self->{'mw'},
-delete_mw => [\&_onexit, $self],
-icon_path => $libdir,
-lib_path => $libdir,
-tests => $self->{'tests'},
-settings => $self->{'settings'},
-worker => $worker_tid,
......
......@@ -76,7 +76,7 @@ my $error_image;
my $alert_image;
my $save_image;
my $dummy_image;
my $loading_image;
my $logo_image;
my $current_dir = ".";
my $splash;
my $do_splash;
......@@ -157,7 +157,7 @@ sub main {
$alert_image = $mw->Photo(-file => File::Spec->catfile($libdir, 'alert_48x48.xpm'), -format => 'XPM');
$save_image = $mw->Photo(-file => File::Spec->catfile($libdir, 'save_24x24.xpm'), -format => 'XPM');
$dummy_image = $mw->Photo(-file => File::Spec->catfile($libdir, 'dummy_24x24.xpm'), -format => 'XPM');
$loading_image = $mw->Photo(-file => File::Spec->catfile($libdir, 'fiji_logo_hires.xpm'), -format => 'XPM');
$logo_image = $mw->Photo(-file => File::Spec->catfile($libdir, 'fiji_logo_hires.xpm'), -format => 'XPM');
$self->{'mw'} = $mw;
$self->{'ctrl'} = _ctrl_frame($self, $mw);
......@@ -177,7 +177,7 @@ sub main {
-mw => $self->{'mw'},
-delete_mw => [\&_onexit, $self],
-settings => $self->{'settings'},
-icon_path => $libdir,
-lib_path => $libdir,
-changes_callback => sub { my $set = shift; _indicate_changes($self, $set) },
)->pack(
'-fill' => 'both',
......@@ -186,7 +186,7 @@ sub main {
$mw->protocol('WM_DELETE_WINDOW' => [\&_onexit, $self]);
Tk::FIJIUtils::set_icon($mw, $libdir);
Tk::FIJIUtils::set_icon($mw);
$self->{'FIJISettingsViewer'}->append_fiu(); # add dummy FIU for layouting purposes
$self->{'FIJISettingsViewer'}->set_state_as_original(); # no unsaved indicator
......@@ -196,7 +196,7 @@ sub main {
$mw->resizable(1, 1);
$splash=$mw->toplevel->Frame();
$splash->Label(-font => [-size => 16], -text => "Loading Netlist - Please wait...",-height=>2,)->pack(-side=>'bottom',-fill=>'both');
$splash->Label(-image => $loading_image)->pack(-side=>'bottom',-expand=>1,-fill=>'both');
$splash->Label(-image => $logo_image)->pack(-side=>'bottom',-expand=>1,-fill=>'both');
$mw->update();
#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment