Skip to content

Commit

Permalink
Merge pull request #15 from Rillke/3.5.0.2
Browse files Browse the repository at this point in the history
3.5.0.2
  • Loading branch information
Rillke committed Nov 5, 2020
2 parents 8e8c181 + 9efdb0c commit 739ef37
Show file tree
Hide file tree
Showing 10 changed files with 1,789 additions and 177 deletions.
4 changes: 4 additions & 0 deletions source/Contact-Conversion-Wizard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="SimpleInputDialog.resx">
<DependentUpon>SimpleInputDialog.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
Expand All @@ -155,6 +158,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="CCW-Large.ico" />
<None Include="Resources\ccw-small.bmp" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
117 changes: 100 additions & 17 deletions source/EditConfiguration.Designer.cs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions source/EditConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public EditConfiguration()
OPT_importOther.Checked = Form1.cfg_importOther;
OPT_DUPren.Checked = Form1.cfg_DUPren;

checkBox_OutlookEmptyNumber.Checked = Form1.outlook_empty_number;
checkBox_OutlookEmptyName.Checked = Form1.outlook_empty_name;

checkBox_cleanBrackets.Checked = !Form1.clean_brackets;
checkBox_cleanHashKey.Checked = !Form1.clean_hashkey;
Expand Down Expand Up @@ -46,6 +48,11 @@ private void EditConfiguration_FormClosing(object sender, FormClosingEventArgs e
Form1.cfg_importOther = OPT_importOther.Checked;
Form1.cfg_DUPren = OPT_DUPren.Checked;

Form1.outlook_empty_number = checkBox_OutlookEmptyNumber.Checked;
Form1.outlook_empty_name= checkBox_OutlookEmptyName.Checked;

Form1.nextcloud_vcf_fix = checkBox_nextcloud_vfc_fix.Checked;

Form1.clean_brackets = !checkBox_cleanBrackets.Checked;
Form1.clean_hashkey = !checkBox_cleanHashKey.Checked;
Form1.clean_slash = !checkBox_cleanSlash.Checked;
Expand Down
278 changes: 139 additions & 139 deletions source/Form1.Designer.cs

Large diffs are not rendered by default.

70 changes: 62 additions & 8 deletions source/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public partial class Form1 : Form
public static bool clean_letters = true;
public static bool clean_addzeroprefix = false;

public static bool outlook_empty_number = false;
public static bool outlook_empty_name = false;

public static bool nextcloud_vcf_fix = false;

public static bool cfg_DUPren = false;
public static bool cfg_checkVersion = true;
Expand Down Expand Up @@ -1150,10 +1154,41 @@ private ReadDataReturn read_data_Outlook(bool customfolder, bool categoryfilter)
myContact.preferred = CheckPREFERflag(NotesBody);
myContact.FRITZprefix = CheckPREFIXflag(NotesBody);

if (myContact.combinedname != "" && (myContact.home != string.Empty || myContact.work != string.Empty || myContact.mobile != string.Empty || myContact.homefax != string.Empty || myContact.workfax != string.Empty) && (NotesBody.Contains("CCW-IGNORE") == false))

if (NotesBody.Contains("CCW-IGNORE"))
{
addDataHash(ref duplicates, myContact);
// skip contact
}
else
{
// Export contacts with empty names and empty numbers
if (outlook_empty_name && outlook_empty_number)
{
addDataHash(ref duplicates, myContact);
}
// Export contact with a name and empty number
else if (!outlook_empty_name && myContact.combinedname != "" && outlook_empty_number)
{
addDataHash(ref duplicates, myContact);
}
// Export contact with a empty name and at least one number
else if (outlook_empty_name && (myContact.home != string.Empty || myContact.work != string.Empty || myContact.mobile != string.Empty || myContact.homefax != string.Empty || myContact.workfax != string.Empty) && !outlook_empty_number)
{
addDataHash(ref duplicates, myContact);
}
// Export contacts with a name and at least one number
else if (!outlook_empty_name && !outlook_empty_number && myContact.combinedname != "" && (myContact.home != string.Empty || myContact.work != string.Empty || myContact.mobile != string.Empty || myContact.homefax != string.Empty || myContact.workfax != string.Empty))
{
addDataHash(ref duplicates, myContact);
}
}


//if (myContact.combinedname != "" && (myContact.home != string.Empty || myContact.work != string.Empty || myContact.mobile != string.Empty || myContact.homefax != string.Empty || myContact.workfax != string.Empty) && (NotesBody.Contains("CCW-IGNORE") == false))
//{
//addDataHash(ref duplicates, myContact);
//}

}

