Changeset 906
- Timestamp:
- 4/28/2009 12:15:33 PM (4 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Eraser/SchedulerPanel.cs (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/SchedulerPanel.cs
r866 r906 43 43 44 44 //Populate the scheduler list-view with the current task list 45 List<Task> tasks = Program.eraserClient.GetTasks();45 ICollection<Task> tasks = Program.eraserClient.GetTasks(); 46 46 foreach (Task task in tasks) 47 47 DisplayTask(task); … … 194 194 } 195 195 196 //Find the list view item197 ListViewItem item = GetTaskItem(e.Task);198 199 196 //Update the progress bar 200 197 schedulerProgress.Value = (int)(e.OverallProgress * 1000.0); … … 232 229 233 230 //Get the exit status of the task. 234 LogLevel highestLevel = LogLevel.I NFORMATION;231 LogLevel highestLevel = LogLevel.Information; 235 232 List<LogEntry> logs = e.Task.Log.LastSessionEntries; 236 233 foreach (LogEntry log in logs) … … 247 244 switch (highestLevel) 248 245 { 249 case LogLevel.W ARNING:246 case LogLevel.Warning: 250 247 message = S._("The task {0} has completed with warnings.", e.Task.UIText); 251 248 icon = ToolTipIcon.Warning; 252 249 break; 253 case LogLevel.E RROR:250 case LogLevel.Error: 254 251 message = S._("The task {0} has completed with errors.", e.Task.UIText); 255 252 icon = ToolTipIcon.Error; 256 253 break; 257 case LogLevel.F ATAL:254 case LogLevel.Fatal: 258 255 message = S._("The task {0} did not complete.", e.Task.UIText); 259 256 icon = ToolTipIcon.Error; … … 271 268 //If the user requested us to remove completed one-time tasks, do so. 272 269 if (EraserSettings.Get().ClearCompletedTasks && 273 !(e.Task.Schedule is RecurringSchedule) && highestLevel < LogLevel.W ARNING)270 !(e.Task.Schedule is RecurringSchedule) && highestLevel < LogLevel.Warning) 274 271 { 275 272 Program.eraserClient.DeleteTask(e.Task.ID); … … 281 278 switch (highestLevel) 282 279 { 283 case LogLevel.W ARNING:280 case LogLevel.Warning: 284 281 item.SubItems[1].Text = S._("Completed with warnings"); 285 282 break; 286 case LogLevel.E RROR:283 case LogLevel.Error: 287 284 item.SubItems[1].Text = S._("Completed with errors"); 288 285 break; 289 case LogLevel.F ATAL:286 case LogLevel.Fatal: 290 287 item.SubItems[1].Text = S._("Not completed"); 291 288 break; … … 366 363 { 367 364 Task task = form.Task; 368 Program.eraserClient.AddTask( reftask);365 Program.eraserClient.AddTask(task); 369 366 } 370 367 } … … 505 502 if (schedulerProgress.Tag == null) 506 503 return; 507 508 Rectangle rect = GetSubItemRect((int)schedulerProgress.Tag, 2); 509 schedulerProgress.Top = rect.Top; 510 schedulerProgress.Left = rect.Left; 511 schedulerProgress.Width = rect.Width; 512 schedulerProgress.Height = rect.Height; 504 Rectangle rect = scheduler.Items[(int)schedulerProgress.Tag].SubItems[2].Bounds; 505 schedulerProgress.Location = rect.Location; 506 schedulerProgress.Size = rect.Size; 513 507 } 514 508 … … 525 519 } 526 520 #endregion 527 528 #region GetSubItemRect529 [DllImport("User32.dll")]530 private static extern UIntPtr SendMessage(IntPtr HWND, uint Message,531 UIntPtr wParam, out Rect lParam);532 533 private struct Rect534 {535 public int left;536 public int top;537 public int right;538 public int bottom;539 };540 541 private Rectangle GetSubItemRect(int index, int subItemIndex)542 {543 Rect pRect = new Rect();544 pRect.top = subItemIndex;545 pRect.left = 0; //LVIR_BOUNDS546 SendMessage(scheduler.Handle, 0x1000 + 56, (UIntPtr)index, out pRect);547 548 return new Rectangle(pRect.left, pRect.top, pRect.right - pRect.left,549 pRect.bottom - pRect.top);550 }551 #endregion552 521 } 553 522 }
Note: See TracChangeset
for help on using the changeset viewer.
