Permalink
Browse files

* Current route window: no Mail button if capabilities are not met

  Especially this means that currently there's no Mail button on
  Windows anymore.
  • Loading branch information...
1 parent 7a4092a commit 0273fc4a1791f1290d82e3482322b59a619b3641 @eserte committed Mar 10, 2013
Showing with 23 additions and 12 deletions.
  1. +23 −12 bbbike
View
35 bbbike
@@ -18267,18 +18267,20 @@ sub show_route_strname {
(-text => M"Drucken",
-command => sub { $print_text_sub->($ps_fixed_font||"Courier7") },
);
- push @bfb, $bf->Button
- (-text => M"Mail",
- -command => sub {
- if (@route_info) {
- $show_route_start = "???" unless $show_route_start;
- $show_route_ziel = "???" unless $show_route_ziel;
- enter_send_mail
- (Mfmt("BBBike-Route von %s bis %s",
- $show_route_start, $show_route_ziel),
- -data => route_info_to_text());
- }
- });
+ if (_can_send_mail()) {
+ push @bfb, $bf->Button
+ (-text => M"Mail",
+ -command => sub {
+ if (@route_info) {
+ $show_route_start = "???" unless $show_route_start;
+ $show_route_ziel = "???" unless $show_route_ziel;
+ enter_send_mail
+ (Mfmt("BBBike-Route von %s bis %s",
+ $show_route_start, $show_route_ziel),
+ -data => route_info_to_text());
+ }
+ });
+ }
$t->bind('<Up>' => sub { $route_strname_lbox->yview(scroll => -1,
'units') });
$t->bind("<Down>" => sub { $route_strname_lbox->yview(scroll => 1,
@@ -20306,6 +20308,7 @@ sub show_logo { # und About
)->pack(-anchor => 'w', -expand => 1,
-fill => 'x');
}
+
# Send mail to software maintainer
my $mail_b =
$f->$Button_or_Label
@@ -22186,6 +22189,14 @@ sub soft_flash {
$next_color_state->();
}
+sub _can_send_mail {
+ return $BBBikeMail::can_send_mail if defined $BBBikeMail::can_send_mail;
+
+ require BBBikeMail;
+ BBBikeMail::capabilities();
+ $BBBikeMail::can_send_mail;
+}
+
# REPO BEGIN
# REPO NAME tk_sleep /home/e/eserte/work/srezic-repository
# REPO MD5 6e344458a3a154eefaf7b82d5f9bb576

0 comments on commit 0273fc4

Please sign in to comment.