53
53
#define COLUMN_APPLICATION 6
54
54
#define COLUMN_NAME 7
55
55
#define COLUMN_ESTIMATEDCOMPLETION 8
56
- // #define COLUMN_DEADLINEDIFF 9
56
+ #define COLUMN_DEADLINEDIFF 9
57
57
58
58
59
59
// DefaultShownColumns is an array containing the
@@ -187,21 +187,19 @@ static bool CompareViewWorkItems(int iRowIndex1, int iRowIndex2) {
187
187
result = work1->m_strStatus .CmpNoCase (work2->m_strStatus );
188
188
break ;
189
189
case COLUMN_ESTIMATEDCOMPLETION:
190
- wxDateTime now = wxDateTime::Now ();
191
- wxTimeSpan time_to_completion_work1 = convert_to_timespan (work1->m_fTimeToCompletion );
192
- wxTimeSpan time_to_completion_work2 = convert_to_timespan (work2->m_fTimeToCompletion );
193
- wxDateTime estimated_completion_work1 = now.Add (time_to_completion_work1);
194
- wxDateTime estimated_completion_work2 = now.Add (time_to_completion_work2);
195
- if (estimated_completion_work1.IsEarlierThan (estimated_completion_work2)) {
190
+ if (work1->m_tEstimatedCompletion < work2->m_tEstimatedCompletion ) {
191
+ result = -1 ;
192
+ } else if (work1->m_tEstimatedCompletion > work2->m_tEstimatedCompletion ) {
193
+ result = 1 ;
194
+ }
195
+ break ;
196
+ case COLUMN_DEADLINEDIFF:
197
+ if (work1->m_tDeadlineDiff < work2->m_tDeadlineDiff ) {
196
198
result = -1 ;
197
- } else if (estimated_completion_work1.IsLaterThan (estimated_completion_work2) ||
198
- estimated_completion_work1.IsEqualTo (estimated_completion_work2)) {
199
+ } else if (work1->m_tDeadlineDiff > work2->m_tDeadlineDiff ) {
199
200
result = 1 ;
200
201
}
201
202
break ;
202
- // case COLUMN_DEADLINEDIFF:
203
- // SOMETHING GOES IN HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
204
- // break;
205
203
}
206
204
207
205
// Always return FALSE for equality (result == 0)
@@ -287,7 +285,7 @@ CViewWork::CViewWork(wxNotebook* pNotebook) :
287
285
m_aStdColNameOrder->Insert (_ (" Application" ), COLUMN_APPLICATION);
288
286
m_aStdColNameOrder->Insert (_ (" Name" ), COLUMN_NAME);
289
287
m_aStdColNameOrder->Insert (_ (" Estimated Completion" ), COLUMN_ESTIMATEDCOMPLETION);
290
- // m_aStdColNameOrder->Insert(_("Completion Before Deadline"), COLUMN_DEADLINEDIFF);
288
+ m_aStdColNameOrder->Insert (_ (" Completion Before Deadline" ), COLUMN_DEADLINEDIFF);
291
289
292
290
// m_iStdColWidthOrder is an array of the width for each column.
293
291
// Entries must be in order of ascending Column ID. We initialize
@@ -305,7 +303,7 @@ CViewWork::CViewWork(wxNotebook* pNotebook) :
305
303
m_iStdColWidthOrder.Insert (95 , COLUMN_APPLICATION);
306
304
m_iStdColWidthOrder.Insert (285 , COLUMN_NAME);
307
305
m_iStdColWidthOrder.Insert (150 , COLUMN_ESTIMATEDCOMPLETION);
308
- // m_iStdColWidthOrder.Insert(150, COLUMN_DEADLINEDIFF);
306
+ m_iStdColWidthOrder.Insert (150 , COLUMN_DEADLINEDIFF);
309
307
310
308
wxASSERT (m_iStdColWidthOrder.size () == m_aStdColNameOrder->size ());
311
309
@@ -360,10 +358,10 @@ void CViewWork::AppendColumn(int columnID){
360
358
m_pListPane->AppendColumn ((*m_aStdColNameOrder)[COLUMN_ESTIMATEDCOMPLETION],
361
359
wxLIST_FORMAT_LEFT, m_iStdColWidthOrder[COLUMN_ESTIMATEDCOMPLETION]);
362
360
break ;
363
- /* case COLUMN_DEADLINEDIFF:
361
+ case COLUMN_DEADLINEDIFF:
364
362
m_pListPane->AppendColumn ((*m_aStdColNameOrder)[COLUMN_DEADLINEDIFF],
365
363
wxLIST_FORMAT_LEFT, m_iStdColWidthOrder[COLUMN_DEADLINEDIFF]);
366
- break; */
364
+ break ;
367
365
}
368
366
}
369
367
@@ -788,9 +786,9 @@ wxString CViewWork::OnListGetItemText(long item, long column) const {
788
786
case COLUMN_ESTIMATEDCOMPLETION:
789
787
strBuffer = work->m_strEstimatedCompletion ;
790
788
break ;
791
- // case COLUMN_DEADLINEDIFF:
792
- // Fill out something here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
793
- // break;
789
+ case COLUMN_DEADLINEDIFF:
790
+ strBuffer = work-> m_strDeadlineDiff ;
791
+ break ;
794
792
}
795
793
}
796
794
@@ -1129,6 +1127,13 @@ bool CViewWork::SynchronizeCacheItem(wxInt32 iRowIndex, wxInt32 iColumnIndex) {
1129
1127
return true ;
1130
1128
}
1131
1129
break ;
1130
+ case COLUMN_DEADLINEDIFF:
1131
+ // something!!!!!!!!!!!!!!!!!!!!!!!!!!!
1132
+ // - find estimated completion date
1133
+ // - get deadline (should not change...right?
1134
+ // make the delta between those.
1135
+ // If not equal, store
1136
+ break ;
1132
1137
case COLUMN_STATUS:
1133
1138
int i = m_iSortedIndexes[iRowIndex];
1134
1139
RESULT* result = wxGetApp ().GetDocument ()->result (i);
0 commit comments