diff options
author | Martin Szulecki | 2009-03-20 11:00:59 +0100 |
---|---|---|
committer | Martin Szulecki | 2009-03-20 11:00:59 +0100 |
commit | 2f09cc7cd6c86ece05864055eca4ddfd78c03179 (patch) | |
tree | 0f313ff11a4cbc7b0161c643bd6dc13b45ff3bea /src | |
parent | 4e57bfa0652a3c4eb42c79ddbe7a1d00b4aea79c (diff) | |
download | gfax-2f09cc7cd6c86ece05864055eca4ddfd78c03179.tar.gz gfax-2f09cc7cd6c86ece05864055eca4ddfd78c03179.tar.bz2 |
Diffstat (limited to 'src')
-rwxr-xr-x | src/fax.cs | 6 | ||||
-rwxr-xr-x | src/gui.cs | 10 | ||||
-rwxr-xr-x | src/guitools.cs | 17 | ||||
-rwxr-xr-x | src/hylafax.cs | 11 |
4 files changed, 30 insertions, 14 deletions
@@ -267,10 +267,10 @@ namespace gfax { hq.Sender = ""; if ( sa[3].Length != 0 ) { - try { - hq.TimeReceived = (DateTime)System.DateTime.ParseExact(sa[3], "ddMMMyy", System.Globalization.CultureInfo.InvariantCulture); + try { + hq.TimeReceived = (DateTime)System.DateTime.ParseExact(sa[3].Trim(), "yyyy:MM:dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture); } - catch(FormatException e ) + catch(FormatException e) { hq.TimeReceived = null; } @@ -225,6 +225,9 @@ Please login as the root user and create the " typeof (string), typeof (DateTime), typeof (string)); + + // Default to sorting by job id + StatusStore.SetSortColumnId(1, SortType.Descending); RecvStore = new ListStore( typeof (Gdk.Pixbuf), @@ -234,6 +237,9 @@ Please login as the root user and create the " typeof (DateTime), typeof (string)); + // Default to sorting by arrival date + RecvStore.SetSortColumnId(4, SortType.Descending); + lv = new G_ListView(StatusList, StatusStore); lv.AddColumnIcon(Gtk.Stock.Info, 0); @@ -263,7 +269,7 @@ Please login as the root user and create the " jobsReceivedView.AddColumnTitle(Catalog.GetString("Sender"), 1, 1); jobsReceivedView.AddColumnTitle(Catalog.GetString("Status"), 2, 2); jobsReceivedView.AddColumnTitle(Catalog.GetString("Pages "), 3, 3); - jobsReceivedView.AddColumnDateTime(Catalog.GetString("Arrived"), "d", 4, 4); + jobsReceivedView.AddColumnDateTime(Catalog.GetString("Arrived"), "G", 4, 4); jobsReceivedView.AddColumnTitle(Catalog.GetString("Filename"), 5, 5); StatusList.Selection.Changed += @@ -1021,7 +1027,7 @@ Please check your settings or contact your system Administrator")); } } else { //receive queue while ( enu.MoveNext() ) { - rq = (Fax.FaxRecQueue)enu.Current; + rq = (Fax.FaxRecQueue)enu.Current; view.AddTextToRow(GetFaxStatusIcon(rq.StatusType), rq.Sender, rq.Status, rq.Pages, rq.TimeReceived, rq.Filename); } diff --git a/src/guitools.cs b/src/guitools.cs index 8828941..bdc9e8a 100755 --- a/src/guitools.cs +++ b/src/guitools.cs @@ -306,10 +306,19 @@ namespace gfax { bool is_sorted = ((Gtk.ListStore)model).GetSortColumnId (out col, out sort); if(!is_sorted) return 0; - - DateTime dateA = (DateTime)model.GetValue (a, col); - DateTime dateB = (DateTime)model.GetValue (b, col); - + + object oA = model.GetValue (a, col); + object oB = model.GetValue (b, col); + + if(oB == null) + return 1; + + if(oA == null) + return -1; + + DateTime dateA = (DateTime)oA; + DateTime dateB = (DateTime)oB; + return dateA.CompareTo(dateB); } diff --git a/src/hylafax.cs b/src/hylafax.cs index 54ab63f..f54e7fe 100755 --- a/src/hylafax.cs +++ b/src/hylafax.cs @@ -700,20 +700,21 @@ namespace gfax { IPAddress ipaddr; int ipport; string jobfmt; - - write(mainstream, "PASV\n"); + + write(mainstream, "PASV\n"); string data = read(mainstream, mainclient); // dig out ip address and port for new connection ipaddr = get_ip_addr(data); ipport = get_ip_port(data); - + try { myclient.Connect(ipaddr, ipport); } catch (Exception e ) { Console.WriteLine(e.ToString()); // handle error here + return; } /* @@ -744,7 +745,7 @@ namespace gfax { data = read(mainstream, mainclient); } if (folder == "recvq") { - jobfmt = "\"%4p=N%1z=%28.28s=%7t=%f\""; + jobfmt = "\"%4p=N%1z=%28.28s=%-19Y=%f\""; write(mainstream, "RCVFMT "+jobfmt+"\n"); data = read(mainstream, mainclient); } @@ -815,7 +816,7 @@ namespace gfax { } else { gfax.asyncFolderMessageBuffer = ""; } - + StateObject state = new StateObject(); state.client = sock; state.readType = readType; |