Skip to content

Commit ded7284

Browse files
Merge pull request #19 from AngelsSoftwareOrg/develop
v1.0.7 - Cycle Release - OneClickZipSetup_v1.0.7_Release
2 parents 13fe98b + 0c0a164 commit ded7284

File tree

9 files changed

+32
-20
lines changed

9 files changed

+32
-20
lines changed

.vs/OneClickZip/v16/.suo

86 KB
Binary file not shown.

App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<value>0</value>
1818
</setting>
1919
<setting name="app_version_patch" serializeAs="String">
20-
<value>6</value>
20+
<value>7</value>
2121
</setting>
2222
<setting name="app_version_revision" serializeAs="String">
2323
<value>r1</value>

Forms/Options/FilterRuleFrm.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,14 @@ private void btnTargetDirBrowse_Click(object sender, EventArgs e)
231231
{
232232
folderBrowserDialog.SelectedPath = ApplicationSettings.GetLastOpenedDirectory();
233233
folderBrowserDialog.ShowNewFolderButton = true;
234-
folderBrowserDialog.ShowDialog();
234+
DialogResult dr = folderBrowserDialog.ShowDialog();
235235

236-
if (String.IsNullOrWhiteSpace(folderBrowserDialog.SelectedPath)) return;
237-
txtBoxTargetDir.Text = folderBrowserDialog.SelectedPath;
238-
ApplicationSettings.SaveLastOpenedDirectory(folderBrowserDialog.SelectedPath);
236+
if(dr == DialogResult.OK)
237+
{
238+
if (String.IsNullOrWhiteSpace(folderBrowserDialog.SelectedPath)) return;
239+
txtBoxTargetDir.Text = folderBrowserDialog.SelectedPath;
240+
ApplicationSettings.SaveLastOpenedDirectory(folderBrowserDialog.SelectedPath);
241+
}
239242
}
240243
private void comboBoxTimeSpanOption_SelectedValueChanged(object sender, EventArgs e)
241244
{

Forms/Options/OneClickProcessorFrm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,13 @@ private void BeforeClosingForm()
322322
}
323323
private bool IsDirectoryValidAndAccessible(String dirPath)
324324
{
325+
if (!FileSystemUtilities.isDriveReady(dirPath)) return false;
325326
if (!FileSystemUtilities.IsDirectoryExistInTheSystem(dirPath))
326327
{
327328
if (!FileSystemUtilities.MakeDirectory(dirPath)) return false;
328329
}
329330
if (!FileSystemUtilities.IsDirectoryHasReadAndWritePermission(dirPath)) return false;
330331
return true;
331332
}
332-
333333
}
334334
}

Forms/ZipDesigner/ZipDesignerFrm.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private TreeNodeExtended GetSelectedTreeNodeExtended
5858
}
5959
}
6060

61-
public TargetOutputLocationModel TargetOutputLocationModelObj
61+
private TargetOutputLocationModel TargetOutputLocationModelObj
6262
{
6363
get
6464
{
@@ -138,7 +138,7 @@ private void listViewSearchDirExp_KeyDown(object sender, KeyEventArgs e)
138138
}
139139
}
140140

141-
#endregion
141+
#endregion
142142

143143
#region ZIP Designer Controls and related functions
144144

@@ -447,7 +447,7 @@ private void toolStripButtonRename_Click(object sender, EventArgs e)
447447

448448
private void treeViewZipDesigner_DoubleClick(object sender, EventArgs e)
449449
{
450-
TreeNodeExtended targetNode = (TreeNodeExtended)treeViewZipDesigner.SelectedNode;
450+
TreeNodeExtended targetNode = GetSelectedTreeNodeExtended;
451451
if (targetNode == null) return;
452452
if (targetNode.IsFolderIsFilterRule) ModifyFilterRule();
453453
}
@@ -868,7 +868,7 @@ private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
868868

869869
#endregion
870870

871-
#region Context Strip for Zip File Tree View
871+
#region Context Strip for Zip File Tree View
872872

