# # # patch "netsync.cc" # from [d3eb91d64064c55ae2854a6c971cb011eb3ae59f] # to [46b2312fc42b96d7920491b8e4f7b65c33fc7118] # # patch "refiner.cc" # from [6e80c65a1f4828f79ebe8aee7244137feb5959e0] # to [bdd5b3093fa59253e64ec0de0273058b97af994a] # # patch "ui.cc" # from [c51b1607975f692479563b70efd80c40731ea83a] # to [9544a3fa1a5de8eb280b0bee314f53cde270964f] # # patch "ui.hh" # from [2bedf507a3a2f5aa202e7cf38965822f5771c817] # to [76ebb302ccb046a38367933123f7569af2d011f3] # ============================================================ --- netsync.cc d3eb91d64064c55ae2854a6c971cb011eb3ae59f +++ netsync.cc 46b2312fc42b96d7920491b8e4f7b65c33fc7118 @@ -307,6 +307,7 @@ } protocol_state; bool encountered_error; + bool set_totals; // Interface to refinement. refiner epoch_refiner; @@ -477,6 +478,7 @@ dbw(app, true), protocol_state(working_state), encountered_error(false), + set_totals(false), epoch_refiner(epoch_item, voice, *this), key_refiner(key_item, voice, *this), cert_refiner(cert_item, voice, *this), @@ -719,6 +721,23 @@ && cert_refiner.done && key_refiner.done && epoch_refiner.done; + + if (all && !set_totals) + { + if (cert_out_ticker.get()) + cert_out_ticker->set_total(cert_refiner.items_to_send.size()); + + if (revision_out_ticker.get()) + revision_out_ticker->set_total(rev_refiner.items_to_send.size()); + + if (cert_in_ticker.get()) + cert_in_ticker->set_total(cert_refiner.items_to_receive); + + if (revision_in_ticker.get()) + revision_in_ticker->set_total(rev_refiner.items_to_receive); + + set_totals = true; + } return all; } ============================================================ --- refiner.cc 6e80c65a1f4828f79ebe8aee7244137feb5959e0 +++ refiner.cc bdd5b3093fa59253e64ec0de0273058b97af994a @@ -178,13 +178,10 @@ calculate_items_to_send(); items_to_receive = n_items; - - if (type == revision_item || type == cert_item) - { - P(F("finished %s refinement: %d to send, %d to receive") - % typestr % items_to_send.size() % items_to_receive); - } + L(F("finished %s refinement: %d to send, %d to receive") + % typestr % items_to_send.size() % items_to_receive); + if (voice == server_voice) cb.queue_done_cmd(type, items_to_send.size()); ============================================================ --- ui.cc c51b1607975f692479563b70efd80c40731ea83a +++ ui.cc 9544a3fa1a5de8eb280b0bee314f53cde270964f @@ -27,7 +27,9 @@ bool kilocount) : ticks(0), mod(mod), + total(0), kilocount(kilocount), + use_total(false), name(tickname), shortname(s) { @@ -127,6 +129,11 @@ i->second->mod = static_cast(div / 10.0); count = (F(message) % (i->second->ticks / div)).str(); } + else if (i->second->use_total) + { + // xgettext: bytes + count = (F("%d/%d") % i->second->ticks % i->second->total).str(); + } else { // xgettext: bytes ============================================================ --- ui.hh 2bedf507a3a2f5aa202e7cf38965822f5771c817 +++ ui.hh 76ebb302ccb046a38367933123f7569af2d011f3 @@ -21,11 +21,14 @@ { size_t ticks; size_t mod; + size_t total; bool kilocount; + bool use_total; std::string name; std::string shortname; ticker(std::string const & n, std::string const & s, size_t mod = 64, bool kilocount=false); + void set_total(size_t tot) { use_total = true; total = tot; } void operator++(); void operator+=(size_t t); ~ticker();