Commit fba8bd36 authored by Christian Fibich's avatar Christian Fibich Committed by Stefan Tauner
Browse files

Warning indicators in FIJI Setup

* Created a method for updating all warning indicators next to the Tab names
* Corrected behavior when the FIUs indicator is on and the causing FIU is deleted
parent 090c2671
......@@ -344,6 +344,8 @@ sub update {
##############
my $parent = $self->{'fr_fius'}->parent();
my $fiu_displaygroup = DISPLAYGROUPS_FIU_KEY;
undef($self->{'highlit_widgets'}->{$fiu_displaygroup});
$parent->packForget(); # This and the next line would be redundant if
$self->{'fr_fius'}->destroy(); # the $parent->destroy() call would work.
$self->_add_fiu_frame($parent->parent());
......@@ -380,6 +382,7 @@ sub update {
$self->_add_fiu($fiu_ref, $i);
}
$self->_update_warning_indicators($fiu_displaygroup);
$self->_update_resources();
$self->{'settings_canvas'}->configure(-settings_ref => \($self->{'settings'})) if defined $self->{'settings_canvas'};
......@@ -803,6 +806,7 @@ sub _populate_widget {
);
$self->_add_fiu_panel($config_frame);
}
# This is the Tk::Trace callback for FIJI::Settings.
......@@ -1507,7 +1511,8 @@ sub _select_net_dialog {
my $sel = $select_net_dialog->FIJINetSelection(-nets =>$self->{'nets'}, -selected_nets_listref=>$netname_listref, -select_multiple=>$select_multiple);
$sel->pack(-expand=>1,-fill=>'both',-padx=>5,-pady=>5);
Tk::FIJIUtils::set_icon($select_net_dialog);
$select_net_dialog->Show();
my $rv = $select_net_dialog->Show();
undef(@{$netname_listref}) if ($rv eq 'Cancel');
return undef;
}
......@@ -1731,14 +1736,29 @@ sub _indicate_warning ($$) {
delete $self->{'highlit_widgets'}->{$displaygroup}->{$name} if defined $self->{'highlit_widgets'}->{$displaygroup}->{$name};
}
# if the hash for the current displaygroup is not empty, add the
# tab indicator
if (keys(%{$self->{'highlit_widgets'}->{$displaygroup}}) > 0) {
$title .= " [!]";
$logger->debug("Displaygroup $displaygroup contains highlit widgets. Indicator on.");
$self->_update_warning_indicators($displaygroup);
}
sub _update_warning_indicators {
my $logger = get_logger("");
my ($self, $displaygroup) = @_;
my $displaygroups = [$displaygroup];
if (!defined $displaygroup) {
$displaygroups = DISPLAYGROUPS;
}
$self->{'nb'}->pageconfigure($displaygroup, -label=>$title);
foreach my $d (@{$displaygroups}) {
my $title = DISPLAYGROUPS->{$displaygroup}->{'title'};
$title .= ": " . DISPLAYGROUPS->{$displaygroup}->{'subtitle'} if DISPLAYGROUPS->{$displaygroup}->{'subtitle'} ne "";
if (keys(%{$self->{'highlit_widgets'}->{$d}}) > 0) {
$title .= " [!]";
$logger->debug("Displaygroup $d contains highlit widgets. Indicator on.");
}
$self->{'nb'}->pageconfigure($displaygroup, -label=>$title);
}
}
sub set_state_as_original {
......
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