return (new ReadDataReturn(duplicates));
Expand Down Expand Up @@ -1415,6 +1450,10 @@ private ReadDataReturn read_data_vCard(string filename, bool non_unicode)
string telnumber = vParseValue;

string types = vParseOptions.ToLower().Replace("type=", "");
if (nextcloud_vcf_fix)
{
types = types.Replace("\"", "");
}
string[] typearray = types.Split(new char[] { ';', ',' });

bool bit_preferred = false;
Expand Down Expand Up @@ -2921,7 +2960,7 @@ private void save_data_vCard(string filename, System.Collections.Hashtable workD
if (export_only_phone == true && (CleanUpNumberHome == string.Empty && CleanUpNumberWork == string.Empty && CleanUpNumberMobile == string.Empty))
{
// MessageBox.Show("Contact |" + CleanUpCombined + "| ignored, due to missing numbers");
// if yes, abort this foreach loop and contine to the next one
// if yes, abort this foreach loop and continue to the next one
continue;
}

Expand Down Expand Up @@ -3011,8 +3050,11 @@ private void save_data_vCard(string filename, System.Collections.Hashtable workD
resultstring.Append((string)saveDataHash.Value);
}

// Set Encoding to UTF-8 without BOM
System.Text.Encoding encoding = new System.Text.UTF8Encoding(false);

// actually write the file to disk
System.IO.File.WriteAllText(filename, resultstring.ToString(), Encoding.UTF8);
System.IO.File.WriteAllText(filename, resultstring.ToString(), encoding);
}

private void save_data_vCard_Gigaset(string filename, System.Collections.Hashtable workDataHash)
Expand Down Expand Up @@ -3920,6 +3962,12 @@ private void myConfig_Load()
if (ParseLine.Substring(0, ParseLine.IndexOf("\t")) == "cfg_prefixNONFB") { cfg_prefixNONFB = Convert.ToBoolean(ParseLine.Substring(ParseLine.IndexOf("\t") + 1)); continue; }
if (ParseLine.Substring(0, ParseLine.IndexOf("\t")) == "cfg_importOther") { cfg_importOther = Convert.ToBoolean(ParseLine.Substring(ParseLine.IndexOf("\t") + 1)); continue; }
if (ParseLine.Substring(0, ParseLine.IndexOf("\t")) == "cfg_DUPren") { cfg_DUPren = Convert.ToBoolean(ParseLine.Substring(ParseLine.IndexOf("\t") + 1)); continue; }

if (ParseLine.Substring(0, ParseLine.IndexOf("\t")) == "outlook_empty_number") { outlook_empty_number = Convert.ToBoolean(ParseLine.Substring(ParseLine.IndexOf("\t") + 1)); continue; }
if (ParseLine.Substring(0, ParseLine.IndexOf("\t")) == "outlook_empty_name") { outlook_empty_name = Convert.ToBoolean(ParseLine.Substring(ParseLine.IndexOf("\t") + 1)); continue; }

if (ParseLine.Substring(0, ParseLine.IndexOf("\t")) == "checkBox_nextcloud_vcf_fix ") { nextcloud_vcf_fix = Convert.ToBoolean(ParseLine.Substring(ParseLine.IndexOf("\t") + 1)); continue; }

