aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/Shared/GUI.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AdminPanel/Shared/GUI.pm')
-rw-r--r--lib/AdminPanel/Shared/GUI.pm21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/AdminPanel/Shared/GUI.pm b/lib/AdminPanel/Shared/GUI.pm
index a31c451..f5fdc43 100644
--- a/lib/AdminPanel/Shared/GUI.pm
+++ b/lib/AdminPanel/Shared/GUI.pm
@@ -687,17 +687,26 @@ sub ask_fromTreeList {
last;
}
elsif ($widget == $selectButton) {
+ $DB::single = 1;
my $item = $treeWidget->selectedItem();
if ($info->{skip_path} && $info->{skip_path} != 0) {
$choice = $item->label() if ($item);
}
else {
- my $separator = exists $info->{item_separator} ? $info->{item_separator} : '/';
- if ($item) {
- $choice = $item->label();
- my $parent = $item;
- while($parent = $parent->parent()) {
- $choice = $parent->label() . $separator . $choice ;
+ my $getChoice = 1;
+ if (!exists $info->{any_item_selection} || $info->{any_item_selection} != 0) {
+ if ($item) {
+ $getChoice = (!$item->hasChildren());
+ }
+ }
+ if ($getChoice) {
+ my $separator = exists $info->{item_separator} ? $info->{item_separator} : '/';
+ if ($item) {
+ $choice = $item->label();
+ my $parent = $item;
+ while($parent = $parent->parent()) {
+ $choice = $parent->label() . $separator . $choice ;
+ }
}
}
}