… | |
… | |
336 | |
336 | |
337 | if ($flags & CS_QUERY_YESNO) { |
337 | if ($flags & CS_QUERY_YESNO) { |
338 | $vbox->add (my $hbox = new CFClient::UI::HBox); |
338 | $vbox->add (my $hbox = new CFClient::UI::HBox); |
339 | $hbox->add (new CFClient::UI::Button |
339 | $hbox->add (new CFClient::UI::Button |
340 | text => "No", |
340 | text => "No", |
341 | connect_activate => sub { |
341 | on_activate => sub { |
342 | $self->send ("reply n"); |
342 | $self->send ("reply n"); |
343 | $dialog->destroy; |
343 | $dialog->destroy; |
344 | $self->{map_widget}->focus_in; |
344 | $self->{map_widget}->focus_in; |
345 | } |
345 | } |
346 | ); |
346 | ); |
347 | $hbox->add (new CFClient::UI::Button |
347 | $hbox->add (new CFClient::UI::Button |
348 | text => "Yes", |
348 | text => "Yes", |
349 | connect_activate => sub { |
349 | on_activate => sub { |
350 | $self->send ("reply y"); |
350 | $self->send ("reply y"); |
351 | $dialog->destroy; |
351 | $dialog->destroy; |
352 | }, |
352 | }, |
353 | ); |
353 | ); |
354 | |
354 | |
355 | $dialog->focus_in; |
355 | $dialog->focus_in; |
356 | |
356 | |
357 | } elsif ($flags & CS_QUERY_SINGLECHAR) { |
357 | } elsif ($flags & CS_QUERY_SINGLECHAR) { |
358 | $dialog->{tooltip} = "Press a key (click on the entry to make sure it has keyboard focus)"; |
358 | $dialog->{tooltip} = "Press a key (click on the entry to make sure it has keyboard focus)"; |
359 | $vbox->add (my $entry = new CFClient::UI::Entry |
359 | $vbox->add (my $entry = new CFClient::UI::Entry |
360 | connect_changed => sub { |
360 | on_changed => sub { |
361 | $self->send ("reply $_[1]"); |
361 | $self->send ("reply $_[1]"); |
362 | $dialog->destroy; |
362 | $dialog->destroy; |
363 | }, |
363 | }, |
364 | ); |
364 | ); |
365 | |
365 | |
… | |
… | |
368 | } else { |
368 | } else { |
369 | $dialog->{tooltip} = "Enter the reply and press return (click on the entry to make sure it has keyboard focus)"; |
369 | $dialog->{tooltip} = "Enter the reply and press return (click on the entry to make sure it has keyboard focus)"; |
370 | |
370 | |
371 | $vbox->add (my $entry = new CFClient::UI::Entry |
371 | $vbox->add (my $entry = new CFClient::UI::Entry |
372 | $flags & CS_QUERY_HIDEINPUT ? (hiddenchar => "*") : (), |
372 | $flags & CS_QUERY_HIDEINPUT ? (hiddenchar => "*") : (), |
373 | connect_activate => sub { |
373 | on_activate => sub { |
374 | $self->send ("reply $_[1]"); |
374 | $self->send ("reply $_[1]"); |
375 | $dialog->destroy; |
375 | $dialog->destroy; |
376 | }, |
376 | }, |
377 | ); |
377 | ); |
378 | |
378 | |