X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=submit%2Fcontest;h=0c2e0227a98528727a41b675f90ea7fdc67fcae6;hb=9306a593e097b30b55196f0fb7dd7c189389a0d3;hp=0246cadf680d33b4793d61b08750928d147cb435;hpb=3717439c7ae2a6188b4bb396cb9daf7da188ba5c;p=eval.git diff --git a/submit/contest b/submit/contest index 0246cad..0c2e022 100755 --- a/submit/contest +++ b/submit/contest @@ -159,7 +159,7 @@ sub start_refresh_timer($) { my ($go) = @_; stop_refresh_timer(); refresh() if $go; - $refresh_timer_id = Glib::Timeout->add(5000, \&timed_refresh); + $refresh_timer_id = Glib::Timeout->add($conn->{"RefreshTimer}, \&timed_refresh); } sub stop_refresh_timer() { @@ -308,8 +308,19 @@ sub submit_failed($) { } sub run_submit() { + my ($task, $part) = split /\//, $selected_task; + defined $part or $part = $task; + + if (defined $conn->{"History"}) { + busy("Submitting locally"); + my $err = $conn->local_submit($task, $part, $submit_extension, $submit_filename); + if (defined $err) { + submit_failed("Recording to local history failed\n($err)"); + return; + } + } + if ($conn->is_connected) { - ### FIXME: Busy cursor should be started earlier busy("Checking server status..."); my $r = new Sherlock::Object("!" => "STATUS"); ### FIXME: use a NOP command $r = $conn->request($r); @@ -319,13 +330,11 @@ sub run_submit() { if (!$conn->connect) { ready($conn->{"error"}); submit_failed("Unable to connect to the server"); ### FIXME: Mention local submit + return; } } busy("Submitting..."); - my ($task, $part) = split /\//, $selected_task; - defined $part or $part = $task; - my $fh = new IO::File($submit_filename); if (!$fh) { submit_failed("Unable to open $submit_filename\n($!)");