873873
private void expandToolStripMenuItem_Click(object sender, EventArgs e)
874874
{
@@ -939,7 +939,7 @@ private void modifyFilterRuleToolStripMenuItem_Click(object sender, EventArgs e)
939939

940940
private void ModifyFilterRule(TreeNodeExtended targetNode = null)
941941
{
942-
TreeNodeExtended treeNodeEx = (targetNode==null) ? (TreeNodeExtended)treeViewZipDesigner.SelectedNode : targetNode;
942+
TreeNodeExtended treeNodeEx = (targetNode==null) ? GetSelectedTreeNodeExtended : targetNode;
943943
FilterRuleFrm filterFrm = new FilterRuleFrm(treeNodeEx.FolderFilterRuleObj);
944944
filterFrm.ShowDialog();
945945
treeNodeEx.FolderFilterRuleObj = (FolderFilterRule)filterFrm.FolderFilterRule.Clone();

Includes/Classes/ZipArchiving.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private bool AddFileIntoZipArchive(ZipFile archiveFile, CustomFileItem customFil
163163
archiveFile.Save();
164164
}
165165
}
166-
//just ignore if cannot accessed the file
166+
//just ignore if cannot access the file
167167
catch (UnauthorizedAccessException) { return false; }
168168
catch (Exception) { return false; }
169169
return true;

Includes/Utilities/FileSystemUtilities.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public class FileSystemUtilities
2121
private static readonly String SPECIAL_FOLDER_PATTERN = @".*?\{.*?\}";
2222
private static List<KeyValuePair<String, Environment.SpecialFolder>> SPECIAL_FOLDERS_MANUAL_MATCHMAKING;
2323
private static readonly List<char> INVALID_FILE_PATH_CHARACTERS;
24-
static FileSystemUtilities() {
24+
static FileSystemUtilities()
25+
{
2526
SPECIAL_FOLDERS = new List<string>();
2627
SPECIAL_FOLDERS_MANUAL_MATCHMAKING = new List<KeyValuePair<string, Environment.SpecialFolder>>();
2728
SPECIAL_FOLDERS.AddRange(ClassReflectionUtilities.GetEnumerableOptions(typeof(Environment.SpecialFolder)));
@@ -41,7 +42,7 @@ public static bool IsFullPathIsDirectory(String fullPath)
4142
return true;
4243
}
4344
}
44-
catch (Exception )
45+
catch (Exception)
4546
{
4647
return false;
4748
}
@@ -89,11 +90,11 @@ public static DirectoryInfo[] GetDirectories(String pathName)
8990
public static FileInfo[] GetFiles(String pathName)
9091
{
9192
DirectoryInfo dInfo = new DirectoryInfo(pathName);
92-
FileInfo[] result=null;
93+
FileInfo[] result = null;
9394
if (!dInfo.Exists) return result;
9495
try
9596
{
96-
if(FileSystemUtilities.IsDirectoryAttribute(dInfo)) result = dInfo.GetFiles();
97+
if (FileSystemUtilities.IsDirectoryAttribute(dInfo)) result = dInfo.GetFiles();
9798
}
9899
catch (UnauthorizedAccessException) { }
99100
return result;
@@ -163,7 +164,7 @@ public static String GetSpecialFolderFullPath(String fileName)
163164
}
164165
if (targetEnum == null) return null;
165166

166-
return System.Environment.GetFolderPath((Environment.SpecialFolder) targetEnum);
167+
return System.Environment.GetFolderPath((Environment.SpecialFolder)targetEnum);
167168
}
168169
public static String SanitizeFileName(String fileName)
169170
{
@@ -227,5 +228,13 @@ public static bool IsDirectoryHasReadAndWritePermission(String directoryPath)
227228
return false;
228229
}
229230
}
231+
public static bool isDriveReady(String path)
232+
{
233+
foreach (DriveInfo removableDrive in DriveInfo.GetDrives().Where(d => d.IsReady))
234+
{
235+
if (path.StartsWith(removableDrive.RootDirectory.Name)) return true;
236+
}
237+
return false;
238+
}
230239
}
231240
}

Properties/Settings.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Properties/Settings.settings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Value Profile="(Default)">0</Value>
1010
</Setting>
1111
<Setting Name="app_version_patch" Type="System.String" Scope="Application">
12-
<Value Profile="(Default)">6</Value>
12+
<Value Profile="(Default)">7</Value>
1313
</Setting>
1414
<Setting Name="app_version_revision" Type="System.String" Scope="Application">
1515
<Value Profile="(Default)">r1</Value>

0 commit comments

Comments
 (0)