#Created by Paul W. Elsinghorst --- /usr/src/lfs/mlurlslave-v1/mlurlslave 2002-06-28 13:04:00.000000000 +0200 +++ /usr/bin/mlurlslave 2004-01-08 21:30:04.689073056 +0100 @@ -29,7 +29,7 @@ $true=1; use IO::Socket; -use Gtk; +use Gtk2; sub main{ my($url); @@ -49,30 +49,27 @@ print($client "auth ".$config{"password"}."\n") unless($config{"password"} eq ""); print($client "dllink ".$url."\n"); while(<$client>){ - if(/Bad login\/password/){ + if(/Bad/){ &exit_client($client); &show_error("Authentication Failure","Unable to log into mldonkey: Wrong password. Hint: ".$config_file); } - elsif(/Command not authorized/){ + elsif(/Command/){ &exit_client($client); &show_error("Authentication Failure","Unable to log into mldonkey: Need to authenticate. Password set? Hint: ".$config_file); } - elsif(/Full access enabled/){ - $SIG{ALRM}=sub{ - &exit_client($client); - &show_error("Queue Timeout","Timeout while adding the URL to download to your queue. However the file might have been successfully added, please check. See FAQ for possible reasons."); - }; - alarm($config{"queue_timeout"}); + elsif(/Failure/){ + &exit_client($client); + &show_error("Already Downloading","You are already downloading this file."); } - elsif(/bad syntax/){ + elsif(/Syntax/){ &exit_client($client); &show_error("URL Syntax Error","URL submitted does not look like a proper ed2k:// URL."); } - elsif(/exception \[DownloadTypes.Already_done\]/){ + elsif(/Not_found/){ &exit_client($client); - &show_error("Already Downloading","You are already downloading this file."); + &show_error("URL Syntax Error","URL submitted does not look like a proper ed2k:// URL."); } - elsif(/download started/){ + elsif(/Done/){ &exit_client($client); &show_success("Download Started",$url); } @@ -178,28 +175,28 @@ alarm(0); my($title,$msg)=@_; my($window,$button,$label,$vbox); - init Gtk; - $window=new Gtk::Window("toplevel"); - $button=new Gtk::Button("OK"); + init Gtk2; + $window=new Gtk2::Window("toplevel"); + $button=new Gtk2::Button("OK"); $window->signal_connect("delete_event",\&close_window); $button->signal_connect("clicked",\&close_window); $window->border_width(15); $window->set_title($title); $window->set_position("center"); - $label=new Gtk::Label($msg); + $label=new Gtk2::Label($msg); $label->set_line_wrap($true); - $vbox=new Gtk::VBox($false,0); + $vbox=new Gtk2::VBox($false,0); $vbox->pack_start($label,$false,$false,$false); $vbox->pack_start($button,$false,$false,$false); $window->add($vbox); $window->show_all(); - main Gtk; + main Gtk2; exit(0); } sub close_window{ # GTK exit method for &show_window() - Gtk->exit(0); + Gtk2->exit(0); return($false); }