Commit 3c56dc9e authored by Stefan Tauner's avatar Stefan Tauner
Browse files

FIJISettingsViewer: do not log errors in _select_driver_dialog directly

Instead, let the caller of _select_driver_dialog handle the error messages
return by it. This fixes the output when one tries to select a driver without
a loaded netlist.

Also, fix a minor bug in the invocation of the DialogBoxUL that shows
the net selection.
parent 776895d3
......@@ -1395,10 +1395,9 @@ sub _select_net_dialog {
$title = "Select Net" if (!defined $title);
my $d = $self->MainWindow->DialogBox(
my $d = $self->MainWindow->DialogBoxUL(
-title => $title,
-buttons => [qw/~OK ~Cancel/],
-default_button =>' OK'
);
$d->bind('<Return>', => sub {});
......@@ -1422,9 +1421,7 @@ sub _select_driver_dialog($) {
my $driver_path = $self->{'settings'}->{'fius'}[$fiu_idx]->{'FIU_DRIVER_PATH'};
if (!defined $self->{'netlist'}) {
my $msg = "Cannot select driver (yet). No netlist loaded.";
$logger->error($msg);
return $msg;
return "Cannot select driver (yet). No netlist loaded.";
}
# get a hash of connected objects from the netlist object
......@@ -1434,9 +1431,7 @@ sub _select_driver_dialog($) {
return $rv if (defined($rv));
if (@{$connections{'drivers'}} > 1) {
my $msg = "More than one driver found for a single net ($netpath)!";
$logger->error($msg);
return $msg;
return "More than one driver found for a single net ($netpath)!";
}
my $possible_drivers;
......@@ -1448,16 +1443,14 @@ sub _select_driver_dialog($) {
# if the netlist object could not identify the driver on its own
if (@{$connections{'connected'}} == 0) {
my $msg = "No possible drivers found for net \"$netpath\"!";
$logger->error($msg);
return $msg;
return "No possible drivers found for net \"$netpath\"!";
}
# if there is more than one possible object, the user must select the correct driver...
$possible_drivers = $connections{'connected'};
}
# Build the DialogBox
my $d = $self->DialogBox(-title => "Driver for FIU $fiu_idx", -buttons => ["~OK", "~Cancel"]);
my $d = $self->DialogBoxUL(-title => "Driver for FIU $fiu_idx", -buttons => ["~OK", "~Cancel"]);
my $f = $d->add('Frame');
Tk::FIJIUtils::set_icon($d);
......
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