Skip to content

Commit 43dfe6b

Browse files
committed
Change default paste for coordinates to "true"
1 parent 2564232 commit 43dfe6b

8 files changed

Lines changed: 57 additions & 45 deletions

FrmMainApp.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ public partial class FrmMainApp : Form
116116

117117
// this is for copy-paste
118118
// the elements are: EA, Value, Changed?
119-
internal static Dictionary<ElementAttribute, Tuple<string, bool>>
120-
CopyPoolDict = new();
119+
internal static Dictionary<ElementAttribute, Tuple<string, bool>> CopyPoolDict = new();
121120

122121
// this is for checking if files need to be re-parsed.
123122
internal static DataTable DtToponomySessionData;

FrmPasteWhat.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public partial class FrmPasteWhat : Form
2424
/// This Form controls what data to paste from a "current file" to "selected file(s)".
2525
/// The overall logic is different on whether the Paste takes place in the FrmMainApp or FrmEditFileData.
2626
/// - If the prior then stuff will come from FrmMainApp.CopyPoolDict - logic being that users can move around folders
27-
/// etc and we're pre-storing data in a "pool"
27+
/// etc. and we're pre-storing data in a "pool"
2828
/// - If the latter then things are a bit different because there is no "copy" so to say, only "paste" (ie there is no
2929
/// CTRL+C element taking place) and we take data directly from the file
3030
/// </summary>
@@ -102,7 +102,13 @@ public FrmPasteWhat(string initiator)
102102
searchAllChildren: true)
103103
.FirstOrDefault() is CheckBox cbx)
104104
{
105-
cbx.Checked = keyValuePair.Value.Item2;
105+
// activate checkboxes for anything that have changed or if they are coordinates. it's likely this will want to be pasted.
106+
cbx.Checked = keyValuePair.Value.Item2 ||
107+
GetElementAttributesName(attributeToFind: attribute) ==
108+
GetElementAttributesName(attributeToFind: ElementAttribute.GPSLatitude) ||
109+
GetElementAttributesName(attributeToFind: attribute) ==
110+
GetElementAttributesName(attributeToFind: ElementAttribute.GPSLongitude)
111+
;
106112
}
107113
}
108114
}

GeoTagNinja.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@
118118
</Reference>
119119
<Reference Include="PresentationCore" />
120120
<Reference Include="PresentationFramework" />
121-
<Reference Include="RestSharp, Version=110.2.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
122-
<HintPath>packages\RestSharp.110.2.0\lib\net471\RestSharp.dll</HintPath>
121+
<Reference Include="RestSharp, Version=112.0.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
122+
<HintPath>packages\RestSharp.112.0.0\lib\net48\RestSharp.dll</HintPath>
123123
</Reference>
124124
<Reference Include="SQLitePCLRaw.core, Version=2.1.8.2226, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
125125
<HintPath>packages\SQLitePCLRaw.core.2.1.8\lib\netstandard2.0\SQLitePCLRaw.core.dll</HintPath>

GeoTagNinja.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/CodeStyle/CodeCleanup/CleanupOnSave/@EntryValue">True</s:Boolean>
3+
<s:Boolean x:Key="/Default/CodeStyle/CodeCleanup/PartCleanupOnSave/@EntryValue">True</s:Boolean>
24
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/APPLY_ON_COMPLETION/@EntryValue">True</s:Boolean>
35
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/ARGUMENTS_ANONYMOUS_FUNCTION/@EntryValue">Named</s:String>
46
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/ARGUMENTS_LITERAL/@EntryValue">Named</s:String>

Helpers/HelperGenericAncillaryListsArrays.cs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,5 +1264,45 @@ internal static void GenerateFMTFile(bool includeAltitude, string exportFileFMTT
12641264
File.WriteAllText(path: fmtFilePath, contents: fmtFileContent);
12651265
}
12661266

