From 13e09a0185319211341b2cb929ffe276a1c82f64 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 10 Sep 2007 21:46:33 +0000 Subject: [PATCH] make Message Log sortable --- .../MessageWindow.nib/classes.nib | 2 +- .../MessageWindow.nib/keyedobjects.nib | Bin 10697 -> 10932 bytes macosx/MessageWindowController.h | 2 +- macosx/MessageWindowController.m | 23 +++++++++++++++--- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/macosx/English.lproj/MessageWindow.nib/classes.nib b/macosx/English.lproj/MessageWindow.nib/classes.nib index eae9bd0b9..e0e97f11d 100644 --- a/macosx/English.lproj/MessageWindow.nib/classes.nib +++ b/macosx/English.lproj/MessageWindow.nib/classes.nib @@ -9,7 +9,7 @@ fDebugWarningField = NSTextField; fDebugWarningIcon = NSImageView; fLevelButton = NSPopUpButton; - fMessageView = NSTableView; + fMessageTable = NSTableView; fScrollView = NSScrollView; }; SUPERCLASS = NSWindowController; diff --git a/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib b/macosx/English.lproj/MessageWindow.nib/keyedobjects.nib index bcb9bb0f48533eae8eb0fc823090f2c43118aa3a..afcb705c29d7d8ed7ce36a6cb99cf3cf3e8d39e3 100644 GIT binary patch delta 7045 zcmZ`-34BcV_Wvz+X722F_I>W$NeNPsgdkE&#L`$|iAW=eh(U;iBx*N5T57H3wy32d zk)SGeYTv20DY2`1UMcd-98 zPy!W*2C<+q_y9Bq37{=V0U4kW6oHZ8V=xv>1XIBrummgx+rW0P59|krz+rF{{0OSR zMeqxF0G@znPzgDxgJx)fR_KHtC_pcK4~E0~urWPv0$b7F1lSg~haF)uOocsRUziEA z{BRij7>RN zf53mi-w{A=#G`N&g`!a-)C|R=7N`wMMLkh(l!f{u9~y#&qC7N$-W!9)q6vtgS!gyr zzCa6+e+62DwxF$O8`_S_&F+ zDSC!pVvHFq!7S$JzYd$Q8C$R&JFpA8F^@es48Mo#;QBZcN8`r03H|^#$E|T9{tzeO zWZVV!@Z(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*v zVW;7s;e_Fm;f3Lq;kDr{3s_7;O~DFm4BLrKW7An5+ndc|`?CGme0CtafL+b5XE(B& z*}zuz2lfnmoqfRm$-XfHBQi2Zxlw0y87moU8JieCFt#+dF@9?7Y0NP8GG-cw8pj(a z8YdfP8JNvX|(Bc(>T)?rirG>rm3dsCdoA0 zG|#law8*r?w86B)bjWnrbi{PjbSz*xVLD}cWtN!@W~bS0_L_OKXf9{2V6J4YVyMR{Y;J0fHcvLMFmE!SFkdy_v#2c=OD)UCmhP4;%OJ~eOTaSHGTJiUGQl#@GR-o> zGRHE{vcR&)vc$5?Qe-KythXGooVA>@T(DfST(MlY{A|@)^;XtuvIZ_tv)&y&sHQnm7_O|9(^Q~W4XIK|lzqD?!ZnN&N?y~N-?zP^qKD55HA)CSGvQ@BE zvQ@FwwAHmm*&5iI+M;dEZE3c2o6pwUmSyW}BeqetF}AU`@wS<^Wwv5liEW2%muUVBA*HG3m_Py1(fVjpE6WBO2zeM`;@acd=Q`jzALGG4Y+|@ zh*xIb`z=#Fv6xm&tFa<_FSx_i6x+y(Cb?t$*f?h^M}_g42o_a*l)?%zBz59_Jn zY2s<_iT9*>(mmOp0?!1`JkKi6YR?+aI?o2rPR~KlQO`}!AD&Xr3(qUhYp>et_Ika% zSM-+iMtWnsao!f*R^E7TptHBPH_O}C+s~Wp9qpazo$a0Lo$p=fUGLrJJ>Wg$J?uT= zJ?p*gz2m*-z3+YK{gcyi2F}QtIV&e{wYj=n6xV=j#Km%LxO~pf4d4cGL%3nw2##>0 zxG~&VZag=Eo5W4wrg1a4ncQq{F1L&;;ns3zxpUlw0C$PI!d>HTa5uSI+^^hS?l+$vZhJ0hbDId)@FiIFB zj1|TU6NE{^Ea6AttZ+`aAY2lz2-k!g!cF0p@T+iF_)T~qJQAJ=zYEWV=fX?jPvMOS zL?kkzTvXwhen], @"Date", [NSNumber numberWithInt: currentMessage->level], @"Level", nil]]; + tr_freeMessageList(messages); + #warning still needed? int total = [fMessages count]; if (total > MAX_MESSAGES) [fMessages removeObjectsInRange: NSMakeRange(0, total-MAX_MESSAGES)]; - [fMessageView reloadData]; + [fMessages sortUsingDescriptors: [fMessageTable sortDescriptors]]; - tr_freeMessageList(messages); + [fMessageTable reloadData]; } - (int) numberOfRowsInTableView: (NSTableView *) tableView @@ -151,6 +161,13 @@ return [self stringForMessage: [fMessages objectAtIndex: row]]; } +- (void) tableView: (NSTableView *) tableView sortDescriptorsDidChange: (NSArray *) oldDescriptors +{ + [fMessages sortUsingDescriptors: [fMessageTable sortDescriptors]]; + + [fMessageTable reloadData]; +} + - (void) changeLevel: (id) sender { [self updateLog: nil]; @@ -172,7 +189,7 @@ - (void) clearLog: (id) sender { [fMessages removeAllObjects]; - [fMessageView reloadData]; + [fMessageTable reloadData]; } - (void) writeToFile: (id) sender