Changeset 1996 for trunk/eraser
- Timestamp:
- 5/1/2010 9:12:41 AM (3 years ago)
- Location:
- trunk/eraser
- Files:
-
- 3 added
- 8 edited
-
Dependencies/TaskDialog.XML (added)
-
Dependencies/TaskDialog.dll (added)
-
Dependencies/TaskDialog.pdb (added)
-
Eraser/Eraser.csproj (modified) (1 diff)
-
Eraser/SchedulerPanel.cs (modified) (3 diffs)
-
Eraser/Strings.en.resx (modified) (1 diff)
-
Eraser/Strings.it.resx (modified) (1 diff)
-
Eraser/Strings.nl.resx (modified) (1 diff)
-
Eraser/Strings.pl.resx (modified) (1 diff)
-
Eraser/Strings.resx (modified) (1 diff)
-
Installer/DirectoryStructure.wxs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser/Eraser.csproj
r1973 r1996 79 79 <Reference Include="System.Windows.Forms" /> 80 80 <Reference Include="System.Xml" /> 81 <Reference Include="TaskDialog, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3ac89a0351e689b6, processorArchitecture=MSIL"> 82 <SpecificVersion>False</SpecificVersion> 83 <HintPath>..\Dependencies\TaskDialog.dll</HintPath> 84 </Reference> 81 85 </ItemGroup> 82 86 <ItemGroup> -
trunk/eraser/Eraser/SchedulerPanel.cs
r1952 r1996 27 27 using System.Windows.Forms; 28 28 29 using Eraser.Manager;30 using Eraser.Util;31 29 using System.Globalization; 32 30 using System.Runtime.InteropServices; … … 35 33 using System.Runtime.Serialization; 36 34 using System.ComponentModel; 35 36 using Eraser.Manager; 37 using Eraser.Util; 38 using Microsoft.Samples; 37 39 using ProgressChangedEventArgs = Eraser.Util.ProgressChangedEventArgs; 38 40 … … 421 423 if (!e.Data.GetDataPresent(DataFormats.FileDrop)) 422 424 e.Effect = DragDropEffects.None; 423 else 424 { 425 string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false); 426 427 //Determine whether we are importing a task list or dragging files for 428 //erasure. 429 if (e.Effect == DragDropEffects.Copy) 430 { 431 foreach (string file in files) 432 using (FileStream stream = new FileStream(file, FileMode.Open, 433 FileAccess.Read, FileShare.Read)) 425 DropTargetHelper.Drop(e.Data, new Point(e.X, e.Y), e.Effect); 426 427 //Schedule the task dialog to be shown (to get to the event loop so that 428 //ComCtl32.dll v6 is used.) 429 BeginInvoke((Action<DragDropEffects, string[]>)scheduler_DragDropConfirm, 430 e.Effect, e.Data.GetData(DataFormats.FileDrop, false)); 431 } 432 433 /// <summary> 434 /// Called after the files have been dropped into Eraser. 435 /// </summary> 436 /// <param name="effect">The Drag/drop effect of the operation.</param> 437 /// <param name="files">The files which were dropped into the program.</param> 438 private void scheduler_DragDropConfirm(DragDropEffects effect, string[] files) 439 { 440 //Determine whether we are importing a task list or dragging files for 441 //erasure. 442 if (effect == DragDropEffects.Copy) 443 { 444 foreach (string file in files) 445 using (FileStream stream = new FileStream(file, FileMode.Open, 446 FileAccess.Read, FileShare.Read)) 447 { 448 try 434 449 { 435 try 436 { 437 Program.eraserClient.Tasks.LoadFromStream(stream); 438 } 439 catch (InvalidDataException ex) 440 { 441 MessageBox.Show(S._("Could not import task list from {0}. The " + 442 "error returned was: {1}", file, ex.Message), S._("Eraser"), 443 MessageBoxButtons.OK, MessageBoxIcon.Error, 444 MessageBoxDefaultButton.Button1, 445 Localisation.IsRightToLeft(this) ? 446 MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign : 0); 447 } 450 Program.eraserClient.Tasks.LoadFromStream(stream); 448 451 } 449 } 450 else if (e.Effect == DragDropEffects.Move) 451 { 452 //Create a task with the default settings 453 Task task = new Task(); 454 foreach (string file in files) 455 { 456 FileSystemObjectTarget target; 457 if (Directory.Exists(file)) 458 target = new FolderTarget(); 459 else 460 target = new FileTarget(); 461 target.Path = file; 462 463 task.Targets.Add(target); 452 catch (InvalidDataException ex) 453 { 454 MessageBox.Show(S._("Could not import task list from {0}. The " + 455 "error returned was: {1}", file, ex.Message), S._("Eraser"), 456 MessageBoxButtons.OK, MessageBoxIcon.Error, 457 MessageBoxDefaultButton.Button1, 458 Localisation.IsRightToLeft(this) ? 459 MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign : 0); 460 } 464 461 } 465 466 //Add the task. 467 Program.eraserClient.Tasks.Add(task); 468 } 469 } 470 471 DropTargetHelper.Drop(e.Data, new Point(e.X, e.Y), e.Effect); 462 } 463 else if (effect == DragDropEffects.Move) 464 { 465 //Create a task with the default settings 466 Task task = new Task(); 467 foreach (string file in files) 468 { 469 FileSystemObjectTarget target; 470 if (Directory.Exists(file)) 471 target = new FolderTarget(); 472 else 473 target = new FileTarget(); 474 target.Path = file; 475 476 task.Targets.Add(target); 477 } 478 479 //Add the task, asking the user for his intent. 480 DialogResult action = DialogResult.No; 481 if (TaskDialog.IsAvailableOnThisOS) 482 { 483 TaskDialog dialog = new TaskDialog(); 484 dialog.WindowTitle = S._("Eraser"); 485 dialog.MainIcon = TaskDialogIcon.Information; 486 dialog.MainInstruction = S._("You have dropped a set of files and folders into Eraser. What do you want to do with them?"); 487 dialog.AllowDialogCancellation = true; 488 dialog.Buttons = new TaskDialogButton[] { 489 new TaskDialogButton((int)DialogResult.Yes, S._("Erase the selected items\nSchedules the selected items for immediate erasure.")), 490 new TaskDialogButton((int)DialogResult.OK, S._("Create a new Task\nA task will be created containing the selected items.")), 491 new TaskDialogButton((int)DialogResult.No, S._("Cancel the drag-and-drop operation")) 492 }; 493 dialog.RightToLeftLayout = Localisation.IsRightToLeft(this); 494 dialog.UseCommandLinks = true; 495 action = (DialogResult)dialog.Show(this); 496 } 497 else 498 { 499 action = MessageBox.Show(S._("Are you sure you wish to erase the selected " 500 + "items?"), S._("Eraser"), MessageBoxButtons.YesNo, 501 MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, 502 Localisation.IsRightToLeft(this) ? 503 MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign : 0); 504 } 505 506 switch (action) 507 { 508 case DialogResult.OK: 509 task.Schedule = Schedule.RunManually; 510 goto case DialogResult.Yes; 511 512 case DialogResult.Yes: 513 Program.eraserClient.Tasks.Add(task); 514 break; 515 } 516 } 472 517 } 473 518 -
trunk/eraser/Eraser/Strings.en.resx
r1973 r1996 232 232 <value>Could not import task list from {0}. The error returned was: {1}</value> 233 233 </data> 234 <data name="You have dropped a set of files and folders into Eraser. What do you want to do with them?" xml:space="preserve"> 235 <value>You have dropped a set of files and folders into Eraser. What do you want to do with them?</value> 236 </data> 237 <data name="Erase the selected items\nSchedules the selected items for immediate erasure." xml:space="preserve"> 238 <value>Erase the selected items\nSchedules the selected items for immediate erasure.</value> 239 </data> 240 <data name="Create a new Task\nA task will be created containing the selected items." xml:space="preserve"> 241 <value>Create a new Task\nA task will be created containing the selected items.</value> 242 </data> 243 <data name="Cancel the drag-and-drop operation" xml:space="preserve"> 244 <value>Cancel the drag-and-drop operation</value> 245 </data> 246 <data name="Are you sure you wish to erase the selected items?" xml:space="preserve"> 247 <value>Are you sure you wish to erase the selected items?</value> 248 </data> 234 249 <data name="Could not load the setting {0}\\{1} for plugin {2}. The setting has been lost." xml:space="preserve"> 235 250 <value>Could not load the setting {0}\\{1} for plugin {2}. The setting has been lost.</value> -
trunk/eraser/Eraser/Strings.it.resx
r1973 r1996 232 232 <value>Importazione della lista di operazioni da {0} non riuscita. L'errore è stato: {1}</value> 233 233 </data> 234 <data name="You have dropped a set of files and folders into Eraser. What do you want to do with them?" xml:space="preserve"> 235 <value>(Untranslated)</value> 236 </data> 237 <data name="Erase the selected items\nSchedules the selected items for immediate erasure." xml:space="preserve"> 238 <value>(Untranslated)</value> 239 </data> 240 <data name="Create a new Task\nA task will be created containing the selected items." xml:space="preserve"> 241 <value>(Untranslated)</value> 242 </data> 243 <data name="Cancel the drag-and-drop operation" xml:space="preserve"> 244 <value>(Untranslated)</value> 245 </data> 246 <data name="Are you sure you wish to erase the selected items?" xml:space="preserve"> 247 <value>(Untranslated)</value> 248 </data> 234 249 <data name="Could not load the setting {0}\\{1} for plugin {2}. The setting has been lost." xml:space="preserve"> 235 250 <value>Impossibile caricare l'impostazione {0}\\{1} per il plugin {2}. L'impostazione è stata persa.</value> -
trunk/eraser/Eraser/Strings.nl.resx
r1973 r1996 232 232 <value>(Untranslated)</value> 233 233 </data> 234 <data name="You have dropped a set of files and folders into Eraser. What do you want to do with them?" xml:space="preserve"> 235 <value>(Untranslated)</value> 236 </data> 237 <data name="Erase the selected items\nSchedules the selected items for immediate erasure." xml:space="preserve"> 238 <value>(Untranslated)</value> 239 </data> 240 <data name="Create a new Task\nA task will be created containing the selected items." xml:space="preserve"> 241 <value>(Untranslated)</value> 242 </data> 243 <data name="Cancel the drag-and-drop operation" xml:space="preserve"> 244 <value>(Untranslated)</value> 245 </data> 246 <data name="Are you sure you wish to erase the selected items?" xml:space="preserve"> 247 <value>(Untranslated)</value> 248 </data> 234 249 <data name="Could not load the setting {0}\\{1} for plugin {2}. The setting has been lost." xml:space="preserve"> 235 250 <value>(Untranslated)</value> -
trunk/eraser/Eraser/Strings.pl.resx
r1973 r1996 228 228 <data name="Erase {0}" xml:space="preserve"> 229 229 <value>Wymazywanie {0}</value> 230 <comment>Maybe "Wymaż" is more appropriate, it depends on its context</comment>231 230 </data> 232 231 <data name="Could not import task list from {0}. The error returned was: {1}" xml:space="preserve"> 233 232 <value>Nie można było zaimportować listy zadań z {0}. Wystąpił błąd: {1}</value> 234 233 </data> 234 <data name="You have dropped a set of files and folders into Eraser. What do you want to do with them?" xml:space="preserve"> 235 <value>(Untranslated)</value> 236 </data> 237 <data name="Erase the selected items\nSchedules the selected items for immediate erasure." xml:space="preserve"> 238 <value>(Untranslated)</value> 239 </data> 240 <data name="Create a new Task\nA task will be created containing the selected items." xml:space="preserve"> 241 <value>(Untranslated)</value> 242 </data> 243 <data name="Cancel the drag-and-drop operation" xml:space="preserve"> 244 <value>(Untranslated)</value> 245 </data> 246 <data name="Are you sure you wish to erase the selected items?" xml:space="preserve"> 247 <value>(Untranslated)</value> 248 </data> 235 249 <data name="Could not load the setting {0}\\{1} for plugin {2}. The setting has been lost." xml:space="preserve"> 236 250 <value>Nie można było załadować ustawień {0}\\{1} dla wtyczki {2}. Ustawienia wtyczki zostały utracone.</value> -
trunk/eraser/Eraser/Strings.resx
r1973 r1996 232 232 <value>Could not import task list from {0}. The error returned was: {1}</value> 233 233 </data> 234 <data name="You have dropped a set of files and folders into Eraser. What do you want to do with them?" xml:space="preserve"> 235 <value>You have dropped a set of files and folders into Eraser. What do you want to do with them?</value> 236 </data> 237 <data name="Erase the selected items\nSchedules the selected items for immediate erasure." xml:space="preserve"> 238 <value>Erase the selected items\nSchedules the selected items for immediate erasure.</value> 239 </data> 240 <data name="Create a new Task\nA task will be created containing the selected items." xml:space="preserve"> 241 <value>Create a new Task\nA task will be created containing the selected items.</value> 242 </data> 243 <data name="Cancel the drag-and-drop operation" xml:space="preserve"> 244 <value>Cancel the drag-and-drop operation</value> 245 </data> 246 <data name="Are you sure you wish to erase the selected items?" xml:space="preserve"> 247 <value>Are you sure you wish to erase the selected items?</value> 248 </data> 234 249 <data name="Could not load the setting {0}\\{1} for plugin {2}. The setting has been lost." xml:space="preserve"> 235 250 <value>Could not load the setting {0}\\{1} for plugin {2}. The setting has been lost.</value> -
trunk/eraser/Installer/DirectoryStructure.wxs
r1994 r1996 65 65 <File Id="SharpZipLib" Name="ICSharpCode.SharpZipLib.dll" 66 66 Source="..\bin\Release\Plugins\ICSharpCode.SharpZipLib.dll" ProcessorArchitecture="msil" /> 67 67 <File Id="TaskDialog" Name="TaskDialog.dll" 68 Source="..\bin\Release\TaskDialog.dll" ProcessorArchitecture="msil" /> 69 68 70 <File Id="EraserManager" Name="Eraser.Manager.dll" 69 71 Source="..\bin\Release\Eraser.Manager.dll" ProcessorArchitecture="msil" />
Note: See TracChangeset
for help on using the changeset viewer.
