Commit 5382a9be authored by Stefan Tauner's avatar Stefan Tauner
Browse files

FIJISettingsViewer: inform user if a single driver was found (and selected)

However, allow the user to disable these popups for the current session.
parent 293a0ad7
......@@ -62,6 +62,10 @@ Construct Tk::Widget 'FIJISettingsViewer';
my $widget_background;
my $widget_ro_background;
# Remember if the user does not want to see the information message about
# automatic driver selection for nets with a single driver.
my $show_single_driver_info = 1;
sub ClassInit {
my ($class, $mw) = @_;
$class->SUPER::ClassInit($mw);
......@@ -946,11 +950,14 @@ sub _add_multiple_fius {
$self->_add_fiu($fiu,$i);
# check if this net is already instrumented
my $rvn = _validate_fiu_net($self,$i);
# try to validate the selected driver
# this will likely fail if a different net has been selected
my $rvn = _validate_fiu_net($self, $i);
$self->{'mw'}->Busy;
my $rvd = _validate_single_fiu_driver($self,$i);
# Unset previously selected driver.
# This forces the validation call to immediately prompt
# the user for a new one.
undef $fiu->{'FIU_DRIVER_PATH'};
my $drv = _select_driver_dialog($self, $i);
my $rvd = _validate_single_fiu_driver($self, $i);
$self->{'mw'}->Unbusy;
if (defined $rvd || defined $rvn) {
......@@ -1074,9 +1081,11 @@ sub _add_fiu ($$) {
$self->_set_fields(1, $net_entry->{'dependents'});
# check if this net is already instrumented
my $rvn = _validate_fiu_net($self,$i);
# try to validate the selected driver
# this will likely fail if a different net has been selected
$self->{'mw'}->Busy;
# Unset previously selected driver.
# This forces the validation call to immediately prompt
# the user for a new one.
undef $fiu->{'FIU_DRIVER_PATH'};
my $rvd = _validate_single_fiu_driver($self,$i);
$self->{'mw'}->Unbusy;
$self->_indicate_warning($drv_entry, (defined $rvd));
......@@ -1757,7 +1766,20 @@ sub _select_driver_dialog($) {
} else {
FIJI::Netlist->connection_tostr(@{$possible_drivers}[0], $conn_str_list);
$sel = @{$conn_str_list}[0];
$logger->info("Automatically selecting ".$sel->{'type'}.": ".$sel->{'path'}." as a driver for $netpath as there's only one option");
my $msg = "Automatically selecting ".$sel->{'type'}.": ".$sel->{'path'}." as a driver for $netpath as there's only one option";
$logger->info($msg);
if ($show_single_driver_info == 1) {
my $info_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::info_image($self->{'mw'}),
-text => "$msg",
-title => "Info",
);
my $cb = $info_dialog->Subwidget('bottom')->Checkbutton(-text => "Do not show this message in this session again.")->pack(-side => 'left');
$info_dialog->Show();
$show_single_driver_info = !$cb->{'Value'};
}
}
$self->{'settings'}->{'fius'}[$fiu_idx]->{'FIU_DRIVER_PATH'} = $sel->{'path'};
......
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