Skip to content

Commit 94cb8a6

Browse files
committed
settings form opens with parameter -s or --settings.
1 parent 3c86356 commit 94cb8a6

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

QuietCopy/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ internal class Program
1616
{
1717
static string[] drives;
1818
private static string destPath;
19+
[STAThread]
1920
static void Main(string[] args)
2021
{
2122
if (args.Length != 0)
2223
{
23-
if (args[0] == "--settings" || args[0] == "-s")
24+
if (args[0].Contains("--settings")|| args[0].Contains("-s"))
2425
{
2526
Application.Run(new SettingsMan());
2627
}
@@ -77,6 +78,7 @@ private static void copyDrive(string drive)
7778
}
7879
static void copyDir(string dir)
7980
{
81+
//copy all files in directory
8082
foreach (string path in Directory.GetFiles(dir))
8183
{
8284

@@ -93,6 +95,7 @@ static void copyDir(string dir)
9395
}
9496
}
9597
}
98+
//run copy dire on all subdirs
9699
foreach(string path in Directory.GetDirectories(dir))
97100
{
98101
copyDir(path);

QuietCopy/QuietCopy.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
3030
<WebPage>inst.html</WebPage>
3131
<AutorunEnabled>true</AutorunEnabled>
32-
<ApplicationRevision>3</ApplicationRevision>
32+
<ApplicationRevision>4</ApplicationRevision>
3333
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
3434
<UseApplicationTrust>false</UseApplicationTrust>
3535
<PublishWizardCompleted>true</PublishWizardCompleted>

QuietCopy/SettingsMan.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,18 @@ private void saveBut_Click(object sender, EventArgs e)
5656

5757
private void destDirBut_Click(object sender, EventArgs e)
5858
{
59-
FolderBrowserDialog dialog = new FolderBrowserDialog();
60-
dialog.RootFolder = Environment.SpecialFolder.MyVideos;
61-
if(dialog.ShowDialog() == DialogResult.OK)
59+
try
6260
{
63-
destDirTbox.Text = dialog.SelectedPath;
61+
FolderBrowserDialog dialog = new FolderBrowserDialog();
62+
dialog.RootFolder = Environment.SpecialFolder.MyVideos;
63+
if (dialog.ShowDialog() == DialogResult.OK)
64+
{
65+
destDirTbox.Text = dialog.SelectedPath;
66+
}
67+
}
68+
catch (Exception ex)
69+
{
70+
MessageBox.Show(ex.Message);
6471
}
6572
}
6673
}

QuietCopy/publish.zip

293 KB
Binary file not shown.

0 commit comments

Comments
 (0)