Changeset 1243 for trunk/eraser6


Ignore:
Timestamp:
09/30/09 10:26:11 (5 years ago)
Author:
lowjoel
Message:

Implemented the delete key as suggested by Xanashi. Fixes #238.

Location:
trunk/eraser6/Eraser
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser/SchedulerPanel.Designer.cs

    r1158 r1243  
    110110            this.scheduler.DragEnter += new System.Windows.Forms.DragEventHandler(this.scheduler_DragEnter); 
    111111            this.scheduler.DragLeave += new System.EventHandler(this.scheduler_DragLeave); 
     112            this.scheduler.KeyDown += new System.Windows.Forms.KeyEventHandler(this.scheduler_KeyDown); 
    112113            this.scheduler.DragOver += new System.Windows.Forms.DragEventHandler(this.scheduler_DragOver); 
    113114            this.scheduler.DrawSubItem += new System.Windows.Forms.DrawListViewSubItemEventHandler(this.scheduler_DrawSubItem); 
  • trunk/eraser6/Eraser/SchedulerPanel.cs

    r1165 r1243  
    141141        } 
    142142 
     143        private void DeleteSelectedTasks() 
     144        { 
     145            if (MessageBox.Show(this, S._("Are you sure you want to delete the selected tasks?"), 
     146                   S._("Eraser"), MessageBoxButtons.YesNo, MessageBoxIcon.Question, 
     147                   MessageBoxDefaultButton.Button1, 
     148                   S.IsRightToLeft(this) ? MessageBoxOptions.RtlReading : 0) != DialogResult.Yes) 
     149            { 
     150                return; 
     151            } 
     152 
     153            foreach (ListViewItem item in scheduler.SelectedItems) 
     154            { 
     155                Task task = (Task)item.Tag; 
     156                if (!task.Executing) 
     157                    Program.eraserClient.Tasks.Remove(task); 
     158            } 
     159        } 
     160 
    143161        /// <summary> 
    144162        /// Handles the task deleted event. 
     
    299317                UpdateTask(item); 
    300318            } 
     319        } 
     320 
     321        /// <summary> 
     322        /// Occurs when the user presses a key on the list view. 
     323        /// </summary> 
     324        /// <param name="sender">The list view which triggered the event.</param> 
     325        /// <param name="e">Event argument.</param> 
     326        private void scheduler_KeyDown(object sender, KeyEventArgs e) 
     327        { 
     328            if (e.KeyCode == Keys.Delete) 
     329                DeleteSelectedTasks(); 
    301330        } 
    302331 
     
    577606        private void deleteTaskToolStripMenuItem_Click(object sender, EventArgs e) 
    578607        { 
    579             if (MessageBox.Show(this, S._("Are you sure you want to delete the selected tasks?"), 
    580                 S._("Eraser"), MessageBoxButtons.YesNo, MessageBoxIcon.Question, 
    581                 MessageBoxDefaultButton.Button1, 
    582                 S.IsRightToLeft(this) ? MessageBoxOptions.RtlReading : 0) != DialogResult.Yes) 
    583             { 
    584                 return; 
    585             } 
    586  
    587             foreach (ListViewItem item in scheduler.SelectedItems) 
    588             { 
    589                 Task task = (Task)item.Tag; 
    590                 if (!task.Executing) 
    591                     Program.eraserClient.Tasks.Remove(task); 
    592             } 
     608            DeleteSelectedTasks(); 
    593609        } 
    594610 
  • trunk/eraser6/Eraser/SchedulerPanel.resx

    r1165 r1243  
    398398  </data> 
    399399  <data name="&gt;&gt;$this.Type" xml:space="preserve"> 
    400     <value>Eraser.BasePanel, Eraser, Version=6.0.6.1160, Culture=neutral, PublicKeyToken=311f5aaf640c645d</value> 
     400    <value>Eraser.BasePanel, Eraser, Version=6.0.6.1239, Culture=neutral, PublicKeyToken=311f5aaf640c645d</value> 
    401401  </data> 
    402402</root> 
  • trunk/eraser6/Eraser/Strings.NL.resx

    r1162 r1243  
    196196    <value>(Untranslated)</value> 
    197197  </data> 
     198  <data name="Are you sure you want to delete the selected tasks?" xml:space="preserve"> 
     199    <value>(Untranslated)</value> 
     200  </data> 
    198201  <data name="Running..." xml:space="preserve"> 
    199202    <value>Wordt uitgevoerd...</value> 
     
    223226    <value>(Untranslated)</value> 
    224227  </data> 
    225   <data name="Are you sure you want to delete the selected tasks?" xml:space="preserve"> 
    226     <value>(Untranslated)</value> 
    227   </data> 
    228228  <data name="User interface language" xml:space="preserve"> 
    229229    <value>Gebruikers interface taal</value> 
  • trunk/eraser6/Eraser/Strings.en.resx

    r1162 r1243  
    196196    <value>{0} has just been added to the list of tasks.</value> 
    197197  </data> 
     198  <data name="Are you sure you want to delete the selected tasks?" xml:space="preserve"> 
     199    <value>Are you sure you want to delete the selected tasks?</value> 
     200  </data> 
    198201  <data name="Running..." xml:space="preserve"> 
    199202    <value>Running...</value> 
     
    223226    <value>Could not import task list from {0}. The error returned was: {1}</value> 
    224227  </data> 
    225   <data name="Are you sure you want to delete the selected tasks?" xml:space="preserve"> 
    226     <value>Are you sure you want to delete the selected tasks?</value> 
    227   </data> 
    228228  <data name="User interface language" xml:space="preserve"> 
    229229    <value>User interface language</value> 
  • trunk/eraser6/Eraser/Strings.resx

    r1162 r1243  
    196196    <value>{0} has just been added to the list of tasks.</value> 
    197197  </data> 
     198  <data name="Are you sure you want to delete the selected tasks?" xml:space="preserve"> 
     199    <value>Are you sure you want to delete the selected tasks?</value> 
     200  </data> 
    198201  <data name="Running..." xml:space="preserve"> 
    199202    <value>Running...</value> 
     
    223226    <value>Could not import task list from {0}. The error returned was: {1}</value> 
    224227  </data> 
    225   <data name="Are you sure you want to delete the selected tasks?" xml:space="preserve"> 
    226     <value>Are you sure you want to delete the selected tasks?</value> 
    227   </data> 
    228228  <data name="User interface language" xml:space="preserve"> 
    229229    <value>User interface language</value> 
Note: See TracChangeset for help on using the changeset viewer.