Changeset 2068


Ignore:
Timestamp:
5/8/2010 1:52:30 AM (4 years ago)
Author:
lowjoel
Message:

Implement the UI for the SecureMoveErasureTargetConfigurer?.

Location:
trunk/eraser/Eraser.DefaultPlugins
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTargetConfigurer.Designer.cs

    r2064 r2068  
    5050        private void InitializeComponent() 
    5151        { 
    52             this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 
    53             this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); 
     52            this.components = new System.ComponentModel.Container(); 
     53            this.fileDialog = new System.Windows.Forms.OpenFileDialog(); 
     54            this.folderDialog = new System.Windows.Forms.FolderBrowserDialog(); 
    5455            this.fromLbl = new System.Windows.Forms.Label(); 
    5556            this.fromTxt = new System.Windows.Forms.TextBox(); 
    56             this.fromSelectFileBtn = new System.Windows.Forms.Button(); 
    57             this.fromSelectFolderBtn = new System.Windows.Forms.Button(); 
    5857            this.toLbl = new System.Windows.Forms.Label(); 
    5958            this.toTxt = new System.Windows.Forms.TextBox(); 
    60             this.toBtn = new System.Windows.Forms.Button(); 
     59            this.fromBrowseMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 
     60            this.fromSelectFile = new System.Windows.Forms.ToolStripMenuItem(); 
     61            this.fromSelectFolder = new System.Windows.Forms.ToolStripMenuItem(); 
     62            this.toSelectButton = new System.Windows.Forms.Button(); 
     63            this.fromSelectButton = new System.Windows.Forms.SplitButton(); 
     64            this.fromBrowseMenu.SuspendLayout(); 
    6165            this.SuspendLayout(); 
    6266            //  
     
    6468            //  
    6569            this.fromLbl.AutoSize = true; 
    66             this.fromLbl.Location = new System.Drawing.Point(0, 3); 
     70            this.fromLbl.Location = new System.Drawing.Point(-3, 3); 
    6771            this.fromLbl.Name = "fromLbl"; 
    6872            this.fromLbl.Size = new System.Drawing.Size(38, 15); 
     
    7276            // fromTxt 
    7377            //  
    74             this.fromTxt.Location = new System.Drawing.Point(44, 0); 
     78            this.fromTxt.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     79                        | System.Windows.Forms.AnchorStyles.Right))); 
     80            this.fromTxt.Location = new System.Drawing.Point(41, 0); 
    7581            this.fromTxt.Name = "fromTxt"; 
    76             this.fromTxt.Size = new System.Drawing.Size(273, 23); 
     82            this.fromTxt.Size = new System.Drawing.Size(397, 23); 
    7783            this.fromTxt.TabIndex = 1; 
    78             //  
    79             // fromSelectFileBtn 
    80             //  
    81             this.fromSelectFileBtn.Location = new System.Drawing.Point(323, 0); 
    82             this.fromSelectFileBtn.Name = "fromSelectFileBtn"; 
    83             this.fromSelectFileBtn.Size = new System.Drawing.Size(90, 23); 
    84             this.fromSelectFileBtn.TabIndex = 2; 
    85             this.fromSelectFileBtn.Text = "Select File..."; 
    86             this.fromSelectFileBtn.UseVisualStyleBackColor = true; 
    87             //  
    88             // fromSelectFolderBtn 
    89             //  
    90             this.fromSelectFolderBtn.Location = new System.Drawing.Point(419, 0); 
    91             this.fromSelectFolderBtn.Name = "fromSelectFolderBtn"; 
    92             this.fromSelectFolderBtn.Size = new System.Drawing.Size(100, 23); 
    93             this.fromSelectFolderBtn.TabIndex = 3; 
    94             this.fromSelectFolderBtn.Text = "Select Folder..."; 
    95             this.fromSelectFolderBtn.UseVisualStyleBackColor = true; 
    9684            //  
    9785            // toLbl 
    9886            //  
    9987            this.toLbl.AutoSize = true; 
    100             this.toLbl.Location = new System.Drawing.Point(0, 33); 
     88            this.toLbl.Location = new System.Drawing.Point(-3, 33); 
    10189            this.toLbl.Name = "toLbl"; 
    10290            this.toLbl.Size = new System.Drawing.Size(24, 15); 
     
    10694            // toTxt 
    10795            //  
    108             this.toTxt.Location = new System.Drawing.Point(44, 29); 
     96            this.toTxt.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     97                        | System.Windows.Forms.AnchorStyles.Right))); 
     98            this.toTxt.Location = new System.Drawing.Point(41, 30); 
    10999            this.toTxt.Name = "toTxt"; 
    110             this.toTxt.Size = new System.Drawing.Size(369, 23); 
     100            this.toTxt.Size = new System.Drawing.Size(397, 23); 
    111101            this.toTxt.TabIndex = 5; 
    112102            //  
    113             // toBtn 
     103            // fromBrowseMenu 
    114104            //  
    115             this.toBtn.Location = new System.Drawing.Point(419, 29); 
    116             this.toBtn.Name = "toBtn"; 
    117             this.toBtn.Size = new System.Drawing.Size(100, 23); 
    118             this.toBtn.TabIndex = 6; 
    119             this.toBtn.Text = "Select Folder..."; 
    120             this.toBtn.UseVisualStyleBackColor = true; 
     105            this.fromBrowseMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 
     106            this.fromSelectFile, 
     107            this.fromSelectFolder}); 
     108            this.fromBrowseMenu.Name = "contextMenuStrip1"; 
     109            this.fromBrowseMenu.Size = new System.Drawing.Size(176, 48); 
     110            //  
     111            // fromSelectFile 
     112            //  
     113            this.fromSelectFile.Name = "fromSelectFile"; 
     114            this.fromSelectFile.Size = new System.Drawing.Size(175, 22); 
     115            this.fromSelectFile.Text = "Browse for File..."; 
     116            this.fromSelectFile.Click += new System.EventHandler(this.fromSelectButton_Click); 
     117            //  
     118            // fromSelectFolder 
     119            //  
     120            this.fromSelectFolder.Name = "fromSelectFolder"; 
     121            this.fromSelectFolder.Size = new System.Drawing.Size(175, 22); 
     122            this.fromSelectFolder.Text = "Browse for Folder..."; 
     123            this.fromSelectFolder.Click += new System.EventHandler(this.fromSelectFolder_Click); 
     124            //  
     125            // toSelectButton 
     126            //  
     127            this.toSelectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 
     128            this.toSelectButton.Location = new System.Drawing.Point(444, 29); 
     129            this.toSelectButton.Name = "toSelectButton"; 
     130            this.toSelectButton.Size = new System.Drawing.Size(75, 23); 
     131            this.toSelectButton.TabIndex = 10; 
     132            this.toSelectButton.Text = "Browse"; 
     133            this.toSelectButton.UseVisualStyleBackColor = true; 
     134            this.toSelectButton.Click += new System.EventHandler(this.toSelectButton_Click); 
     135            //  
     136            // fromSelectButton 
     137            //  
     138            this.fromSelectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 
     139            this.fromSelectButton.ContextMenuStrip = this.fromBrowseMenu; 
     140            this.fromSelectButton.FlatStyle = System.Windows.Forms.FlatStyle.System; 
     141            this.fromSelectButton.Location = new System.Drawing.Point(444, -1); 
     142            this.fromSelectButton.Name = "fromSelectButton"; 
     143            this.fromSelectButton.Size = new System.Drawing.Size(75, 23); 
     144            this.fromSelectButton.TabIndex = 7; 
     145            this.fromSelectButton.Text = "Browse"; 
     146            this.fromSelectButton.UseVisualStyleBackColor = true; 
     147            this.fromSelectButton.Click += new System.EventHandler(this.fromSelectButton_Click); 
    121148            //  
    122149            // SecureMoveErasureTargetConfigurer 
     
    124151            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); 
    125152            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; 
    126             this.Controls.Add(this.toBtn); 
    127             this.Controls.Add(this.toTxt); 
    128             this.Controls.Add(this.toLbl); 
    129             this.Controls.Add(this.fromSelectFolderBtn); 
    130             this.Controls.Add(this.fromSelectFileBtn); 
    131153            this.Controls.Add(this.fromTxt); 
    132154            this.Controls.Add(this.fromLbl); 
     155            this.Controls.Add(this.toTxt); 
     156            this.Controls.Add(this.fromSelectButton); 
     157            this.Controls.Add(this.toLbl); 
     158            this.Controls.Add(this.toSelectButton); 
    133159            this.Font = new System.Drawing.Font("Segoe UI", 9F); 
    134160            this.Name = "SecureMoveErasureTargetConfigurer"; 
    135             this.Size = new System.Drawing.Size(519, 54); 
     161            this.Size = new System.Drawing.Size(519, 55); 
     162            this.fromBrowseMenu.ResumeLayout(false); 
    136163            this.ResumeLayout(false); 
    137164            this.PerformLayout(); 
     
    141168        #endregion 
    142169 
    143         private System.Windows.Forms.OpenFileDialog openFileDialog; 
    144         private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; 
     170        private System.Windows.Forms.OpenFileDialog fileDialog; 
     171        private System.Windows.Forms.FolderBrowserDialog folderDialog; 
    145172        private System.Windows.Forms.Label fromLbl; 
    146173        private System.Windows.Forms.TextBox fromTxt; 
    147         private System.Windows.Forms.Button fromSelectFileBtn; 
    148         private System.Windows.Forms.Button fromSelectFolderBtn; 
    149174        private System.Windows.Forms.Label toLbl; 
    150175        private System.Windows.Forms.TextBox toTxt; 
    151         private System.Windows.Forms.Button toBtn; 
     176        private System.Windows.Forms.SplitButton fromSelectButton; 
     177        private System.Windows.Forms.ContextMenuStrip fromBrowseMenu; 
     178        private System.Windows.Forms.ToolStripMenuItem fromSelectFile; 
     179        private System.Windows.Forms.ToolStripMenuItem fromSelectFolder; 
     180        private System.Windows.Forms.Button toSelectButton; 
    152181    } 
    153182} 
  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTargetConfigurer.cs

    r2066 r2068  
    3030 
    3131using Eraser.Manager; 
     32using Eraser.Util; 
    3233 
    3334namespace Eraser.DefaultPlugins 
     
    3839        { 
    3940            InitializeComponent(); 
     41            Theming.ApplyTheme(this); 
    4042        } 
    4143 
     
    6668 
    6769        #endregion 
     70 
     71        private void fromSelectButton_Click(object sender, EventArgs e) 
     72        { 
     73            fromTxt.Text = SelectFile(fromTxt.Text, S._("Select the Source file")); 
     74        } 
     75 
     76        private void fromSelectFolder_Click(object sender, EventArgs e) 
     77        { 
     78            fromTxt.Text = SelectFolder(fromTxt.Text, S._("Select the Source folder")); 
     79        } 
     80 
     81        private void toSelectButton_Click(object sender, EventArgs e) 
     82        { 
     83            toTxt.Text = SelectFolder(toTxt.Text, S._("Select the Destination folder")); 
     84        } 
     85 
     86        private string SelectFile(string currentPath, string description) 
     87        { 
     88            fileDialog.FileName = currentPath; 
     89            fileDialog.Title = description; 
     90            if (fileDialog.ShowDialog(this) == DialogResult.OK) 
     91            { 
     92                return fileDialog.FileName; 
     93            } 
     94 
     95            return string.Empty; 
     96        } 
     97 
     98        private string SelectFolder(string currentPath, string description) 
     99        { 
     100            folderDialog.SelectedPath = currentPath; 
     101            folderDialog.Description = description; 
     102            if (folderDialog.ShowDialog(this) == DialogResult.OK) 
     103            { 
     104                return folderDialog.SelectedPath; 
     105            } 
     106 
     107            return string.Empty; 
     108        } 
    68109    } 
    69110} 
  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTargetConfigurer.resx

    r2064 r2068  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 
    119119  </resheader> 
    120   <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
    121     <value>17, 17</value> 
     120  <metadata name="fileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     121    <value>17, 20</value> 
    122122  </metadata> 
    123   <metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
    124     <value>157, 17</value> 
     123  <metadata name="folderDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     124    <value>120, 20</value> 
     125  </metadata> 
     126  <metadata name="fromBrowseMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     127    <value>239, 20</value> 
    125128  </metadata> 
    126129</root> 
  • trunk/eraser/Eraser.DefaultPlugins/Strings.en.resx

    r2064 r2068  
    238238    <value>Securely move {0}</value> 
    239239  </data> 
     240  <data name="Select the Source file" xml:space="preserve"> 
     241    <value>Select the Source file</value> 
     242  </data> 
     243  <data name="Select the Source folder" xml:space="preserve"> 
     244    <value>Select the Source folder</value> 
     245  </data> 
     246  <data name="Select the Destination folder" xml:space="preserve"> 
     247    <value>Select the Destination folder</value> 
     248  </data> 
    240249  <data name="Unused disk space" xml:space="preserve"> 
    241250    <value>Unused disk space</value> 
  • trunk/eraser/Eraser.DefaultPlugins/Strings.it.resx

    r2064 r2068  
    238238    <value>(Untranslated)</value> 
    239239  </data> 
     240  <data name="Select the Source file" xml:space="preserve"> 
     241    <value>(Untranslated)</value> 
     242  </data> 
     243  <data name="Select the Source folder" xml:space="preserve"> 
     244    <value>(Untranslated)</value> 
     245  </data> 
     246  <data name="Select the Destination folder" xml:space="preserve"> 
     247    <value>(Untranslated)</value> 
     248  </data> 
    240249  <data name="Unused disk space" xml:space="preserve"> 
    241250    <value>(Untranslated)</value> 
  • trunk/eraser/Eraser.DefaultPlugins/Strings.nl.resx

    r2064 r2068  
    238238    <value>(Untranslated)</value> 
    239239  </data> 
     240  <data name="Select the Source file" xml:space="preserve"> 
     241    <value>(Untranslated)</value> 
     242  </data> 
     243  <data name="Select the Source folder" xml:space="preserve"> 
     244    <value>(Untranslated)</value> 
     245  </data> 
     246  <data name="Select the Destination folder" xml:space="preserve"> 
     247    <value>(Untranslated)</value> 
     248  </data> 
    240249  <data name="Unused disk space" xml:space="preserve"> 
    241250    <value>(Untranslated)</value> 
  • trunk/eraser/Eraser.DefaultPlugins/Strings.pl.resx

    r2064 r2068  
    238238    <value>(Untranslated)</value> 
    239239  </data> 
     240  <data name="Select the Source file" xml:space="preserve"> 
     241    <value>(Untranslated)</value> 
     242  </data> 
     243  <data name="Select the Source folder" xml:space="preserve"> 
     244    <value>(Untranslated)</value> 
     245  </data> 
     246  <data name="Select the Destination folder" xml:space="preserve"> 
     247    <value>(Untranslated)</value> 
     248  </data> 
    240249  <data name="Unused disk space" xml:space="preserve"> 
    241250    <value>(Untranslated)</value> 
  • trunk/eraser/Eraser.DefaultPlugins/Strings.resx

    r2064 r2068  
    238238    <value>Securely move {0}</value> 
    239239  </data> 
     240  <data name="Select the Source file" xml:space="preserve"> 
     241    <value>Select the Source file</value> 
     242  </data> 
     243  <data name="Select the Source folder" xml:space="preserve"> 
     244    <value>Select the Source folder</value> 
     245  </data> 
     246  <data name="Select the Destination folder" xml:space="preserve"> 
     247    <value>Select the Destination folder</value> 
     248  </data> 
    240249  <data name="Unused disk space" xml:space="preserve"> 
    241250    <value>Unused disk space</value> 
Note: See TracChangeset for help on using the changeset viewer.