Permalink
Browse files

* BBBikeMail: removed support for sending fax

  This rather obscure feature was never used in the Perl/Tk app, and
  it required a private perl library Fax::Send, which itself required
  additional OS support (e.g. mgetty+sendfax).
  • Loading branch information...
1 parent 8dfa6aa commit ce290985b7e1c66760c74c89c491dde7b9bcbc0e @eserte committed Mar 10, 2013
Showing with 13 additions and 50 deletions.
  1. +12 −48 BBBikeMail.pm
  2. +1 −1 bbbike
  3. +0 −1 msg/bbbike/en
View
60 BBBikeMail.pm
@@ -1,10 +1,9 @@
# -*- perl -*-
#
-# $Id: BBBikeMail.pm,v 1.21 2008/01/20 22:43:25 eserte Exp $
# Author: Slaven Rezic
#
-# Copyright (C) 1998,2000,2003 Slaven Rezic. All rights reserved.
+# Copyright (C) 1998,2000,2003,2013 Slaven Rezic. All rights reserved.
# This package is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
@@ -15,9 +14,9 @@
package BBBikeMail;
use strict;
use vars qw($top @popup_style
- $can_send_mail $can_send_mail_via_Mail_Mailer $can_send_fax
+ $can_send_mail $can_send_mail_via_Mail_Mailer
$cannot_send_mail_via_Mail_Mailer
- $cannot_send_mail_reason $cannot_send_fax_reason);
+ $cannot_send_mail_reason);
*top = \$main::top;
*redisplay_top = \&main::redisplay_top;
@@ -27,25 +26,19 @@ sub enter_send_mail {
enter_send_anything('mail', @_);
}
-sub enter_send_fax {
- enter_send_anything('fax', @_);
-}
-
sub enter_send_anything {
my($type, $subject, %args) = @_;
my $data = $args{-data};
my $to = $args{-to};
- my $typename = ($type eq 'mail' ? 'Mail' : 'FAX');
+ my $typename = ($type eq 'mail' ? 'Mail' : die "unhandled type $type");
capabilities();
- if (($type eq 'mail' && !$can_send_mail) ||
- ($type eq 'fax' && !$can_send_fax)) {
- my $reason = ($type eq 'mail' ? $cannot_send_mail_reason : $cannot_send_fax_reason);
+ if ($type eq 'mail' && !$can_send_mail) {
+ my $reason = $cannot_send_mail_reason;
$top->messageBox
(-icon => "error",
- -message => "Kann keine " .
- ($type eq 'mail' ? 'Mails' : 'Faxe') . ' versenden' .
+ -message => "Kann keine Mails versenden" .
(defined $reason && $reason ne '' ?
". Grund: $reason" : ""),
);
@@ -64,10 +57,9 @@ sub enter_send_anything {
my $t = redisplay_top($top, $type, -title => $typename);
return if !defined $t;
my $row = 0;
- $t->Label(-text => "$typename an" . ($type eq 'fax' ? " (Faxnummer)" : "")
- . ":")->grid(-row => $row,
- -column => 0,
- -sticky => "e");
+ $t->Label(-text => "$typename an:")->grid(-row => $row,
+ -column => 0,
+ -sticky => "e");
my $e;
if ($type eq 'mail') {
my $mail_alias;
@@ -95,7 +87,7 @@ sub enter_send_anything {
$e->tabFocus;
$row++;
my $comment_txt;
- if ($type ne 'fax') {
+ if ($type eq 'mail') {
$t->Label(-text => "Subject")->grid(-row => $row,
-column => 0,
-sticky => "e");
@@ -128,13 +120,7 @@ sub enter_send_anything {
return 0;
}
} else {
- if (defined $to && $to ne '') {
- send_fax($to, undef, $data);
- return 1; # XXX is it possible to check send_fax return value?
- } else {
- main::status_message("Bitte Empfänger angeben!", "err");
- return 0;
- }
+ die "Handling type $type NYI";
}
};
my $ok_window = sub {
@@ -238,21 +224,6 @@ sub create_mailto_url {
$url;
}
-sub send_fax {
- my($to, $subject, $data) = @_;
- eval {
- require Fax::Send;
- my $msg = new Fax::Send
- -recipients => $to,
- -data => $data;
- $msg->send;
- };
- if ($@) {
- $top->bell;
- status_message("Fehler: $@\nMöglicherweise ist kein Faxprogramm vorhanden.\nFür das Versenden von FAXen XXX ist das Modul Fax::Send\nund ein Faxprogramm wie hylafax oder mgetty+sendfax erforderlich.\n", 'error');
- }
-}
-
sub capabilities {
$can_send_mail = 1; # via browser
eval {
@@ -266,13 +237,6 @@ sub capabilities {
if (!$can_send_mail) {
$cannot_send_mail_reason = $@;
}
- eval {
- require Fax::Send;
- $can_send_fax = 1;
- };
- if (!$can_send_fax) {
- $cannot_send_fax_reason = $@;
- }
}
# peacify -w
View
2 bbbike
@@ -115,7 +115,7 @@ use BBBikeGlobalVars 1.012;
# "autouse" cannot be used on modules with non-standard import functions
BEGIN {
%autouse_func =
- ('BBBikeMail' => [qw(enter_send_mail enter_send_fax)],
+ ('BBBikeMail' => [qw(enter_send_mail)],
'Text::Wrap' => [qw(wrap)],
'File::Copy' => [qw(copy mv)],
'BBBikeGPS'
View
1 msg/bbbike/en
@@ -132,7 +132,6 @@ $lang_messages = {
'Farbe (Pixmap)' => 'Color (Pixmap)',
'Farbeinstellung beim Drucken' => 'Color setting for printing',
'Farben ändern' => 'Change colors',
-'Fax' => 'Fax',
'Fehlerausgabe auf stderr' => 'Errors to stderr',
'Film auswählen' => 'Choose movie',
'Flaches Relief' => 'Flat relief',

0 comments on commit ce29098

Please sign in to comment.