if (ParseLine.Substring(0, ParseLine.IndexOf("\t")) == "cfg_checkVersion") { cfg_checkVersion = Convert.ToBoolean(ParseLine.Substring(ParseLine.IndexOf("\t") + 1)); continue; }
if (ParseLine.Substring(0, ParseLine.IndexOf("\t")) == "clean_brackets") { clean_brackets = Convert.ToBoolean(ParseLine.Substring(ParseLine.IndexOf("\t") + 1)); continue; }
if (ParseLine.Substring(0, ParseLine.IndexOf("\t")) == "clean_hashkey") { clean_hashkey = Convert.ToBoolean(ParseLine.Substring(ParseLine.IndexOf("\t") + 1)); continue; }
Expand Down Expand Up @@ -3956,6 +4004,12 @@ private void myConfig_Save()
sb.AppendLine("cfg_prefixNONFB" + "\t" + cfg_prefixNONFB.ToString());
sb.AppendLine("cfg_importOther" + "\t" + cfg_importOther.ToString());
sb.AppendLine("cfg_DUPren" + "\t" + cfg_DUPren.ToString());

sb.AppendLine("outlook_empty_number" + "\t" + outlook_empty_number.ToString());
sb.AppendLine("outlook_empty_name" + "\t" + outlook_empty_name.ToString());

sb.AppendLine("nextcloud_vcf_fix" + "\t" + nextcloud_vcf_fix.ToString());

sb.AppendLine("cfg_checkVersion" + "\t" + cfg_checkVersion.ToString());
sb.AppendLine("clean_brackets" + "\t" + clean_brackets.ToString());
sb.AppendLine("clean_hashkey" + "\t" + clean_hashkey.ToString());
Expand Down Expand Up @@ -4061,11 +4115,11 @@ private void button_website_Click(object sender, EventArgs e)
{
if (((Control.ModifierKeys & Keys.Shift) == Keys.Shift) || (this.button_website.ForeColor == System.Drawing.Color.Green))
{ // shift is pressed
System.Diagnostics.Process.Start("http://software.nv-systems.net/ccw/download");
System.Diagnostics.Process.Start("https://github.com/Rillke/Contact-Conversion-Wizard/releases/latest");
}
else
{ // no shift pressed
System.Diagnostics.Process.Start("http://software.nv-systems.net/ccw");
System.Diagnostics.Process.Start("https://github.com/Rillke/Contact-Conversion-Wizard");
}

}
Expand All @@ -4074,11 +4128,11 @@ private void button_forum_Click(object sender, EventArgs e)
{
if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
{ // shift is pressed
System.Diagnostics.Process.Start("www.ip-phone-forum.de/showthread.php?t=209976&goto=newpost");
System.Diagnostics.Process.Start("https://github.com/Rillke/Contact-Conversion-Wizard");
}
else
{ // no shift pressed
System.Diagnostics.Process.Start("www.ip-phone-forum.de/showthread.php?t=209976");
System.Diagnostics.Process.Start("https://github.com/Rillke/Contact-Conversion-Wizard/issues");
}
}

Expand Down
3 changes: 0 additions & 3 deletions source/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>157, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>157, 17</value>
</metadata>
<data name="btn_read_vCard.ToolTip" xml:space="preserve">
<value>Import Contacts from the standardised vCard file format.
This has been tested with GoogleMail, Apple Adressbook and jFritz vCard export files.
Expand Down
4 changes: 2 additions & 2 deletions source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.5.0.1")]
[assembly: AssemblyFileVersion("3.5.0.1")]
[assembly: AssemblyVersion("3.5.0.2")]
[assembly: AssemblyFileVersion("3.5.0.2")]
2 changes: 1 addition & 1 deletion source/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions source/SimpleInputDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 739ef37

Please sign in to comment.