private void async_update_queue_status(string queue) { G_ListView view; Fax.FaxQueue q = null; Fax.FaxRecQueue rq = null; view = lv; switch (queue) { case "sendq": view = lv; break; case "doneq": view = jobsCompletedView; break; case "recvq": view = jobsReceivedView; break; } if (Settings.TransmitAgent == "hylafax") { // Progressbar pulser - add this when we have async comms GLib.Timeout.Add((uint)(100), new TimeoutHandler(queue_progress)); // update status bar Appbar.ClearStack(); Appbar.Push(Catalog.GetString("Refreshing queue...")); Appbar.Refresh(); //GLib.MainContext.Iteration (); while (Gtk.Application.EventsPending()) { Gtk.Application.RunIteration(); } Fax.async_get_queue_status(queue); } if (Settings.TransmitAgent == "efax") { async_update_listview(Fax.async_get_queue_status(queue), queue); } }
private void async_update_listview(ArrayList reply, string queue) { G_ListView view; Fax.FaxQueue q = null; Fax.FaxRecQueue rq = null; view = lv; switch (queue) { case "sendq": view = lv; break; case "doneq": view = jobsCompletedView; break; case "recvq": view = jobsReceivedView; break; } if (reply.Count > 0) { StatusStore.Clear(); RecvStore.Clear(); IEnumerator enu = reply.GetEnumerator(); if (queue == "sendq" || queue == "doneq") { while (enu.MoveNext()) { q = (Fax.FaxQueue)enu.Current; view.AddTextToRow(GetFaxStatusIcon(q.StatusType), q.Jobid, q.Number, q.Status, q.Owner, q.Pages, q.Dials, q.Sendat, q.Error); } Appbar.ClearStack(); if (q.Jobid != "") { Appbar.Push(Catalog.GetString("There are " + reply.Count + " jobs in the queue")); Appbar.Refresh(); //((Gtk.Window) gxml["Gfax"]).Title = "Gfax (" + reply.Count + ")"; GfaxWindow.Title = "Gfax (" + reply.Count + ")"; //return reply.Count; return; } else { Appbar.Push(Catalog.GetString("There are 0 jobs in the queue")); Appbar.Refresh(); //((Gtk.Window) gxml["Gfax"]).Title = "Gfax"; GfaxWindow.Title = "Gfax"; } } else //receive queue { while (enu.MoveNext()) { rq = (Fax.FaxRecQueue)enu.Current; view.AddTextToRow(GetFaxStatusIcon(rq.StatusType), rq.Sender, rq.Status, rq.Pages, rq.TimeReceived, rq.Filename); } if (rq.Sender != "") { Appbar.Push(Catalog.GetString("There are " + reply.Count + " jobs in the queue")); Appbar.Refresh(); //((Gtk.Window) gxml["Gfax"]).Title = "Gfax (" + reply.Count + ")"; GfaxWindow.Title = "Gfax (" + reply.Count + ")"; //return reply.Count; return; } else { Appbar.Push(Catalog.GetString("There are 0 jobs in the queue")); Appbar.Refresh(); //((Gtk.Window) gxml["Gfax"]).Title = "Gfax"; GfaxWindow.Title = "Gfax"; } } oldSendQueue = reply; // else save queue } StatusStore.Clear(); RecvStore.Clear(); }