git-svn-id: svn://db.shs.com.ru/pip@82 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -116,8 +116,8 @@ void PIBaseTransfer::received(PIByteArray data) {
|
|||||||
case pt_Start:
|
case pt_Start:
|
||||||
if (is_pause && (is_sending || is_receiving)) {
|
if (is_pause && (is_sending || is_receiving)) {
|
||||||
if (header.session_id == h.session_id) {
|
if (header.session_id == h.session_id) {
|
||||||
resumed();
|
|
||||||
is_pause = false;
|
is_pause = false;
|
||||||
|
resumed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,14 +160,20 @@ void PIBaseTransfer::received(PIByteArray data) {
|
|||||||
break;
|
break;
|
||||||
case pt_Pause:
|
case pt_Pause:
|
||||||
if (header.session_id == h.session_id) {
|
if (header.session_id == h.session_id) {
|
||||||
if (!is_pause && pause_tm.elapsed_s() < timeout_) {
|
// piCout << "receive pause";
|
||||||
|
if (!is_pause && pause_tm.elapsed_s() < timeout_/10) {
|
||||||
|
// piCout << "resume";
|
||||||
sendReply(pt_Start);
|
sendReply(pt_Start);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (is_pause && pause_tm.elapsed_s() > timeout_/10) sendReply(pt_Pause);
|
|
||||||
pause_tm.reset();
|
|
||||||
if (!is_pause) paused();
|
if (!is_pause) paused();
|
||||||
is_pause = true;
|
is_pause = true;
|
||||||
|
if (is_receiving && pause_tm.elapsed_m() > 10) {
|
||||||
|
// piCout << "send pause";
|
||||||
|
sendReply(pt_Pause);
|
||||||
|
}
|
||||||
|
if (is_sending) send_tm.reset();
|
||||||
|
pause_tm.reset();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
@@ -196,6 +202,8 @@ bool PIBaseTransfer::send_process() {
|
|||||||
--i;
|
--i;
|
||||||
piMSleep(1);
|
piMSleep(1);
|
||||||
if (is_pause) {
|
if (is_pause) {
|
||||||
|
piMSleep(10);
|
||||||
|
// piCout << "send pause";
|
||||||
sendReply(pt_Pause);
|
sendReply(pt_Pause);
|
||||||
if (pause_tm.elapsed_s() > timeout())return finish_send(false);
|
if (pause_tm.elapsed_s() > timeout())return finish_send(false);
|
||||||
}
|
}
|
||||||
@@ -224,6 +232,7 @@ bool PIBaseTransfer::send_process() {
|
|||||||
}
|
}
|
||||||
if (is_pause) {
|
if (is_pause) {
|
||||||
piMSleep(10);
|
piMSleep(10);
|
||||||
|
// piCout << "send pause";
|
||||||
sendReply(pt_Pause);
|
sendReply(pt_Pause);
|
||||||
if (pause_tm.elapsed_s() > timeout())return finish_send(false);
|
if (pause_tm.elapsed_s() > timeout())return finish_send(false);
|
||||||
else continue;
|
else continue;
|
||||||
@@ -458,7 +467,7 @@ void PIBaseTransfer::finish_receive(bool ok, bool quet) {
|
|||||||
void PIBaseTransfer::diagChanged(PIDiagnostics::Quality new_quality, PIDiagnostics::Quality old_quality) {
|
void PIBaseTransfer::diagChanged(PIDiagnostics::Quality new_quality, PIDiagnostics::Quality old_quality) {
|
||||||
if (is_receiving) {
|
if (is_receiving) {
|
||||||
if (new_quality == PIDiagnostics::Failure) {
|
if (new_quality == PIDiagnostics::Failure) {
|
||||||
//piCout << "disconnected!";
|
piCout << "disconnected!";
|
||||||
stopReceive();
|
stopReceive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ Daemon::TileFileProgress::TileFileProgress(): PIScreenTile() {
|
|||||||
buttons = new TileButtons("fd_buttons");
|
buttons = new TileButtons("fd_buttons");
|
||||||
buttons->content << TileButtons::Button("Pause", CellFormat());
|
buttons->content << TileButtons::Button("Pause", CellFormat());
|
||||||
buttons->content << TileButtons::Button("Cancel", CellFormat());
|
buttons->content << TileButtons::Button("Cancel", CellFormat());
|
||||||
buttons->content << TileButtons::Button("Pause", CellFormat());
|
|
||||||
buttons->back_format.color_back = label_file->back_format.color_back = label_speed->back_format.color_back = Yellow;
|
buttons->back_format.color_back = label_file->back_format.color_back = label_speed->back_format.color_back = Yellow;
|
||||||
label_file->back_format.color_char = label_speed->back_format.color_char = Black;
|
label_file->back_format.color_char = label_speed->back_format.color_char = Black;
|
||||||
label_file->content.resize(1);
|
label_file->content.resize(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user