1267-
#endregion
1267+
#endregion
1268+
1269+
#region Copy-Paste
1270+
1271+
internal static readonly List<ElementAttribute> TagsToCopy =
1272+
[
1273+
ElementAttribute.Coordinates,
1274+
ElementAttribute.GPSLatitude,
1275+
ElementAttribute.GPSLatitudeRef,
1276+
ElementAttribute.GPSLongitude,
1277+
ElementAttribute.GPSLongitudeRef,
1278+
ElementAttribute.GPSSpeed,
1279+
ElementAttribute.GPSSpeedRef,
1280+
ElementAttribute.GPSAltitude,
1281+
ElementAttribute.GPSAltitudeRef,
1282+
ElementAttribute.Country,
1283+
ElementAttribute.CountryCode,
1284+
ElementAttribute.State,
1285+
ElementAttribute.City,
1286+
ElementAttribute.Sub_location,
1287+
ElementAttribute.DestCoordinates,
1288+
ElementAttribute.GPSDestLatitude,
1289+
ElementAttribute.GPSDestLatitudeRef,
1290+
ElementAttribute.GPSDestLongitude,
1291+
ElementAttribute.GPSDestLongitudeRef,
1292+
ElementAttribute.GPSImgDirection,
1293+
ElementAttribute.GPSImgDirectionRef,
1294+
ElementAttribute.TakenDate,
1295+
ElementAttribute.CreateDate,
1296+
ElementAttribute.OffsetTime,
1297+
ElementAttribute.TakenDateSecondsShift,
1298+
ElementAttribute.TakenDateMinutesShift,
1299+
ElementAttribute.TakenDateHoursShift,
1300+
ElementAttribute.TakenDateDaysShift,
1301+
ElementAttribute.CreateDateSecondsShift,
1302+
ElementAttribute.CreateDateMinutesShift,
1303+
ElementAttribute.CreateDateHoursShift,
1304+
ElementAttribute.CreateDateDaysShift
1305+
];
1306+
1307+
#endregion
12681308
}

View/ListView/FileListViewCopyPaste.cs

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,7 @@ internal static void ListViewCopyGeoData()
3030
// ... then the DE-data would be cleared and thus cross-folder-paste wouldn't be possible
3131
FrmMainApp.CopyPoolDict.Clear();
3232

33-
List<ElementAttribute> listOfTagsToCopy = new()
34-
{
35-
ElementAttribute.Coordinates,
36-
ElementAttribute.GPSLatitude,
37-
ElementAttribute.GPSLatitudeRef,
38-
ElementAttribute.GPSLongitude,
39-
ElementAttribute.GPSLongitudeRef,
40-
ElementAttribute.GPSSpeed,
41-
ElementAttribute.GPSSpeedRef,
42-
ElementAttribute.GPSAltitude,
43-
ElementAttribute.GPSAltitudeRef,
44-
ElementAttribute.Country,
45-
ElementAttribute.CountryCode,
46-
ElementAttribute.State,
47-
ElementAttribute.City,
48-
ElementAttribute.Sub_location,
49-
ElementAttribute.DestCoordinates,
50-
ElementAttribute.GPSDestLatitude,
51-
ElementAttribute.GPSDestLatitudeRef,
52-
ElementAttribute.GPSDestLongitude,
53-
ElementAttribute.GPSDestLongitudeRef,
54-
ElementAttribute.GPSImgDirection,
55-
ElementAttribute.GPSImgDirectionRef,
56-
ElementAttribute.TakenDate,
57-
ElementAttribute.CreateDate,
58-
ElementAttribute.OffsetTime,
59-
ElementAttribute.TakenDateSecondsShift,
60-
ElementAttribute.TakenDateMinutesShift,
61-
ElementAttribute.TakenDateHoursShift,
62-
ElementAttribute.TakenDateDaysShift,
63-
ElementAttribute.CreateDateSecondsShift,
64-
ElementAttribute.CreateDateMinutesShift,
65-
ElementAttribute.CreateDateHoursShift,
66-
ElementAttribute.CreateDateDaysShift
67-
};
68-
69-
foreach (ElementAttribute attribute in listOfTagsToCopy)
33+
foreach (ElementAttribute attribute in HelperGenericAncillaryListsArrays.TagsToCopy)
7034
{
7135
// this would sit in Stage3ReadyToWrite if exists
7236
if (dirElemFileToCopyFrom.HasSpecificAttributeWithVersion(

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
**Build 9xxx [20240xxx]**
44
- NEW & UPDATED:
55
- Rewrote the SQL handling logic to use DataTables and Transactions rather than write ~~everyone~~ everything [_I swear guv I was sober..._] on a one-by-one basis. Jolly achievement for someone that claims to be a SQL dev rather than a C# dev but alas.
6+
- When using copy-paste the Coordinates will now be default-enabled for paste. It's logical that people would want to paste this piece of data if available.
67
- BUGS & FIXES:
78
- Application should no longer crash when encountering an invalid piece of Exif data #118
89
- Added some logic to enable returning to `C:\` if the user enters a 'fake' folder name.

packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<package id="Microsoft.WindowsAPICodePack.Shell" version="1.1.0" targetFramework="net48" />
1616
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
1717
<package id="NLog" version="5.2.3" targetFramework="net48" />
18-
<package id="RestSharp" version="110.2.0" targetFramework="net48" />
18+
<package id="RestSharp" version="112.0.0" targetFramework="net48" />
1919
<package id="SQLitePCLRaw.core" version="2.1.8" targetFramework="net48" />
2020
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.118.0" targetFramework="net48" />
2121
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />

0 commit comments

Comments
 (0)