diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..a7184f71b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,9 @@ +# These are supported funding model platforms + +# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +github: lakritzator +patreon: # Replace with a single Patreon username +open_collective: greenshot +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +custom: https://getgreenshot.org/support/ diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..1f5ca2f11 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,33 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +This GitHub repository is for developers, if you want to report a bug for Greenshot as a user please do so in our JIRA issue system here: https://greenshot.atlassian.net/projects/BUGS/issues/filter=allopenissues + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Example steps to reproduce the behavior: +1. Capture '....' +2. Open Editor +3. Add a line +4. Resize + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Versions (please complete the following information):** + - Greenshot version + - Windows version + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/developer-bug-report.md b/.github/ISSUE_TEMPLATE/developer-bug-report.md new file mode 100644 index 000000000..1ffa7da1e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/developer-bug-report.md @@ -0,0 +1,33 @@ +--- +name: Developer Bug report +about: Create a bug report to help us improve our code +title: '' +labels: '' +assignees: '' + +--- + +This GitHub repository is for developers, if you want to report a bug for Greenshot as a user please do so in our JIRA issue system here: https://greenshot.atlassian.net/projects/BUGS/issues/filter=allopenissues + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Example steps to reproduce the behavior: +1. Capture '....' +2. Open Editor +3. Add a line +4. Resize + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Versions (please complete the following information):** + - Greenshot version + - Windows version + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/developer-feature-request.md b/.github/ISSUE_TEMPLATE/developer-feature-request.md new file mode 100644 index 000000000..883534a57 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/developer-feature-request.md @@ -0,0 +1,22 @@ +--- +name: Developer feature request +about: Suggest an technical idea for this project +title: '' +labels: '' +assignees: '' + +--- + +This GitHub repository is for developers, if you want to request a feature for Greenshot as a user please do so in our JIRA issue system here: https://greenshot.atlassian.net/projects/FEATURE/issues/filter=allopenissues + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..64323a13d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,22 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +This GitHub repository is for developers, if you want to request a feature for Greenshot as a user please do so in our JIRA issue system here: https://greenshot.atlassian.net/projects/FEATURE/issues/filter=allopenissues + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.gitignore b/.gitignore index 2f5969501..3afd2d7ab 100644 --- a/.gitignore +++ b/.gitignore @@ -211,4 +211,7 @@ _Pvt_Extensions/ ModelManifest.xml # Greenshot credentials files -*.credentials.cs \ No newline at end of file +*.credentials.cs + +# Rider files +.idea \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index ce53be91e..1a2e9d3a4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@  - Copyright © Greenshot 2004-2020 + Copyright © Greenshot 2004-2021 Greenshot https://getgreenshot.org/favicon.ico https://github.com/greenshot/greenshot @@ -18,6 +18,7 @@ true net472 Off + true @@ -102,19 +103,10 @@ - + + - - $(userprofile)\.nuget\packages\msbuildtasks\1.5.0.235\tools\ - - - - - - - - + $(PkgMSBuildTasks)\tools\ + + + + + + + + + \ No newline at end of file diff --git a/Greenshot.sln b/Greenshot.sln index 6b3723f7a..27df62d85 100644 --- a/Greenshot.sln +++ b/Greenshot.sln @@ -54,172 +54,129 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|x86.ActiveCfg = Debug|Any CPU {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Debug|x86.Build.0 = Debug|Any CPU {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|Any CPU.ActiveCfg = Release|Any CPU {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|Any CPU.Build.0 = Release|Any CPU - {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|x86.ActiveCfg = Release|Any CPU {CD642BF4-D815-4D67-A0B5-C69F0B8231AF}.Release|x86.Build.0 = Release|Any CPU {5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|x86.ActiveCfg = Debug|Any CPU {5B924697-4DCD-4F98-85F1-105CB84B7341}.Debug|x86.Build.0 = Debug|Any CPU {5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|Any CPU.ActiveCfg = Release|Any CPU {5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|Any CPU.Build.0 = Release|Any CPU - {5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|x86.ActiveCfg = Release|Any CPU {5B924697-4DCD-4F98-85F1-105CB84B7341}.Release|x86.Build.0 = Release|Any CPU {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Debug|x86.ActiveCfg = Debug|Any CPU {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Debug|x86.Build.0 = Debug|Any CPU {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Release|Any CPU.ActiveCfg = Release|Any CPU {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Release|Any CPU.Build.0 = Release|Any CPU - {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Release|x86.ActiveCfg = Release|Any CPU {47F23C86-604E-4CC3-8767-B3D4088F30BB}.Release|x86.Build.0 = Release|Any CPU {C3052651-598A-44E2-AAB3-2E41311D50F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C3052651-598A-44E2-AAB3-2E41311D50F9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C3052651-598A-44E2-AAB3-2E41311D50F9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {C3052651-598A-44E2-AAB3-2E41311D50F9}.Debug|x86.ActiveCfg = Debug|Any CPU {C3052651-598A-44E2-AAB3-2E41311D50F9}.Debug|x86.Build.0 = Debug|Any CPU {C3052651-598A-44E2-AAB3-2E41311D50F9}.Release|Any CPU.ActiveCfg = Release|Any CPU {C3052651-598A-44E2-AAB3-2E41311D50F9}.Release|Any CPU.Build.0 = Release|Any CPU - {C3052651-598A-44E2-AAB3-2E41311D50F9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {C3052651-598A-44E2-AAB3-2E41311D50F9}.Release|x86.ActiveCfg = Release|Any CPU {C3052651-598A-44E2-AAB3-2E41311D50F9}.Release|x86.Build.0 = Release|Any CPU {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Debug|Any CPU.Build.0 = Debug|Any CPU - {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Debug|x86.ActiveCfg = Debug|Any CPU {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Debug|x86.Build.0 = Debug|Any CPU {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Release|Any CPU.ActiveCfg = Release|Any CPU {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Release|Any CPU.Build.0 = Release|Any CPU - {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Release|x86.ActiveCfg = Release|Any CPU {80D8DEB9-94E3-4876-8CCA-2DF1ED5F2C50}.Release|x86.Build.0 = Release|Any CPU {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Debug|x86.ActiveCfg = Debug|Any CPU {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Debug|x86.Build.0 = Debug|Any CPU {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Release|Any CPU.ActiveCfg = Release|Any CPU {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Release|Any CPU.Build.0 = Release|Any CPU - {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Release|x86.ActiveCfg = Release|Any CPU {19FEEF09-313F-43C7-819D-F1BCA782B08B}.Release|x86.Build.0 = Release|Any CPU {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Debug|x86.ActiveCfg = Debug|Any CPU {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Debug|x86.Build.0 = Debug|Any CPU {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Release|Any CPU.ActiveCfg = Release|Any CPU {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Release|Any CPU.Build.0 = Release|Any CPU - {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Release|x86.ActiveCfg = Release|Any CPU {C6988EE8-2FEE-4349-9F09-F9628A0D8965}.Release|x86.Build.0 = Release|Any CPU {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Debug|x86.ActiveCfg = Debug|Any CPU {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Debug|x86.Build.0 = Debug|Any CPU {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Release|Any CPU.ActiveCfg = Release|Any CPU {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Release|Any CPU.Build.0 = Release|Any CPU - {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Release|Mixed Platforms.Build.0 = Release|Any CPU {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Release|x86.ActiveCfg = Release|Any CPU {D61E6ECE-E0B6-4467-B492-F08A06BA8F02}.Release|x86.Build.0 = Release|Any CPU {697CF066-9077-4F22-99D9-D989CCE7282B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {697CF066-9077-4F22-99D9-D989CCE7282B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {697CF066-9077-4F22-99D9-D989CCE7282B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {697CF066-9077-4F22-99D9-D989CCE7282B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {697CF066-9077-4F22-99D9-D989CCE7282B}.Debug|x86.ActiveCfg = Debug|Any CPU {697CF066-9077-4F22-99D9-D989CCE7282B}.Debug|x86.Build.0 = Debug|Any CPU {697CF066-9077-4F22-99D9-D989CCE7282B}.Release|Any CPU.ActiveCfg = Release|Any CPU {697CF066-9077-4F22-99D9-D989CCE7282B}.Release|Any CPU.Build.0 = Release|Any CPU - {697CF066-9077-4F22-99D9-D989CCE7282B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {697CF066-9077-4F22-99D9-D989CCE7282B}.Release|x86.ActiveCfg = Release|Any CPU {697CF066-9077-4F22-99D9-D989CCE7282B}.Release|x86.Build.0 = Release|Any CPU {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Debug|x86.ActiveCfg = Debug|Any CPU {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Debug|x86.Build.0 = Debug|Any CPU {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Release|Any CPU.ActiveCfg = Release|Any CPU {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Release|Any CPU.Build.0 = Release|Any CPU - {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Release|x86.ActiveCfg = Release|Any CPU {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}.Release|x86.Build.0 = Release|Any CPU {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Debug|x86.ActiveCfg = Debug|Any CPU {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Debug|x86.Build.0 = Debug|Any CPU {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Release|Any CPU.ActiveCfg = Release|Any CPU {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Release|Any CPU.Build.0 = Release|Any CPU - {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Release|x86.ActiveCfg = Release|Any CPU {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}.Release|x86.Build.0 = Release|Any CPU {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Debug|x86.ActiveCfg = Debug|Any CPU {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Debug|x86.Build.0 = Debug|Any CPU {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Release|Any CPU.ActiveCfg = Release|Any CPU {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Release|Any CPU.Build.0 = Release|Any CPU - {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Release|x86.ActiveCfg = Release|Any CPU {1893A2E4-A78A-4713-A8E7-E70058DABEE0}.Release|x86.Build.0 = Release|Any CPU {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Debug|x86.ActiveCfg = Debug|Any CPU {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Debug|x86.Build.0 = Debug|Any CPU {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Release|Any CPU.ActiveCfg = Release|Any CPU {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Release|Any CPU.Build.0 = Release|Any CPU - {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Release|Mixed Platforms.Build.0 = Release|Any CPU {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Release|x86.ActiveCfg = Release|Any CPU {92599C09-FF29-4ABD-B6E6-C48ECD781BAB}.Release|x86.Build.0 = Release|Any CPU {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Debug|x86.ActiveCfg = Debug|Any CPU {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Debug|x86.Build.0 = Debug|Any CPU {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Release|Any CPU.ActiveCfg = Release|Any CPU {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Release|Any CPU.Build.0 = Release|Any CPU - {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Release|Mixed Platforms.Build.0 = Release|Any CPU {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Release|x86.ActiveCfg = Release|Any CPU {9C0ECC4C-7807-4111-916A-4F57BB29788A}.Release|x86.Build.0 = Release|Any CPU {9801F62C-540F-4BFE-9211-6405DEDE563B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9801F62C-540F-4BFE-9211-6405DEDE563B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9801F62C-540F-4BFE-9211-6405DEDE563B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9801F62C-540F-4BFE-9211-6405DEDE563B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {9801F62C-540F-4BFE-9211-6405DEDE563B}.Debug|x86.ActiveCfg = Debug|Any CPU {9801F62C-540F-4BFE-9211-6405DEDE563B}.Debug|x86.Build.0 = Debug|Any CPU {9801F62C-540F-4BFE-9211-6405DEDE563B}.Release|Any CPU.ActiveCfg = Release|Any CPU {9801F62C-540F-4BFE-9211-6405DEDE563B}.Release|Any CPU.Build.0 = Release|Any CPU - {9801F62C-540F-4BFE-9211-6405DEDE563B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9801F62C-540F-4BFE-9211-6405DEDE563B}.Release|Mixed Platforms.Build.0 = Release|Any CPU {9801F62C-540F-4BFE-9211-6405DEDE563B}.Release|x86.ActiveCfg = Release|Any CPU {9801F62C-540F-4BFE-9211-6405DEDE563B}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection diff --git a/Greenshot.sln.DotSettings b/Greenshot.sln.DotSettings new file mode 100644 index 000000000..aecc39af3 --- /dev/null +++ b/Greenshot.sln.DotSettings @@ -0,0 +1,4 @@ + + True + True + True \ No newline at end of file diff --git a/Greenshot/Configuration/EditorConfiguration.cs b/Greenshot/Configuration/EditorConfiguration.cs index 61bdc0733..019ea9ef6 100644 --- a/Greenshot/Configuration/EditorConfiguration.cs +++ b/Greenshot/Configuration/EditorConfiguration.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Configuration/LanguageKeys.cs b/Greenshot/Configuration/LanguageKeys.cs index 08f982374..022f141f1 100644 --- a/Greenshot/Configuration/LanguageKeys.cs +++ b/Greenshot/Configuration/LanguageKeys.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Controls/BindableToolStripButton.cs b/Greenshot/Controls/BindableToolStripButton.cs index 893264403..b44a1a31c 100644 --- a/Greenshot/Controls/BindableToolStripButton.cs +++ b/Greenshot/Controls/BindableToolStripButton.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Controls/BindableToolStripComboBox.cs b/Greenshot/Controls/BindableToolStripComboBox.cs index e6e8ad105..3637f2380 100644 --- a/Greenshot/Controls/BindableToolStripComboBox.cs +++ b/Greenshot/Controls/BindableToolStripComboBox.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Controls/BindableToolStripDropDownButton.cs b/Greenshot/Controls/BindableToolStripDropDownButton.cs index 4a04e1f23..4071d6b81 100644 --- a/Greenshot/Controls/BindableToolStripDropDownButton.cs +++ b/Greenshot/Controls/BindableToolStripDropDownButton.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Controls/ColorButton.cs b/Greenshot/Controls/ColorButton.cs index 935729732..fe31d2e11 100644 --- a/Greenshot/Controls/ColorButton.cs +++ b/Greenshot/Controls/ColorButton.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -24,6 +24,7 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; using GreenshotPlugin.Controls; +using ColorDialog = Greenshot.Forms.ColorDialog; namespace Greenshot.Controls { /// diff --git a/Greenshot/Controls/ContextMenuToolStripProfessionalRenderer.cs b/Greenshot/Controls/ContextMenuToolStripProfessionalRenderer.cs index 5031f82bb..e5ebf5478 100644 --- a/Greenshot/Controls/ContextMenuToolStripProfessionalRenderer.cs +++ b/Greenshot/Controls/ContextMenuToolStripProfessionalRenderer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Controls/CustomToolStripProfessionalRenderer.cs b/Greenshot/Controls/CustomToolStripProfessionalRenderer.cs index cb851ea2f..d559d771b 100644 --- a/Greenshot/Controls/CustomToolStripProfessionalRenderer.cs +++ b/Greenshot/Controls/CustomToolStripProfessionalRenderer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Controls/FontFamilyComboBox.cs b/Greenshot/Controls/FontFamilyComboBox.cs index dc5975be3..d37244eab 100644 --- a/Greenshot/Controls/FontFamilyComboBox.cs +++ b/Greenshot/Controls/FontFamilyComboBox.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Controls/MenuStripEx.cs b/Greenshot/Controls/MenuStripEx.cs index ea973a791..31aa8f190 100644 --- a/Greenshot/Controls/MenuStripEx.cs +++ b/Greenshot/Controls/MenuStripEx.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Controls/NonJumpingPanel.cs b/Greenshot/Controls/NonJumpingPanel.cs index 51658a105..d5565c637 100644 --- a/Greenshot/Controls/NonJumpingPanel.cs +++ b/Greenshot/Controls/NonJumpingPanel.cs @@ -1,6 +1,6 @@ -/* +/* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -22,33 +22,49 @@ using System.Drawing; using System.Windows.Forms; -namespace GreenshotPlugin.Controls { - /// - /// See: http://nickstips.wordpress.com/2010/03/03/c-panel-resets-scroll-position-after-focus-is-lost-and-regained/ - /// - public class NonJumpingPanel : Panel { - protected override Point ScrollToControl(Control activeControl) { - // Returning the current location prevents the panel from - // scrolling to the active control when the panel loses and regains focus - return DisplayRectangle.Location; - } +namespace Greenshot.Controls +{ + /// + /// See: http://nickstips.wordpress.com/2010/03/03/c-panel-resets-scroll-position-after-focus-is-lost-and-regained/ + /// + public class NonJumpingPanel : Panel + { + protected override Point ScrollToControl(Control activeControl) + { + // Returning the current location prevents the panel from + // scrolling to the active control when the panel loses and regains focus + return DisplayRectangle.Location; + } - /// - /// Add horizontal scrolling to the panel, when using the wheel and the shift key is pressed - /// - /// MouseEventArgs - protected override void OnMouseWheel(MouseEventArgs e) - { - if (VScroll && (ModifierKeys & Keys.Shift) == Keys.Shift) - { - VScroll = false; - base.OnMouseWheel(e); - VScroll = true; - } - else - { - base.OnMouseWheel(e); - } - } - } + /// + /// Add horizontal scrolling to the panel, when using the wheel and the shift key is pressed + /// + /// MouseEventArgs + protected override void OnMouseWheel(MouseEventArgs e) + { + //Check if Scrollbars available and CTRL key pressed -> Zoom IN OUT + if ((VScroll || HScroll) && (ModifierKeys & Keys.Control) == Keys.Control) + { + VScroll = false; + HScroll = false; + base.OnMouseWheel(e); + VScroll = true; + HScroll = true; + } + else + { + //Vertical Scoll with SHIFT key pressed + if (VScroll && (ModifierKeys & Keys.Shift) == Keys.Shift) + { + VScroll = false; + base.OnMouseWheel(e); + VScroll = true; + } + else + { + base.OnMouseWheel(e); + } + } + } + } } diff --git a/Greenshot/Controls/Pipette.cs b/Greenshot/Controls/Pipette.cs index bbe2b5686..ca7333d81 100644 --- a/Greenshot/Controls/Pipette.cs +++ b/Greenshot/Controls/Pipette.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -25,6 +25,7 @@ using System.Windows.Forms; using Greenshot.Forms; using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.UnmanagedHelpers.Enums; +using ColorDialog = Greenshot.Forms.ColorDialog; namespace Greenshot.Controls { /// diff --git a/Greenshot/Controls/ToolStripColorButton.cs b/Greenshot/Controls/ToolStripColorButton.cs index 706a54cf3..951e117fd 100644 --- a/Greenshot/Controls/ToolStripColorButton.cs +++ b/Greenshot/Controls/ToolStripColorButton.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -24,6 +24,7 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; using GreenshotPlugin.Controls; +using ColorDialog = Greenshot.Forms.ColorDialog; namespace Greenshot.Controls { public class ToolStripColorButton : ToolStripButton, INotifyPropertyChanged, IGreenshotLanguageBindable { diff --git a/Greenshot/Controls/ToolStripEx.cs b/Greenshot/Controls/ToolStripEx.cs index b3f669fdd..7d2ca63ed 100644 --- a/Greenshot/Controls/ToolStripEx.cs +++ b/Greenshot/Controls/ToolStripEx.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Controls/ToolStripNumericUpDown.cs b/Greenshot/Controls/ToolStripNumericUpDown.cs index 2cb53314b..13652fc41 100644 --- a/Greenshot/Controls/ToolStripNumericUpDown.cs +++ b/Greenshot/Controls/ToolStripNumericUpDown.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Destinations/ClipboardDestination.cs b/Greenshot/Destinations/ClipboardDestination.cs index 9cfb0aec5..a1172ede4 100644 --- a/Greenshot/Destinations/ClipboardDestination.cs +++ b/Greenshot/Destinations/ClipboardDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Destinations/EditorDestination.cs b/Greenshot/Destinations/EditorDestination.cs index 09cce0f56..415607640 100644 --- a/Greenshot/Destinations/EditorDestination.cs +++ b/Greenshot/Destinations/EditorDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -22,6 +22,7 @@ using System; using System.Collections.Generic; using System.Drawing; using Greenshot.Configuration; +using Greenshot.Forms; using GreenshotPlugin.Core; using GreenshotPlugin.IniFile; using GreenshotPlugin.Interfaces; diff --git a/Greenshot/Destinations/EmailDestination.cs b/Greenshot/Destinations/EmailDestination.cs index abda77c7c..326e27e9c 100644 --- a/Greenshot/Destinations/EmailDestination.cs +++ b/Greenshot/Destinations/EmailDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -26,6 +26,7 @@ using Greenshot.Configuration; using Greenshot.Helpers; using GreenshotPlugin.Core; using GreenshotPlugin.Interfaces; +using Microsoft.Win32; namespace Greenshot.Destinations { /// @@ -39,12 +40,9 @@ namespace Greenshot.Destinations { static EmailDestination() { // Logic to decide what email implementation we use - if (!EmailConfigHelper.HasMapi()) return; - - _isActiveFlag = false; - _mapiClient = EmailConfigHelper.GetMapiClient(); + _mapiClient = RegistryHive.LocalMachine.ReadKey64Or32(@"Clients\Mail"); if (!string.IsNullOrEmpty(_mapiClient)) { - // Active as we have a mapi client, can be disabled later + // Active as we have a MAPI client, can be disabled later _isActiveFlag = true; } } @@ -66,11 +64,9 @@ namespace Greenshot.Destinations { if (_isActiveFlag) { // Disable if the office plugin is installed and the client is outlook // TODO: Change this! It always creates an exception, as the plugin has not been loaded the type is not there :( - Type outlookdestination = Type.GetType("GreenshotOfficePlugin.OutlookDestination,GreenshotOfficePlugin"); - if (outlookdestination != null) { - if (_mapiClient.ToLower().Contains("microsoft outlook")) { - _isActiveFlag = false; - } + var outlookDestination = Type.GetType("GreenshotOfficePlugin.OutlookDestination,GreenshotOfficePlugin", false); + if (outlookDestination != null && _mapiClient.ToLower().Contains("microsoft outlook")) { + _isActiveFlag = false; } } return base.IsActive && _isActiveFlag; diff --git a/Greenshot/Destinations/FileDestination.cs b/Greenshot/Destinations/FileDestination.cs index 559d28135..d6e89c0d5 100644 --- a/Greenshot/Destinations/FileDestination.cs +++ b/Greenshot/Destinations/FileDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -24,6 +24,7 @@ using System.IO; using System.Windows.Forms; using Greenshot.Configuration; +using Greenshot.Forms; using GreenshotPlugin.Core; using GreenshotPlugin.Controls; using GreenshotPlugin.IniFile; diff --git a/Greenshot/Destinations/FileWithDialogDestination.cs b/Greenshot/Destinations/FileWithDialogDestination.cs index e211d14f7..b378f5f34 100644 --- a/Greenshot/Destinations/FileWithDialogDestination.cs +++ b/Greenshot/Destinations/FileWithDialogDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Destinations/PickerDestination.cs b/Greenshot/Destinations/PickerDestination.cs index 26f8fbfb5..e7ea94c83 100644 --- a/Greenshot/Destinations/PickerDestination.cs +++ b/Greenshot/Destinations/PickerDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Destinations/PrinterDestination.cs b/Greenshot/Destinations/PrinterDestination.cs index e2156256b..3a45268e2 100644 --- a/Greenshot/Destinations/PrinterDestination.cs +++ b/Greenshot/Destinations/PrinterDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Adorners/AbstractAdorner.cs b/Greenshot/Drawing/Adorners/AbstractAdorner.cs index ecf0ce53d..5461b4df4 100644 --- a/Greenshot/Drawing/Adorners/AbstractAdorner.cs +++ b/Greenshot/Drawing/Adorners/AbstractAdorner.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ diff --git a/Greenshot/Drawing/Adorners/MoveAdorner.cs b/Greenshot/Drawing/Adorners/MoveAdorner.cs index 916d569f4..c8ef3ea22 100644 --- a/Greenshot/Drawing/Adorners/MoveAdorner.cs +++ b/Greenshot/Drawing/Adorners/MoveAdorner.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ diff --git a/Greenshot/Drawing/Adorners/ResizeAdorner.cs b/Greenshot/Drawing/Adorners/ResizeAdorner.cs index d624add48..b2e7261a9 100644 --- a/Greenshot/Drawing/Adorners/ResizeAdorner.cs +++ b/Greenshot/Drawing/Adorners/ResizeAdorner.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ diff --git a/Greenshot/Drawing/Adorners/TargetAdorner.cs b/Greenshot/Drawing/Adorners/TargetAdorner.cs index 542657c14..e0d0bbf13 100644 --- a/Greenshot/Drawing/Adorners/TargetAdorner.cs +++ b/Greenshot/Drawing/Adorners/TargetAdorner.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ diff --git a/Greenshot/Drawing/ArrowContainer.cs b/Greenshot/Drawing/ArrowContainer.cs index 739f9d430..acfd1ad03 100644 --- a/Greenshot/Drawing/ArrowContainer.cs +++ b/Greenshot/Drawing/ArrowContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/CropContainer.cs b/Greenshot/Drawing/CropContainer.cs index 58cee17b1..da160f11e 100644 --- a/Greenshot/Drawing/CropContainer.cs +++ b/Greenshot/Drawing/CropContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -57,12 +57,13 @@ namespace Greenshot.Drawing { /// (we create a transparent brown over the complete picture) /// public override Rectangle DrawingBounds { - get { - if (_parent?.Image is Image image) { + get + { + if (_parent?.Image is { } image) { return new Rectangle(0, 0, image.Width, image.Height); - } else { - return Rectangle.Empty; } + + return Rectangle.Empty; } } @@ -89,11 +90,9 @@ namespace Greenshot.Drawing { g.FillRectangle(cropBrush, new Rectangle(0, cropRectangle.Top + cropRectangle.Height, imageSize.Width, imageSize.Height - (cropRectangle.Top + cropRectangle.Height))); } - public override bool HasContextMenu { - get { - // No context menu for the CropContainer - return false; - } - } + /// + /// No context menu for the CropContainer + /// + public override bool HasContextMenu => false; } } diff --git a/Greenshot/Drawing/CursorContainer.cs b/Greenshot/Drawing/CursorContainer.cs index 1c756dd83..7b3078510 100644 --- a/Greenshot/Drawing/CursorContainer.cs +++ b/Greenshot/Drawing/CursorContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/DrawableContainer.cs b/Greenshot/Drawing/DrawableContainer.cs index 6c4433662..bc0973300 100644 --- a/Greenshot/Drawing/DrawableContainer.cs +++ b/Greenshot/Drawing/DrawableContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -98,8 +98,8 @@ namespace Greenshot.Drawing [NonSerialized] private PropertyChangedEventHandler _propertyChanged; public event PropertyChangedEventHandler PropertyChanged { - add { _propertyChanged += value; } - remove{ _propertyChanged -= value; } + add => _propertyChanged += value; + remove => _propertyChanged -= value; } public IList Filters { @@ -117,22 +117,18 @@ namespace Greenshot.Drawing [NonSerialized] internal Surface _parent; public ISurface Parent { - get { return _parent; } - set { SwitchParent((Surface)value); } + get => _parent; + set => SwitchParent((Surface)value); } [NonSerialized] private TargetAdorner _targetAdorner; - public TargetAdorner TargetAdorner { - get { - return _targetAdorner; - } - } + public TargetAdorner TargetAdorner => _targetAdorner; [NonSerialized] private bool _selected; public bool Selected { - get {return _selected;} + get => _selected; set { _selected = value; OnPropertyChanged("Selected"); @@ -142,18 +138,14 @@ namespace Greenshot.Drawing [NonSerialized] private EditStatus _status = EditStatus.UNDRAWN; public EditStatus Status { - get { - return _status; - } - set { - _status = value; - } + get => _status; + set => _status = value; } private int left; public int Left { - get { return left; } + get => left; set { if (value == left) { return; @@ -164,7 +156,7 @@ namespace Greenshot.Drawing private int top; public int Top { - get { return top; } + get => top; set { if (value == top) { return; @@ -175,7 +167,7 @@ namespace Greenshot.Drawing private int width; public int Width { - get { return width; } + get => width; set { if (value == width) { return; @@ -186,7 +178,7 @@ namespace Greenshot.Drawing private int height; public int Height { - get { return height; } + get => height; set { if (value == height) { return; @@ -196,9 +188,7 @@ namespace Greenshot.Drawing } public Point Location { - get { - return new Point(left, top); - } + get => new Point(left, top); set { left = value.X; top = value.Y; @@ -330,11 +320,7 @@ namespace Greenshot.Drawing Adorners.Add(new ResizeAdorner(this, Positions.MiddleRight)); } - public bool hasFilters { - get { - return Filters.Count > 0; - } - } + public bool hasFilters => Filters.Count > 0; public abstract void Draw(Graphics graphics, RenderMode renderMode); diff --git a/Greenshot/Drawing/DrawableContainerList.cs b/Greenshot/Drawing/DrawableContainerList.cs index 666986002..a7107543e 100644 --- a/Greenshot/Drawing/DrawableContainerList.cs +++ b/Greenshot/Drawing/DrawableContainerList.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -30,6 +30,7 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Threading; using System.Windows.Forms; +using Greenshot.Forms; using GreenshotPlugin.Interfaces; namespace Greenshot.Drawing { diff --git a/Greenshot/Drawing/EllipseContainer.cs b/Greenshot/Drawing/EllipseContainer.cs index c7a3985d6..b7d03ecfe 100644 --- a/Greenshot/Drawing/EllipseContainer.cs +++ b/Greenshot/Drawing/EllipseContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/AbstractFieldHolder.cs b/Greenshot/Drawing/Fields/AbstractFieldHolder.cs index 561501634..48dfd95f9 100644 --- a/Greenshot/Drawing/Fields/AbstractFieldHolder.cs +++ b/Greenshot/Drawing/Fields/AbstractFieldHolder.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/AbstractFieldHolderWithChildren.cs b/Greenshot/Drawing/Fields/AbstractFieldHolderWithChildren.cs index 636e708e4..bb6ae068c 100644 --- a/Greenshot/Drawing/Fields/AbstractFieldHolderWithChildren.cs +++ b/Greenshot/Drawing/Fields/AbstractFieldHolderWithChildren.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/Binding/AbstractBindingConverter.cs b/Greenshot/Drawing/Fields/Binding/AbstractBindingConverter.cs index ff3232d2f..a1ffd80c1 100644 --- a/Greenshot/Drawing/Fields/Binding/AbstractBindingConverter.cs +++ b/Greenshot/Drawing/Fields/Binding/AbstractBindingConverter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/Binding/BidirectionalBinding.cs b/Greenshot/Drawing/Fields/Binding/BidirectionalBinding.cs index 28a4bddf0..5a9652d5c 100644 --- a/Greenshot/Drawing/Fields/Binding/BidirectionalBinding.cs +++ b/Greenshot/Drawing/Fields/Binding/BidirectionalBinding.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs b/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs index b1efb78f3..0ac7d02bb 100644 --- a/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs +++ b/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/Binding/DecimalFloatConverter.cs b/Greenshot/Drawing/Fields/Binding/DecimalFloatConverter.cs index 70581bc10..528af1c2e 100644 --- a/Greenshot/Drawing/Fields/Binding/DecimalFloatConverter.cs +++ b/Greenshot/Drawing/Fields/Binding/DecimalFloatConverter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/Binding/DecimalIntConverter.cs b/Greenshot/Drawing/Fields/Binding/DecimalIntConverter.cs index 693e532dd..6a8ff7e84 100644 --- a/Greenshot/Drawing/Fields/Binding/DecimalIntConverter.cs +++ b/Greenshot/Drawing/Fields/Binding/DecimalIntConverter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/Binding/IBindingConverter.cs b/Greenshot/Drawing/Fields/Binding/IBindingConverter.cs index 1a8fcefc3..cdb573470 100644 --- a/Greenshot/Drawing/Fields/Binding/IBindingConverter.cs +++ b/Greenshot/Drawing/Fields/Binding/IBindingConverter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/Binding/IBindingValidator.cs b/Greenshot/Drawing/Fields/Binding/IBindingValidator.cs index 146b91afb..d21b575a4 100644 --- a/Greenshot/Drawing/Fields/Binding/IBindingValidator.cs +++ b/Greenshot/Drawing/Fields/Binding/IBindingValidator.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/Binding/NotNullValidator.cs b/Greenshot/Drawing/Fields/Binding/NotNullValidator.cs index 692254c37..5d15b6699 100644 --- a/Greenshot/Drawing/Fields/Binding/NotNullValidator.cs +++ b/Greenshot/Drawing/Fields/Binding/NotNullValidator.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/Field.cs b/Greenshot/Drawing/Fields/Field.cs index 798444625..f08033fd0 100644 --- a/Greenshot/Drawing/Fields/Field.cs +++ b/Greenshot/Drawing/Fields/Field.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/FieldAggregator.cs b/Greenshot/Drawing/Fields/FieldAggregator.cs index c22268091..6606a96b1 100644 --- a/Greenshot/Drawing/Fields/FieldAggregator.cs +++ b/Greenshot/Drawing/Fields/FieldAggregator.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Fields/FieldType.cs b/Greenshot/Drawing/Fields/FieldType.cs index 9976d24af..7531e5b27 100644 --- a/Greenshot/Drawing/Fields/FieldType.cs +++ b/Greenshot/Drawing/Fields/FieldType.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/FilterContainer.cs b/Greenshot/Drawing/FilterContainer.cs index 489e8e357..9ea6bc1a1 100644 --- a/Greenshot/Drawing/FilterContainer.cs +++ b/Greenshot/Drawing/FilterContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Filters/AbstractFilter.cs b/Greenshot/Drawing/Filters/AbstractFilter.cs index 7c54545bd..419038d40 100644 --- a/Greenshot/Drawing/Filters/AbstractFilter.cs +++ b/Greenshot/Drawing/Filters/AbstractFilter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Filters/BlurFilter.cs b/Greenshot/Drawing/Filters/BlurFilter.cs index 711c1d02b..79f617ac6 100644 --- a/Greenshot/Drawing/Filters/BlurFilter.cs +++ b/Greenshot/Drawing/Filters/BlurFilter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Filters/BrightnessFilter.cs b/Greenshot/Drawing/Filters/BrightnessFilter.cs index 852aca9de..a43a68f67 100644 --- a/Greenshot/Drawing/Filters/BrightnessFilter.cs +++ b/Greenshot/Drawing/Filters/BrightnessFilter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Filters/GrayscaleFilter.cs b/Greenshot/Drawing/Filters/GrayscaleFilter.cs index 4758d12bd..f66b29fba 100644 --- a/Greenshot/Drawing/Filters/GrayscaleFilter.cs +++ b/Greenshot/Drawing/Filters/GrayscaleFilter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Filters/HighlightFilter.cs b/Greenshot/Drawing/Filters/HighlightFilter.cs index 36c574493..38b6a8ee7 100644 --- a/Greenshot/Drawing/Filters/HighlightFilter.cs +++ b/Greenshot/Drawing/Filters/HighlightFilter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Filters/IFilter.cs b/Greenshot/Drawing/Filters/IFilter.cs index 91fdfe74d..8c3b5b23e 100644 --- a/Greenshot/Drawing/Filters/IFilter.cs +++ b/Greenshot/Drawing/Filters/IFilter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Filters/MagnifierFilter.cs b/Greenshot/Drawing/Filters/MagnifierFilter.cs index 601d09967..68b033ef5 100644 --- a/Greenshot/Drawing/Filters/MagnifierFilter.cs +++ b/Greenshot/Drawing/Filters/MagnifierFilter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Filters/PixelizationFilter.cs b/Greenshot/Drawing/Filters/PixelizationFilter.cs index 7be7d47a6..dbf19d3f7 100644 --- a/Greenshot/Drawing/Filters/PixelizationFilter.cs +++ b/Greenshot/Drawing/Filters/PixelizationFilter.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/FreehandContainer.cs b/Greenshot/Drawing/FreehandContainer.cs index c7d5cf1e8..0485f2ae5 100644 --- a/Greenshot/Drawing/FreehandContainer.cs +++ b/Greenshot/Drawing/FreehandContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/HighlightContainer.cs b/Greenshot/Drawing/HighlightContainer.cs index 858e1508b..788360004 100644 --- a/Greenshot/Drawing/HighlightContainer.cs +++ b/Greenshot/Drawing/HighlightContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/IconContainer.cs b/Greenshot/Drawing/IconContainer.cs index 2924a376f..6d5c90986 100644 --- a/Greenshot/Drawing/IconContainer.cs +++ b/Greenshot/Drawing/IconContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/ImageContainer.cs b/Greenshot/Drawing/ImageContainer.cs index 2d96d12c8..5840c9507 100644 --- a/Greenshot/Drawing/ImageContainer.cs +++ b/Greenshot/Drawing/ImageContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/LineContainer.cs b/Greenshot/Drawing/LineContainer.cs index af73529d4..eac855644 100644 --- a/Greenshot/Drawing/LineContainer.cs +++ b/Greenshot/Drawing/LineContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/ObfuscateContainer.cs b/Greenshot/Drawing/ObfuscateContainer.cs index 07ea899ba..f1fdbf156 100644 --- a/Greenshot/Drawing/ObfuscateContainer.cs +++ b/Greenshot/Drawing/ObfuscateContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/Positions.cs b/Greenshot/Drawing/Positions.cs index 847d08415..f7061d023 100644 --- a/Greenshot/Drawing/Positions.cs +++ b/Greenshot/Drawing/Positions.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ diff --git a/Greenshot/Drawing/RectangleContainer.cs b/Greenshot/Drawing/RectangleContainer.cs index 623e28b22..2e86fa509 100644 --- a/Greenshot/Drawing/RectangleContainer.cs +++ b/Greenshot/Drawing/RectangleContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/RoundedRectangle.cs b/Greenshot/Drawing/RoundedRectangle.cs index 8a519d1ed..a5d4ea6a0 100644 --- a/Greenshot/Drawing/RoundedRectangle.cs +++ b/Greenshot/Drawing/RoundedRectangle.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/SpeechbubbleContainer.cs b/Greenshot/Drawing/SpeechbubbleContainer.cs index f585af7aa..ee00714e9 100644 --- a/Greenshot/Drawing/SpeechbubbleContainer.cs +++ b/Greenshot/Drawing/SpeechbubbleContainer.cs @@ -329,5 +329,17 @@ namespace Greenshot.Drawing public override bool ClickableAt(int x, int y) { return Contains(x,y); } + + /// + /// Additional to the Transform of the TextContainer the bubble tail coordinates also need to be moved + /// + /// Matrix + public override void Transform(Matrix matrix) + { + Point[] points = { TargetAdorner.Location }; + matrix.TransformPoints(points); + TargetAdorner.Location = points[0]; + base.Transform(matrix); + } } } diff --git a/Greenshot/Drawing/Surface.cs b/Greenshot/Drawing/Surface.cs index d7a4487fc..ed3118db6 100644 --- a/Greenshot/Drawing/Surface.cs +++ b/Greenshot/Drawing/Surface.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Drawing/TextContainer.cs b/Greenshot/Drawing/TextContainer.cs index ddfb2918e..fda883f16 100644 --- a/Greenshot/Drawing/TextContainer.cs +++ b/Greenshot/Drawing/TextContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -67,25 +67,21 @@ namespace Greenshot.Drawing // there is a binding on the following property! public string Text { - get { return text; } - set - { - ChangeText(value, true); - } + get => text; + set => ChangeText(value, true); } internal void ChangeText(string newText, bool allowUndoable) { - if ((text == null && newText != null) || !string.Equals(text, newText)) + if ((text != null || newText == null) && string.Equals(text, newText)) return; + + if (makeUndoable && allowUndoable) { - if (makeUndoable && allowUndoable) - { - makeUndoable = false; - _parent.MakeUndoable(new TextChangeMemento(this), false); - } - text = newText; - OnPropertyChanged("Text"); + makeUndoable = false; + _parent.MakeUndoable(new TextChangeMemento(this), false); } + text = newText; + OnPropertyChanged("Text"); } public TextContainer(Surface parent) : base(parent) @@ -602,6 +598,41 @@ namespace Greenshot.Drawing DrawText(graphics, rect, lineThickness, lineColor, drawShadow, _stringFormat, text, _font); } + private static TextFormatFlags ConvertStringFormat(StringFormat stringFormat) + { + TextFormatFlags flags = TextFormatFlags.Default; + if (stringFormat == null) + { + return flags; + } + switch (stringFormat.LineAlignment) + { + case StringAlignment.Center: + flags |= TextFormatFlags.VerticalCenter; + break; + case StringAlignment.Far: + flags |= TextFormatFlags.Bottom; + break; + case StringAlignment.Near: + flags |= TextFormatFlags.Top; + break; + } + switch (stringFormat.Alignment) + { + case StringAlignment.Center: + flags |= TextFormatFlags.HorizontalCenter; + break; + case StringAlignment.Far: + flags |= TextFormatFlags.Right; + break; + case StringAlignment.Near: + flags |= TextFormatFlags.Left; + break; + } + + return flags; + } + /// /// This method can be used from other containers /// @@ -640,8 +671,8 @@ namespace Greenshot.Drawing shadowRect.Inflate(-textOffset, -textOffset); } - using Brush fontBrush = new SolidBrush(Color.FromArgb(alpha, 100, 100, 100)); - graphics.DrawString(text, font, fontBrush, shadowRect, stringFormat); + TextRenderer.DrawText(graphics, text, font, shadowRect, Color.FromArgb(alpha, 100, 100, 100), ConvertStringFormat(stringFormat)); + currentStep++; alpha -= basealpha / steps; } @@ -651,16 +682,14 @@ namespace Greenshot.Drawing { drawingRectange.Inflate(-textOffset, -textOffset); } - using (Brush fontBrush = new SolidBrush(fontColor)) + + if (stringFormat != null) { - if (stringFormat != null) - { - graphics.DrawString(text, font, fontBrush, drawingRectange, stringFormat); - } - else - { - graphics.DrawString(text, font, fontBrush, drawingRectange); - } + TextRenderer.DrawText(graphics, text, font, drawingRectange, fontColor, ConvertStringFormat(stringFormat)); + } + else + { + TextRenderer.DrawText(graphics, text, font, drawingRectange, fontColor); } } diff --git a/Greenshot/Forms/AboutForm.Designer.cs b/Greenshot/Forms/AboutForm.Designer.cs index a2ff0904b..830237010 100644 --- a/Greenshot/Forms/AboutForm.Designer.cs +++ b/Greenshot/Forms/AboutForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/AboutForm.cs b/Greenshot/Forms/AboutForm.cs index 0be368cbe..f3c67edd8 100644 --- a/Greenshot/Forms/AboutForm.cs +++ b/Greenshot/Forms/AboutForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool -* Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom +* Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/AnimatingBaseForm.cs b/Greenshot/Forms/AnimatingBaseForm.cs index db1c2b54d..5456ba037 100644 --- a/Greenshot/Forms/AnimatingBaseForm.cs +++ b/Greenshot/Forms/AnimatingBaseForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -21,7 +21,7 @@ using GreenshotPlugin.Controls; -namespace Greenshot { +namespace Greenshot.Forms { /// /// This class is only here to help in the Designer mode, so it's clear where the language files are /// diff --git a/Greenshot/Forms/BaseForm.cs b/Greenshot/Forms/BaseForm.cs index 392f37803..ffc0e86db 100644 --- a/Greenshot/Forms/BaseForm.cs +++ b/Greenshot/Forms/BaseForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -21,7 +21,7 @@ using GreenshotPlugin.Controls; -namespace Greenshot { +namespace Greenshot.Forms { /// /// This class is only here to help in the Designer mode, so it's clear where the language files are /// diff --git a/Greenshot/Forms/BugReportForm.Designer.cs b/Greenshot/Forms/BugReportForm.Designer.cs index 3b4c6afdb..2c5a7ae52 100644 --- a/Greenshot/Forms/BugReportForm.Designer.cs +++ b/Greenshot/Forms/BugReportForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/BugReportForm.cs b/Greenshot/Forms/BugReportForm.cs index f74aa431d..7c26e1b54 100644 --- a/Greenshot/Forms/BugReportForm.cs +++ b/Greenshot/Forms/BugReportForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/CaptureForm.Designer.cs b/Greenshot/Forms/CaptureForm.Designer.cs index ee3b43b99..9f36ebdb9 100644 --- a/Greenshot/Forms/CaptureForm.Designer.cs +++ b/Greenshot/Forms/CaptureForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/CaptureForm.cs b/Greenshot/Forms/CaptureForm.cs index bad4a0d24..bf21382e8 100644 --- a/Greenshot/Forms/CaptureForm.cs +++ b/Greenshot/Forms/CaptureForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/ColorDialog.Designer.cs b/Greenshot/Forms/ColorDialog.Designer.cs index 32330fb3a..d5060d8c0 100644 --- a/Greenshot/Forms/ColorDialog.Designer.cs +++ b/Greenshot/Forms/ColorDialog.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace Greenshot { +namespace Greenshot.Forms { public partial class ColorDialog { /// /// Designer variable used to keep track of non-visual components. diff --git a/Greenshot/Forms/ColorDialog.cs b/Greenshot/Forms/ColorDialog.cs index bcf7e8889..f69c8f2fc 100644 --- a/Greenshot/Forms/ColorDialog.cs +++ b/Greenshot/Forms/ColorDialog.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -19,17 +19,17 @@ * along with this program. If not, see . */ -using Greenshot.Configuration; -using Greenshot.Controls; using System; using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.Threading; using System.Windows.Forms; +using Greenshot.Configuration; +using Greenshot.Controls; using GreenshotPlugin.IniFile; -namespace Greenshot { +namespace Greenshot.Forms { /// /// Description of ColorDialog. /// diff --git a/Greenshot/Forms/ColorPickerToolStripButton.cs b/Greenshot/Forms/ColorPickerToolStripButton.cs index 53816dca5..8f7730845 100644 --- a/Greenshot/Forms/ColorPickerToolStripButton.cs +++ b/Greenshot/Forms/ColorPickerToolStripButton.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -20,12 +20,12 @@ */ using System; +using System.Diagnostics; using System.Drawing; using System.Drawing.Imaging; using System.Windows.Forms; -using System.Diagnostics; -namespace Greenshot +namespace Greenshot.Forms { public delegate void ColorPickerEventHandler(object o, ColorPickerEventArgs e); @@ -34,12 +34,12 @@ namespace Greenshot private Color _color; public Point Offset = new Point(0,0); public event ColorPickerEventHandler ColorPicked; - private readonly Greenshot.ColorDialog _cd; + private readonly ColorDialog _cd; public ColorPickerToolStripButton() { - _cd = Greenshot.ColorDialog.GetInstance(); + _cd = ColorDialog.GetInstance(); Click += ToolStripButton1Click; } diff --git a/Greenshot/Forms/DropShadowSettingsForm.Designer.cs b/Greenshot/Forms/DropShadowSettingsForm.Designer.cs index ba8e7b3bc..0f7a89618 100644 --- a/Greenshot/Forms/DropShadowSettingsForm.Designer.cs +++ b/Greenshot/Forms/DropShadowSettingsForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/DropShadowSettingsForm.cs b/Greenshot/Forms/DropShadowSettingsForm.cs index 2511a3328..4f7c413c7 100644 --- a/Greenshot/Forms/DropShadowSettingsForm.cs +++ b/Greenshot/Forms/DropShadowSettingsForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/ImageEditorForm.Designer.cs b/Greenshot/Forms/ImageEditorForm.Designer.cs index cce905007..0db33a212 100644 --- a/Greenshot/Forms/ImageEditorForm.Designer.cs +++ b/Greenshot/Forms/ImageEditorForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -21,7 +21,7 @@ using Greenshot.Controls; -namespace Greenshot { +namespace Greenshot.Forms { partial class ImageEditorForm { /// /// Designer variable used to keep track of non-visual components. @@ -56,7 +56,7 @@ namespace Greenshot { this.dimensionsLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.panel1 = new GreenshotPlugin.Controls.NonJumpingPanel(); + this.panel1 = new NonJumpingPanel(); this.toolsToolStrip = new Greenshot.Controls.ToolStripEx(); this.btnCursor = new GreenshotPlugin.Controls.GreenshotToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -1977,7 +1977,7 @@ namespace Greenshot { private GreenshotPlugin.Controls.GreenshotToolStripButton btnRect; private System.Windows.Forms.ToolStripContainer topToolStripContainer; private Greenshot.Controls.ToolStripEx destinationsToolStrip; - private GreenshotPlugin.Controls.NonJumpingPanel panel1; + private NonJumpingPanel panel1; private Greenshot.Controls.ToolStripColorButton btnFillColor; private Greenshot.Controls.ToolStripColorButton btnLineColor; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem autoCropToolStripMenuItem; diff --git a/Greenshot/Forms/ImageEditorForm.cs b/Greenshot/Forms/ImageEditorForm.cs index 6e19df179..a9fe79239 100644 --- a/Greenshot/Forms/ImageEditorForm.cs +++ b/Greenshot/Forms/ImageEditorForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -31,7 +31,6 @@ using Greenshot.Destinations; using Greenshot.Drawing; using Greenshot.Drawing.Fields; using Greenshot.Drawing.Fields.Binding; -using Greenshot.Forms; using Greenshot.Help; using Greenshot.Helpers; using GreenshotPlugin.Controls; @@ -45,7 +44,7 @@ using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.UnmanagedHelpers.Structs; using log4net; -namespace Greenshot { +namespace Greenshot.Forms { /// /// Description of ImageEditorForm. /// @@ -66,6 +65,9 @@ namespace Greenshot { // whether part of the editor controls are disabled depending on selected item(s) private bool _controlsDisabledDueToConfirmable; + // Used for tracking the mouse scrollwheel changes + private DateTime _zoomStartTime = DateTime.Now; + /// /// All provided zoom values (in percents) in ascending order. /// @@ -904,11 +906,33 @@ namespace Greenshot { /// /// /// - private void PanelMouseWheel(object sender, MouseEventArgs e) { + /// + /// This is a "work-around" for the MouseWheel event which doesn't get to the panel + /// + /// + /// + private void PanelMouseWheel(object sender, MouseEventArgs e) + { + if (System.Windows.Forms.Control.ModifierKeys.Equals(Keys.Control)) + { + if (_zoomStartTime.AddMilliseconds(100) < DateTime.Now) //waiting for next zoom step 100 ms + { + _zoomStartTime = DateTime.Now; + if (e.Delta > 0) + { + ZoomInMenuItemClick(sender, e); + } + else if (e.Delta < 0) + { + ZoomOutMenuItemClick(sender, e); + } + } + + } panel1.Focus(); } - protected override bool ProcessKeyPreview(ref Message msg) { + protected override bool ProcessKeyPreview(ref Message msg) { // disable default key handling if surface has requested a lock if (!_surface.KeysLocked) { return base.ProcessKeyPreview(ref msg); diff --git a/Greenshot/Forms/LanguageDialog.Designer.cs b/Greenshot/Forms/LanguageDialog.Designer.cs index 6ae29249b..6ad4c0e60 100644 --- a/Greenshot/Forms/LanguageDialog.Designer.cs +++ b/Greenshot/Forms/LanguageDialog.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/LanguageDialog.cs b/Greenshot/Forms/LanguageDialog.cs index 7d6ba2f33..d78c36008 100644 --- a/Greenshot/Forms/LanguageDialog.cs +++ b/Greenshot/Forms/LanguageDialog.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/MainForm.Designer.cs b/Greenshot/Forms/MainForm.Designer.cs index 751d43452..281886180 100644 --- a/Greenshot/Forms/MainForm.Designer.cs +++ b/Greenshot/Forms/MainForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace Greenshot { +namespace Greenshot.Forms { partial class MainForm { /// /// Designer variable used to keep track of non-visual components. diff --git a/Greenshot/Forms/MainForm.cs b/Greenshot/Forms/MainForm.cs index 61f5141bd..4053b41f5 100644 --- a/Greenshot/Forms/MainForm.cs +++ b/Greenshot/Forms/MainForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -29,25 +29,24 @@ using System.Linq; using System.Reflection; using System.Text; using System.Threading; +using System.Threading.Tasks; using System.Windows.Forms; using System.Windows.Forms.Integration; using Greenshot.Configuration; -using Greenshot.Forms; -using Greenshot.Help; -using Greenshot.Helpers; -using GreenshotPlugin.UnmanagedHelpers; -using GreenshotPlugin.Controls; -using GreenshotPlugin.Core; using Greenshot.Destinations; using Greenshot.Drawing; -using log4net; -using Timer = System.Timers.Timer; -using System.Threading.Tasks; +using Greenshot.Help; +using Greenshot.Helpers; +using GreenshotPlugin.Controls; +using GreenshotPlugin.Core; using GreenshotPlugin.IniFile; using GreenshotPlugin.Interfaces; using GreenshotPlugin.Interfaces.Plugin; +using GreenshotPlugin.UnmanagedHelpers; +using log4net; +using Timer = System.Timers.Timer; -namespace Greenshot { +namespace Greenshot.Forms { /// /// Description of MainForm. /// @@ -533,21 +532,26 @@ namespace Greenshot { private static bool RegisterWrapper(StringBuilder failedKeys, string functionName, string configurationKey, HotKeyHandler handler, bool ignoreFailedRegistration) { IniValue hotkeyValue = _conf.Values[configurationKey]; + var hotkeyStringValue = hotkeyValue.Value?.ToString(); + if (string.IsNullOrEmpty(hotkeyStringValue)) + { + return true; + } try { - bool success = RegisterHotkey(failedKeys, functionName, hotkeyValue.Value.ToString(), handler); + bool success = RegisterHotkey(failedKeys, functionName, hotkeyStringValue, handler); if (!success && ignoreFailedRegistration) { - LOG.DebugFormat("Ignoring failed hotkey registration for {0}, with value '{1}', resetting to 'None'.", functionName, hotkeyValue); + LOG.DebugFormat("Ignoring failed hotkey registration for {0}, with value '{1}', resetting to 'None'.", functionName, hotkeyStringValue); _conf.Values[configurationKey].Value = Keys.None.ToString(); _conf.IsDirty = true; } return success; } catch (Exception ex) { LOG.Warn(ex); - LOG.WarnFormat("Restoring default hotkey for {0}, stored under {1} from '{2}' to '{3}'", functionName, configurationKey, hotkeyValue.Value, hotkeyValue.Attributes.DefaultValue); + LOG.WarnFormat("Restoring default hotkey for {0}, stored under {1} from '{2}' to '{3}'", functionName, configurationKey, hotkeyStringValue, hotkeyValue.Attributes.DefaultValue); // when getting an exception the key wasn't found: reset the hotkey value hotkeyValue.UseValueOrDefault(null); hotkeyValue.ContainingIniSection.IsDirty = true; - return RegisterHotkey(failedKeys, functionName, hotkeyValue.Value.ToString(), handler); + return RegisterHotkey(failedKeys, functionName, hotkeyStringValue, handler); } } @@ -609,6 +613,10 @@ namespace Greenshot { if (!RegisterWrapper(failedKeys, "CaptureLastRegion", "LastregionHotkey", _instance.CaptureLastRegion, ignoreFailedRegistration)) { success = false; } + if (!RegisterWrapper(failedKeys, "CaptureClipboard", "ClipboardHotkey", _instance.CaptureClipboard, true)) + { + success = false; + } if (_conf.IECapture) { if (!RegisterWrapper(failedKeys, "CaptureIE", "IEHotkey", _instance.CaptureIE, ignoreFailedRegistration)) { success = false; @@ -689,7 +697,12 @@ namespace Greenshot { contextmenu_capturewindow.ShortcutKeyDisplayString = HotkeyControl.GetLocalizedHotkeyStringFromString(_conf.WindowHotkey); contextmenu_capturefullscreen.ShortcutKeyDisplayString = HotkeyControl.GetLocalizedHotkeyStringFromString(_conf.FullscreenHotkey); contextmenu_captureie.ShortcutKeyDisplayString = HotkeyControl.GetLocalizedHotkeyStringFromString(_conf.IEHotkey); - } + var clipboardHotkey = HotkeyControl.GetLocalizedHotkeyStringFromString(_conf.ClipboardHotkey); + if (!string.IsNullOrEmpty(clipboardHotkey) && !"None".Equals(clipboardHotkey)) + { + contextmenu_captureclipboard.ShortcutKeyDisplayString = clipboardHotkey; + } + } private void MainFormFormClosing(object sender, FormClosingEventArgs e) { @@ -729,6 +742,14 @@ namespace Greenshot { CaptureHelper.CaptureLastRegion(true); } + /// + /// This is used by the hotkey trigger + /// + private void CaptureClipboard() + { + CaptureHelper.CaptureClipboard(DestinationHelper.GetDestination(EditorDestination.DESIGNATION)); + } + private void CaptureIE() { if (_conf.IECapture) { CaptureHelper.CaptureIe(true, null); @@ -1394,7 +1415,7 @@ namespace Greenshot { catch (Exception ex) { // Make sure we show what we tried to open in the exception - ex.Data.Add("path", path); + ex.Data["path"] = path; LOG.Warn("Couldn't open the path to the last exported file", ex); // No reason to create a bug-form, we just display the error. MessageBox.Show(this, ex.Message, "Opening " + path, MessageBoxButtons.OK, MessageBoxIcon.Error); diff --git a/Greenshot/Forms/MovableShowColorForm.cs b/Greenshot/Forms/MovableShowColorForm.cs index 22c40183f..fb8e7df5f 100644 --- a/Greenshot/Forms/MovableShowColorForm.cs +++ b/Greenshot/Forms/MovableShowColorForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/PrintOptionsDialog.Designer.cs b/Greenshot/Forms/PrintOptionsDialog.Designer.cs index 43d40c06e..0de6ca3a9 100644 --- a/Greenshot/Forms/PrintOptionsDialog.Designer.cs +++ b/Greenshot/Forms/PrintOptionsDialog.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/PrintOptionsDialog.cs b/Greenshot/Forms/PrintOptionsDialog.cs index b4a2de28e..7e1ae603c 100644 --- a/Greenshot/Forms/PrintOptionsDialog.cs +++ b/Greenshot/Forms/PrintOptionsDialog.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/ResizeSettingsForm.Designer.cs b/Greenshot/Forms/ResizeSettingsForm.Designer.cs index f6a7fad48..e7675bb57 100644 --- a/Greenshot/Forms/ResizeSettingsForm.Designer.cs +++ b/Greenshot/Forms/ResizeSettingsForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/ResizeSettingsForm.cs b/Greenshot/Forms/ResizeSettingsForm.cs index 0d0aad23f..52bfb8d21 100644 --- a/Greenshot/Forms/ResizeSettingsForm.cs +++ b/Greenshot/Forms/ResizeSettingsForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/SettingsForm.Designer.cs b/Greenshot/Forms/SettingsForm.Designer.cs index 80cbd9437..f0cb33f46 100644 --- a/Greenshot/Forms/SettingsForm.Designer.cs +++ b/Greenshot/Forms/SettingsForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace Greenshot { +namespace Greenshot.Forms { partial class SettingsForm { /// /// Designer variable used to keep track of non-visual components. diff --git a/Greenshot/Forms/SettingsForm.cs b/Greenshot/Forms/SettingsForm.cs index 90fc1df51..7bd37e0ec 100644 --- a/Greenshot/Forms/SettingsForm.cs +++ b/Greenshot/Forms/SettingsForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -26,22 +26,20 @@ using System.Drawing; using System.Globalization; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using System.Windows.Forms; - using Greenshot.Configuration; using Greenshot.Destinations; using Greenshot.Helpers; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; -using System.Text.RegularExpressions; using GreenshotPlugin.IniFile; using GreenshotPlugin.Interfaces; using GreenshotPlugin.Interfaces.Plugin; using GreenshotPlugin.UnmanagedHelpers; -using GreenshotPlugin.UnmanagedHelpers.Enums; using log4net; -namespace Greenshot { +namespace Greenshot.Forms { /// /// Description of SettingsForm. /// @@ -453,9 +451,9 @@ namespace Greenshot { } // retrieve the set clipboard formats - List clipboardFormats = new List(); + var clipboardFormats = new List(); foreach (int index in listview_clipboardformats.CheckedIndices) { - ListViewItem item = listview_clipboardformats.Items[index]; + var item = listview_clipboardformats.Items[index]; if (item.Checked) { clipboardFormats.Add((ClipboardFormat)item.Tag); } diff --git a/Greenshot/Forms/ToolStripMenuSelectList.cs b/Greenshot/Forms/ToolStripMenuSelectList.cs index a109798f5..4ddfe7cdd 100644 --- a/Greenshot/Forms/ToolStripMenuSelectList.cs +++ b/Greenshot/Forms/ToolStripMenuSelectList.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/TornEdgeSettingsForm.Designer.cs b/Greenshot/Forms/TornEdgeSettingsForm.Designer.cs index 5320e17de..f2692729f 100644 --- a/Greenshot/Forms/TornEdgeSettingsForm.Designer.cs +++ b/Greenshot/Forms/TornEdgeSettingsForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Forms/TornEdgeSettingsForm.cs b/Greenshot/Forms/TornEdgeSettingsForm.cs index 632d554ae..520f795b9 100644 --- a/Greenshot/Forms/TornEdgeSettingsForm.cs +++ b/Greenshot/Forms/TornEdgeSettingsForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/GreenshotMain.cs b/Greenshot/GreenshotMain.cs index 6a993d99b..045478d6d 100644 --- a/Greenshot/GreenshotMain.cs +++ b/Greenshot/GreenshotMain.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -22,6 +22,7 @@ using System; using System.Globalization; using System.Net; using System.Reflection; +using Greenshot.Forms; // Remove AppendPrivatePath warning: #pragma warning disable 0618 @@ -38,11 +39,11 @@ namespace Greenshot { Assembly ayResult = null; string sShortAssemblyName = args.Name.Split(',')[0]; Assembly[] ayAssemblies = AppDomain.CurrentDomain.GetAssemblies(); - foreach (Assembly ayAssembly in ayAssemblies) { - if (sShortAssemblyName == ayAssembly.FullName.Split(',')[0]) { - ayResult = ayAssembly; - break; - } + foreach (Assembly ayAssembly in ayAssemblies) + { + if (sShortAssemblyName != ayAssembly.FullName.Split(',')[0]) continue; + ayResult = ayAssembly; + break; } return ayResult; } diff --git a/Greenshot/Help/HelpFileLoader.cs b/Greenshot/Help/HelpFileLoader.cs index 10c4c69bb..4dec29979 100644 --- a/Greenshot/Help/HelpFileLoader.cs +++ b/Greenshot/Help/HelpFileLoader.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/CaptureHelper.cs b/Greenshot/Helpers/CaptureHelper.cs index 42f28e4ad..19acda012 100644 --- a/Greenshot/Helpers/CaptureHelper.cs +++ b/Greenshot/Helpers/CaptureHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -85,11 +85,23 @@ namespace Greenshot.Helpers { PsAPI.EmptyWorkingSet(); } } + public static void CaptureClipboard() + { + using CaptureHelper captureHelper = new CaptureHelper(CaptureMode.Clipboard); + captureHelper.MakeCapture(); + } + + public static void CaptureClipboard(IDestination destination) { using CaptureHelper captureHelper = new CaptureHelper(CaptureMode.Clipboard); + if (destination != null) + { + captureHelper.AddDestination(destination); + } captureHelper.MakeCapture(); } + public static void CaptureRegion(bool captureMouse) { using CaptureHelper captureHelper = new CaptureHelper(CaptureMode.Region, captureMouse); @@ -194,12 +206,8 @@ namespace Greenshot.Helpers { } public WindowDetails SelectedCaptureWindow { - get { - return _selectedCaptureWindow; - } - set { - _selectedCaptureWindow = value; - } + get => _selectedCaptureWindow; + set => _selectedCaptureWindow = value; } private void DoCaptureFeedback() { @@ -244,7 +252,7 @@ namespace Greenshot.Helpers { Log.Debug($"Capturing with mode {_captureMode} and using Cursor {_captureMouseCursor}"); _capture.CaptureDetails.CaptureMode = _captureMode; - // Get the windows details in a seperate thread, only for those captures that have a Feedback + // Get the windows details in a separate thread, only for those captures that have a Feedback // As currently the "elements" aren't used, we don't need them yet switch (_captureMode) { case CaptureMode.Region: @@ -270,7 +278,7 @@ namespace Greenshot.Helpers { CoreConfig.CaptureDelay = 0; } - // Capture Mousecursor if we are not loading from file or clipboard, only show when needed + // Capture Mouse cursor if we are not loading from file or clipboard, only show when needed if (_captureMode != CaptureMode.File && _captureMode != CaptureMode.Clipboard) { _capture = WindowCapture.CaptureCursor(_capture); diff --git a/Greenshot/Helpers/Colors.cs b/Greenshot/Helpers/Colors.cs index 0b30c7373..4588f4274 100644 --- a/Greenshot/Helpers/Colors.cs +++ b/Greenshot/Helpers/Colors.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/CopyData.cs b/Greenshot/Helpers/CopyData.cs index 2168c0736..3bbebc8b4 100644 --- a/Greenshot/Helpers/CopyData.cs +++ b/Greenshot/Helpers/CopyData.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -158,11 +158,12 @@ namespace Greenshot.Helpers { /// /// Clears up any resources associated with this object. /// - protected virtual void Dispose(bool disposing) { - if (disposing && _channels != null) { - _channels.Clear(); - _channels = null; - } + protected virtual void Dispose(bool disposing) + { + if (!disposing || _channels == null) return; + + _channels.Clear(); + _channels = null; } /// @@ -249,10 +250,10 @@ namespace Greenshot.Helpers { int i = 0; foreach (CopyDataChannel cdc in Dictionary.Values) { i++; - if (i == index) { - ret = cdc; - break; - } + if (i != index) continue; + + ret = cdc; + break; } return ret; } @@ -337,14 +338,14 @@ namespace Greenshot.Helpers { /// public class CopyDataChannel : IDisposable { [DllImport("user32", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern IntPtr GetProp(IntPtr hwnd, string lpString); + private static extern IntPtr GetProp(IntPtr hWnd, string lpString); [DllImport("user32", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool SetProp(IntPtr hwnd, string lpString, IntPtr hData); + private static extern bool SetProp(IntPtr hWnd, string lpString, IntPtr hData); [DllImport("user32", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern IntPtr RemoveProp(IntPtr hwnd, string lpString); + private static extern IntPtr RemoveProp(IntPtr hWnd, string lpString); [DllImport("user32", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern IntPtr SendMessage(IntPtr hwnd, int wMsg, IntPtr wParam, ref COPYDATASTRUCT lParam); + private static extern IntPtr SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, ref COPYDATASTRUCT lParam); [StructLayout(LayoutKind.Sequential)] private struct COPYDATASTRUCT { @@ -460,13 +461,14 @@ namespace Greenshot.Helpers { /// /// Clears up any resources associated with this channel. /// - protected virtual void Dispose(bool disposing) { - if (disposing) { - if (ChannelName.Length > 0) { - RemoveChannel(); - } - ChannelName = string.Empty; + protected virtual void Dispose(bool disposing) + { + if (!disposing) return; + + if (ChannelName.Length > 0) { + RemoveChannel(); } + ChannelName = string.Empty; } /// diff --git a/Greenshot/Helpers/DestinationHelper.cs b/Greenshot/Helpers/DestinationHelper.cs index 49cec43da..1169edb40 100644 --- a/Greenshot/Helpers/DestinationHelper.cs +++ b/Greenshot/Helpers/DestinationHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/Entities/UpdateFeed.cs b/Greenshot/Helpers/Entities/UpdateFeed.cs index a7a80afb8..280518fc8 100644 --- a/Greenshot/Helpers/Entities/UpdateFeed.cs +++ b/Greenshot/Helpers/Entities/UpdateFeed.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/GeometryHelper.cs b/Greenshot/Helpers/GeometryHelper.cs index d8f2dd3fd..e20cf5035 100644 --- a/Greenshot/Helpers/GeometryHelper.cs +++ b/Greenshot/Helpers/GeometryHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/GuiRectangle.cs b/Greenshot/Helpers/GuiRectangle.cs index 770874e78..c24e591ec 100644 --- a/Greenshot/Helpers/GuiRectangle.cs +++ b/Greenshot/Helpers/GuiRectangle.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/IECaptureHelper.cs b/Greenshot/Helpers/IECaptureHelper.cs index cfe36a96b..f74403176 100644 --- a/Greenshot/Helpers/IECaptureHelper.cs +++ b/Greenshot/Helpers/IECaptureHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -50,14 +50,14 @@ namespace Greenshot.Helpers { // Helper method to activate a certain IE Tab public static void ActivateIeTab(WindowDetails ieWindowDetails, int tabIndex) { WindowDetails directUiWindowDetails = IEHelper.GetDirectUI(ieWindowDetails); - if(directUiWindowDetails != null) { - // Bring window to the front - ieWindowDetails.Restore(); - // Get accessible - Accessible ieAccessible = new Accessible(directUiWindowDetails.Handle); - // Activate Tab - ieAccessible.ActivateIETab(tabIndex); - } + if (directUiWindowDetails == null) return; + + // Bring window to the front + ieWindowDetails.Restore(); + // Get accessible + Accessible ieAccessible = new Accessible(directUiWindowDetails.Handle); + // Activate Tab + ieAccessible.ActivateIETab(tabIndex); } /// @@ -68,14 +68,14 @@ namespace Greenshot.Helpers { /// public static bool IsMostlyIeWindow(WindowDetails someWindow, int minimumPercentage) { WindowDetails ieWindow = someWindow.GetChild("Internet Explorer_Server"); - if (ieWindow != null) { - Rectangle wholeClient = someWindow.ClientRectangle; - Rectangle partClient = ieWindow.ClientRectangle; - int percentage = (int)(100*(float)(partClient.Width * partClient.Height) / (wholeClient.Width * wholeClient.Height)); - Log.InfoFormat("Window {0}, ie part {1}, percentage {2}", wholeClient, partClient, percentage); - if (percentage > minimumPercentage) { - return true; - } + if (ieWindow == null) return false; + + Rectangle wholeClient = someWindow.ClientRectangle; + Rectangle partClient = ieWindow.ClientRectangle; + int percentage = (int)(100*(float)(partClient.Width * partClient.Height) / (wholeClient.Width * wholeClient.Height)); + Log.InfoFormat("Window {0}, ie part {1}, percentage {2}", wholeClient, partClient, percentage); + if (percentage > minimumPercentage) { + return true; } return false; } @@ -336,9 +336,8 @@ namespace Greenshot.Helpers { /// window to use /// ICapture with the content (if any) public static ICapture CaptureIe(ICapture capture, WindowDetails windowToCapture) { - if (windowToCapture == null) { - windowToCapture = WindowDetails.GetActiveWindow(); - } + windowToCapture ??= WindowDetails.GetActiveWindow(); + // Show backgroundform after retrieving the active window.. BackgroundForm backgroundForm = new BackgroundForm(Language.GetString(LangKey.contextmenu_captureie), Language.GetString(LangKey.wait_ie_capture)); backgroundForm.Show(); @@ -474,27 +473,28 @@ namespace Greenshot.Helpers { continue; } // check if we need to move - if (otherFrame.DestinationRectangle.IntersectsWith(currentFrame.DestinationRectangle) && !otherFrame.SourceRectangle.IntersectsWith(currentFrame.SourceRectangle)) { - bool horizalResize = currentFrame.SourceSize.Width < currentFrame.DestinationSize.Width; - bool verticalResize = currentFrame.SourceSize.Width < currentFrame.DestinationSize.Width; - bool horizalMove = currentFrame.SourceLeft < currentFrame.DestinationLeft; - bool verticalMove = currentFrame.SourceTop < currentFrame.DestinationTop; - bool leftOf = currentFrame.SourceRight <= otherFrame.SourceLeft; - bool belowOf = currentFrame.SourceBottom <= otherFrame.SourceTop; + if (!otherFrame.DestinationRectangle.IntersectsWith(currentFrame.DestinationRectangle) || + otherFrame.SourceRectangle.IntersectsWith(currentFrame.SourceRectangle)) continue; + + bool horizontalResize = currentFrame.SourceSize.Width < currentFrame.DestinationSize.Width; + bool verticalResize = currentFrame.SourceSize.Width < currentFrame.DestinationSize.Width; + bool horizontalMove = currentFrame.SourceLeft < currentFrame.DestinationLeft; + bool verticalMove = currentFrame.SourceTop < currentFrame.DestinationTop; + bool leftOf = currentFrame.SourceRight <= otherFrame.SourceLeft; + bool belowOf = currentFrame.SourceBottom <= otherFrame.SourceTop; - if ((horizalResize || horizalMove) && leftOf) { - // Current frame resized horizontally, so move other horizontally - Log.DebugFormat("Moving Frame {0} horizontally to the right of {1}", otherFrame.Name, currentFrame.Name); - otherFrame.DestinationLeft = currentFrame.DestinationRight; - movedFrame = true; - } else if ((verticalResize || verticalMove) && belowOf){ - // Current frame resized vertically, so move other vertically - Log.DebugFormat("Moving Frame {0} vertically to the bottom of {1}", otherFrame.Name, currentFrame.Name); - otherFrame.DestinationTop = currentFrame.DestinationBottom; - movedFrame = true; - } else { - Log.DebugFormat("Frame {0} intersects with {1}", otherFrame.Name, currentFrame.Name); - } + if ((horizontalResize || horizontalMove) && leftOf) { + // Current frame resized horizontally, so move other horizontally + Log.DebugFormat("Moving Frame {0} horizontally to the right of {1}", otherFrame.Name, currentFrame.Name); + otherFrame.DestinationLeft = currentFrame.DestinationRight; + movedFrame = true; + } else if ((verticalResize || verticalMove) && belowOf){ + // Current frame resized vertically, so move other vertically + Log.DebugFormat("Moving Frame {0} vertically to the bottom of {1}", otherFrame.Name, currentFrame.Name); + otherFrame.DestinationTop = currentFrame.DestinationBottom; + movedFrame = true; + } else { + Log.DebugFormat("Frame {0} intersects with {1}", otherFrame.Name, currentFrame.Name); } } } @@ -504,7 +504,7 @@ namespace Greenshot.Helpers { // Correct cursor location to be inside the window capture.MoveMouseLocation(-documentContainer.ContentWindow.Location.X, -documentContainer.ContentWindow.Location.Y); // See if the page has the correct size, as we capture the full frame content AND might have moved them - // the normal pagesize will no longer be enough + // the normal pageSize will no longer be enough foreach(DocumentContainer frameData in documentContainer.Frames) { if (!movedMouse && frameData.SourceRectangle.Contains(capture.CursorLocation)) { // Correct mouse cursor location for scrolled position (so it shows on the capture where it really was) diff --git a/Greenshot/Helpers/IEInterop/IEContainer.cs b/Greenshot/Helpers/IEInterop/IEContainer.cs index 56d83ff29..824cf3fa9 100644 --- a/Greenshot/Helpers/IEInterop/IEContainer.cs +++ b/Greenshot/Helpers/IEInterop/IEContainer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/MailHelper.cs b/Greenshot/Helpers/MailHelper.cs index a78799eae..3bc09b5f8 100644 --- a/Greenshot/Helpers/MailHelper.cs +++ b/Greenshot/Helpers/MailHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -76,20 +76,12 @@ namespace Greenshot.Helpers { public static void SendImage(ISurface surface, ICaptureDetails captureDetails) { string tmpFile = ImageOutput.SaveNamedTmpFile(surface, captureDetails, new SurfaceOutputSettings()); - if (tmpFile != null) { - // Store the list of currently active windows, so we can make sure we show the email window later! - var windowsBefore = WindowDetails.GetVisibleWindows(); - //bool isEmailSend = false; - //if (EmailConfigHelper.HasOutlook() && (CoreConfig.OutputEMailFormat == EmailFormat.OUTLOOK_HTML || CoreConfig.OutputEMailFormat == EmailFormat.OUTLOOK_TXT)) { - // isEmailSend = OutlookExporter.ExportToOutlook(tmpFile, captureDetails); - //} - if (/*!isEmailSend &&*/ EmailConfigHelper.HasMapi()) { - // Fallback to MAPI - // Send the email - SendImage(tmpFile, captureDetails.Title); - } - WindowDetails.ActiveNewerWindows(windowsBefore); - } + if (tmpFile == null) return; + + // Store the list of currently active windows, so we can make sure we show the email window later! + var windowsBefore = WindowDetails.GetVisibleWindows(); + SendImage(tmpFile, captureDetails.Title); + WindowDetails.ActiveNewerWindows(windowsBefore); } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] @@ -199,74 +191,83 @@ namespace Greenshot.Helpers { _manualResetEvent?.Close(); } - /// - /// Sends the mail message. - /// - private void ShowMail() { - var message = new MapiHelperInterop.MapiMessage(); + /// + /// Sends the mail message. + /// + private void ShowMail() + { + while (true) + { + var message = new MapiHelperInterop.MapiMessage(); - using var interopRecipients = Recipients.GetInteropRepresentation(); - message.Subject = Subject; - message.NoteText = Body; + using var interopRecipients = Recipients.GetInteropRepresentation(); + message.Subject = Subject; + message.NoteText = Body; - message.Recipients = interopRecipients.Handle; - message.RecipientCount = Recipients.Count; + message.Recipients = interopRecipients.Handle; + message.RecipientCount = Recipients.Count; - // Check if we need to add attachments - if (Files.Count > 0) { - // Add attachments - message.Files = AllocAttachments(out message.FileCount); - } + // Check if we need to add attachments + if (Files.Count > 0) + { + // Add attachments + message.Files = AllocAttachments(out message.FileCount); + } - // Signal the creating thread (make the remaining code async) - _manualResetEvent.Set(); + // Signal the creating thread (make the remaining code async) + _manualResetEvent.Set(); - const int MAPI_DIALOG = 0x8; - //const int MAPI_LOGON_UI = 0x1; - int error = MapiHelperInterop.MAPISendMail(IntPtr.Zero, IntPtr.Zero, message, MAPI_DIALOG, 0); + const int MAPI_DIALOG = 0x8; + //const int MAPI_LOGON_UI = 0x1; + int error = MapiHelperInterop.MAPISendMail(IntPtr.Zero, IntPtr.Zero, message, MAPI_DIALOG, 0); - if (Files.Count > 0) { - // Deallocate the files - DeallocFiles(message); - } - MAPI_CODES errorCode = (MAPI_CODES)Enum.ToObject(typeof(MAPI_CODES), error); + if (Files.Count > 0) + { + // Deallocate the files + DeallocFiles(message); + } - // Check for error - if (errorCode == MAPI_CODES.SUCCESS || errorCode == MAPI_CODES.USER_ABORT) - { - return; - } - string errorText = GetMapiError(errorCode); - Log.Error("Error sending MAPI Email. Error: " + errorText + " (code = " + errorCode + ")."); - MessageBox.Show(errorText, "Mail (MAPI) destination", MessageBoxButtons.OK, MessageBoxIcon.Error); - // Recover from bad settings, show again - if (errorCode != MAPI_CODES.INVALID_RECIPS) - { - return; - } - Recipients = new RecipientCollection(); - ShowMail(); + MAPI_CODES errorCode = (MAPI_CODES) Enum.ToObject(typeof(MAPI_CODES), error); + + // Check for error + if (errorCode == MAPI_CODES.SUCCESS || errorCode == MAPI_CODES.USER_ABORT) + { + return; + } + + string errorText = GetMapiError(errorCode); + Log.Error("Error sending MAPI Email. Error: " + errorText + " (code = " + errorCode + ")."); + MessageBox.Show(errorText, "Mail (MAPI) destination", MessageBoxButtons.OK, MessageBoxIcon.Error); + // Recover from bad settings, show again + if (errorCode != MAPI_CODES.INVALID_RECIPS) + { + return; + } + + Recipients = new RecipientCollection(); + } } - /// + /// /// Deallocates the files in a message. /// /// The message to deallocate the files from. - private void DeallocFiles(MapiHelperInterop.MapiMessage message) { - if (message.Files != IntPtr.Zero) { - Type fileDescType = typeof(MapiFileDescriptor); - int fsize = Marshal.SizeOf(fileDescType); + private void DeallocFiles(MapiHelperInterop.MapiMessage message) + { + if (message.Files == IntPtr.Zero) return; + + Type fileDescType = typeof(MapiFileDescriptor); + int fsize = Marshal.SizeOf(fileDescType); - // Get the ptr to the files - IntPtr runptr = message.Files; - // Release each file - for (int i = 0; i < message.FileCount; i++) { - Marshal.DestroyStructure(runptr, fileDescType); - runptr = new IntPtr(runptr.ToInt64() + fsize); - } - // Release the file - Marshal.FreeHGlobal(message.Files); + // Get the ptr to the files + IntPtr runptr = message.Files; + // Release each file + for (int i = 0; i < message.FileCount; i++) { + Marshal.DestroyStructure(runptr, fileDescType); + runptr = new IntPtr(runptr.ToInt64() + fsize); } + // Release the file + Marshal.FreeHGlobal(message.Files); } /// @@ -337,93 +338,39 @@ namespace Greenshot.Helpers { /// /// Logs any Mapi errors. /// - private string GetMapiError(MAPI_CODES errorCode) { - - string error = string.Empty; - - switch (errorCode) { - case MAPI_CODES.USER_ABORT: - error = "User Aborted."; - break; - case MAPI_CODES.FAILURE: - error = "MAPI Failure."; - break; - case MAPI_CODES.LOGIN_FAILURE: - error = "Login Failure."; - break; - case MAPI_CODES.DISK_FULL: - error = "MAPI Disk full."; - break; - case MAPI_CODES.INSUFFICIENT_MEMORY: - error = "MAPI Insufficient memory."; - break; - case MAPI_CODES.BLK_TOO_SMALL: - error = "MAPI Block too small."; - break; - case MAPI_CODES.TOO_MANY_SESSIONS: - error = "MAPI Too many sessions."; - break; - case MAPI_CODES.TOO_MANY_FILES: - error = "MAPI too many files."; - break; - case MAPI_CODES.TOO_MANY_RECIPIENTS: - error = "MAPI too many recipients."; - break; - case MAPI_CODES.ATTACHMENT_NOT_FOUND: - error = "MAPI Attachment not found."; - break; - case MAPI_CODES.ATTACHMENT_OPEN_FAILURE: - error = "MAPI Attachment open failure."; - break; - case MAPI_CODES.ATTACHMENT_WRITE_FAILURE: - error = "MAPI Attachment Write Failure."; - break; - case MAPI_CODES.UNKNOWN_RECIPIENT: - error = "MAPI Unknown recipient."; - break; - case MAPI_CODES.BAD_RECIPTYPE: - error = "MAPI Bad recipient type."; - break; - case MAPI_CODES.NO_MESSAGES: - error = "MAPI No messages."; - break; - case MAPI_CODES.INVALID_MESSAGE: - error = "MAPI Invalid message."; - break; - case MAPI_CODES.TEXT_TOO_LARGE: - error = "MAPI Text too large."; - break; - case MAPI_CODES.INVALID_SESSION: - error = "MAPI Invalid session."; - break; - case MAPI_CODES.TYPE_NOT_SUPPORTED: - error = "MAPI Type not supported."; - break; - case MAPI_CODES.AMBIGUOUS_RECIPIENT: - error = "MAPI Ambiguous recipient."; - break; - case MAPI_CODES.MESSAGE_IN_USE: - error = "MAPI Message in use."; - break; - case MAPI_CODES.NETWORK_FAILURE: - error = "MAPI Network failure."; - break; - case MAPI_CODES.INVALID_EDITFIELDS: - error = "MAPI Invalid edit fields."; - break; - case MAPI_CODES.INVALID_RECIPS: - error = "MAPI Invalid Recipients."; - break; - case MAPI_CODES.NOT_SUPPORTED: - error = "MAPI Not supported."; - break; - case MAPI_CODES.NO_LIBRARY: - error = "MAPI No Library."; - break; - case MAPI_CODES.INVALID_PARAMETER: - error = "MAPI Invalid parameter."; - break; - } + private string GetMapiError(MAPI_CODES errorCode) + { + string error = errorCode switch + { + MAPI_CODES.USER_ABORT => "User Aborted.", + MAPI_CODES.FAILURE => "MAPI Failure.", + MAPI_CODES.LOGIN_FAILURE => "Login Failure.", + MAPI_CODES.DISK_FULL => "MAPI Disk full.", + MAPI_CODES.INSUFFICIENT_MEMORY => "MAPI Insufficient memory.", + MAPI_CODES.BLK_TOO_SMALL => "MAPI Block too small.", + MAPI_CODES.TOO_MANY_SESSIONS => "MAPI Too many sessions.", + MAPI_CODES.TOO_MANY_FILES => "MAPI too many files.", + MAPI_CODES.TOO_MANY_RECIPIENTS => "MAPI too many recipients.", + MAPI_CODES.ATTACHMENT_NOT_FOUND => "MAPI Attachment not found.", + MAPI_CODES.ATTACHMENT_OPEN_FAILURE => "MAPI Attachment open failure.", + MAPI_CODES.ATTACHMENT_WRITE_FAILURE => "MAPI Attachment Write Failure.", + MAPI_CODES.UNKNOWN_RECIPIENT => "MAPI Unknown recipient.", + MAPI_CODES.BAD_RECIPTYPE => "MAPI Bad recipient type.", + MAPI_CODES.NO_MESSAGES => "MAPI No messages.", + MAPI_CODES.INVALID_MESSAGE => "MAPI Invalid message.", + MAPI_CODES.TEXT_TOO_LARGE => "MAPI Text too large.", + MAPI_CODES.INVALID_SESSION => "MAPI Invalid session.", + MAPI_CODES.TYPE_NOT_SUPPORTED => "MAPI Type not supported.", + MAPI_CODES.AMBIGUOUS_RECIPIENT => "MAPI Ambiguous recipient.", + MAPI_CODES.MESSAGE_IN_USE => "MAPI Message in use.", + MAPI_CODES.NETWORK_FAILURE => "MAPI Network failure.", + MAPI_CODES.INVALID_EDITFIELDS => "MAPI Invalid edit fields.", + MAPI_CODES.INVALID_RECIPS => "MAPI Invalid Recipients.", + MAPI_CODES.NOT_SUPPORTED => "MAPI Not supported.", + MAPI_CODES.NO_LIBRARY => "MAPI No Library.", + MAPI_CODES.INVALID_PARAMETER => "MAPI Invalid parameter.", + _ => string.Empty + }; return error; } @@ -466,7 +413,7 @@ namespace Greenshot.Helpers { } [DllImport("MAPI32.DLL", SetLastError = true, CharSet=CharSet.Ansi)] - public static extern int MAPISendMail(IntPtr session, IntPtr hwnd, MapiMessage message, int flg, int rsv); + public static extern int MAPISendMail(IntPtr session, IntPtr hWnd, MapiMessage message, int flg, int rsv); } } @@ -542,7 +489,7 @@ namespace Greenshot.Helpers { } /// - /// Represents a colleciton of recipients for a mail message. + /// Represents a collection of recipients for a mail message. /// public class RecipientCollection : CollectionBase { /// @@ -627,25 +574,26 @@ namespace Greenshot.Helpers { /// /// Disposes of resources. /// - public void Dispose() { - if (Handle != IntPtr.Zero) { - Type type = typeof(MapiMailMessage.MapiHelperInterop.MapiRecipDesc); - int size = Marshal.SizeOf(type); + public void Dispose() + { + if (Handle == IntPtr.Zero) return; + + Type type = typeof(MapiMailMessage.MapiHelperInterop.MapiRecipDesc); + int size = Marshal.SizeOf(type); - // destroy all the structures in the memory area - IntPtr ptr = Handle; - for (int i = 0; i < _count; i++) { - Marshal.DestroyStructure(ptr, type); - ptr = new IntPtr(ptr.ToInt64() + size); - } + // destroy all the structures in the memory area + IntPtr ptr = Handle; + for (int i = 0; i < _count; i++) { + Marshal.DestroyStructure(ptr, type); + ptr = new IntPtr(ptr.ToInt64() + size); + } - // free the memory - Marshal.FreeHGlobal(Handle); + // free the memory + Marshal.FreeHGlobal(Handle); - Handle = IntPtr.Zero; - _count = 0; - } - } + Handle = IntPtr.Zero; + _count = 0; + } } } } \ No newline at end of file diff --git a/Greenshot/Helpers/NotifyIconNotificationService.cs b/Greenshot/Helpers/NotifyIconNotificationService.cs index 7398a7890..708da7592 100644 --- a/Greenshot/Helpers/NotifyIconNotificationService.cs +++ b/Greenshot/Helpers/NotifyIconNotificationService.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/PluginHelper.cs b/Greenshot/Helpers/PluginHelper.cs index 1d31e8e38..38de55b24 100644 --- a/Greenshot/Helpers/PluginHelper.cs +++ b/Greenshot/Helpers/PluginHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/PrintHelper.cs b/Greenshot/Helpers/PrintHelper.cs index 5de51a20f..d04f8e317 100644 --- a/Greenshot/Helpers/PrintHelper.cs +++ b/Greenshot/Helpers/PrintHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -102,7 +102,7 @@ namespace Greenshot.Helpers { returnPrinterSettings = _printDocument.PrinterSettings; } } catch (Exception e) { - Log.Error("An error ocurred while trying to print", e); + Log.Error("An error occurred while trying to print", e); MessageBox.Show(Language.GetString(LangKey.print_error), Language.GetString(LangKey.error)); } return returnPrinterSettings; @@ -115,21 +115,20 @@ namespace Greenshot.Helpers { /// printer settings if actually printed, or null if print was cancelled or has failed public PrinterSettings PrintWithDialog() { PrinterSettings returnPrinterSettings = null; - if (_printDialog.ShowDialog() == DialogResult.OK) { - DialogResult? printOptionsResult = ShowPrintOptionsDialog(); - try { - if (printOptionsResult == null || printOptionsResult == DialogResult.OK) { - if (!IsColorPrint()) { - _printDocument.DefaultPageSettings.Color = false; - } - _printDocument.Print(); - returnPrinterSettings = _printDialog.PrinterSettings; - } - } catch (Exception e) { - Log.Error("An error ocurred while trying to print", e); - MessageBox.Show(Language.GetString(LangKey.print_error), Language.GetString(LangKey.error)); - } + if (_printDialog.ShowDialog() != DialogResult.OK) return null; + DialogResult? printOptionsResult = ShowPrintOptionsDialog(); + try { + if (printOptionsResult == null || printOptionsResult == DialogResult.OK) { + if (!IsColorPrint()) { + _printDocument.DefaultPageSettings.Color = false; + } + _printDocument.Print(); + returnPrinterSettings = _printDialog.PrinterSettings; + } + } catch (Exception e) { + Log.Error("An error occurred while trying to print", e); + MessageBox.Show(Language.GetString(LangKey.print_error), Language.GetString(LangKey.error)); } return returnPrinterSettings; } @@ -153,9 +152,7 @@ namespace Greenshot.Helpers { } private void DrawImageForPrint(object sender, PrintPageEventArgs e) { - - - // Create the output settins + // Create the output settings SurfaceOutputSettings printOutputSettings = new SurfaceOutputSettings(OutputFormat.png, 100, false); ApplyEffects(printOutputSettings); @@ -190,7 +187,7 @@ namespace Greenshot.Helpers { RectangleF imageRect = image.GetBounds(ref gu); // rotate the image if it fits the page better if (CoreConfig.OutputPrintAllowRotate) { - if ((pageRect.Width > pageRect.Height && imageRect.Width < imageRect.Height) || (pageRect.Width < pageRect.Height && imageRect.Width > imageRect.Height)) { + if (pageRect.Width > pageRect.Height && imageRect.Width < imageRect.Height || pageRect.Width < pageRect.Height && imageRect.Width > imageRect.Height) { image.RotateFlip(RotateFlipType.Rotate270FlipNone); imageRect = image.GetBounds(ref gu); if (alignment.Equals(ContentAlignment.TopLeft)) { @@ -203,7 +200,7 @@ namespace Greenshot.Helpers { // scale the image to fit the page better if (CoreConfig.OutputPrintAllowEnlarge || CoreConfig.OutputPrintAllowShrink) { SizeF resizedRect = ScaleHelper.GetScaledSize(imageRect.Size, pageRect.Size, false); - if ((CoreConfig.OutputPrintAllowShrink && resizedRect.Width < printRect.Width) || CoreConfig.OutputPrintAllowEnlarge && resizedRect.Width > printRect.Width) { + if (CoreConfig.OutputPrintAllowShrink && resizedRect.Width < printRect.Width || CoreConfig.OutputPrintAllowEnlarge && resizedRect.Width > printRect.Width) { printRect.Size = resizedRect; } } diff --git a/Greenshot/Helpers/ProcessorHelper.cs b/Greenshot/Helpers/ProcessorHelper.cs index 0ccf0fbe6..25598944a 100644 --- a/Greenshot/Helpers/ProcessorHelper.cs +++ b/Greenshot/Helpers/ProcessorHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/ResourceMutex.cs b/Greenshot/Helpers/ResourceMutex.cs index 7a70031c1..9854c3dca 100644 --- a/Greenshot/Helpers/ResourceMutex.cs +++ b/Greenshot/Helpers/ResourceMutex.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -106,7 +106,7 @@ namespace Greenshot.Helpers catch (AbandonedMutexException e) { // Another instance didn't cleanup correctly! - // we can ignore the exception, it happend on the "waitone" but still the mutex belongs to us + // we can ignore the exception, it happened on the "waitOne" but still the mutex belongs to us Log.WarnFormat("{0} didn't cleanup correctly, but we got the mutex {1}.", _resourceName, _mutexId); Log.Warn(e); } @@ -132,26 +132,25 @@ namespace Greenshot.Helpers /// The real disposing code /// /// true if dispose is called, false when the finalizer is called - protected virtual void Dispose(bool disposing) + protected void Dispose(bool disposing) { - if (!_disposedValue) + if (_disposedValue) return; + + if (_applicationMutex != null) { - if (_applicationMutex != null) + try { - try - { - _applicationMutex.ReleaseMutex(); - _applicationMutex = null; - Log.InfoFormat("Released Mutex {0} for {1}", _mutexId, _resourceName); - } - catch (Exception ex) - { - Log.ErrorFormat("Error releasing Mutex {0} for {1}", _mutexId, _resourceName); - Log.Error(ex); - } + _applicationMutex.ReleaseMutex(); + _applicationMutex = null; + Log.InfoFormat("Released Mutex {0} for {1}", _mutexId, _resourceName); + } + catch (Exception ex) + { + Log.ErrorFormat("Error releasing Mutex {0} for {1}", _mutexId, _resourceName); + Log.Error(ex); } - _disposedValue = true; } + _disposedValue = true; } /// diff --git a/Greenshot/Helpers/ScaleHelper.cs b/Greenshot/Helpers/ScaleHelper.cs index b7c7b1d62..76e0091c6 100644 --- a/Greenshot/Helpers/ScaleHelper.cs +++ b/Greenshot/Helpers/ScaleHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -64,7 +64,7 @@ namespace Greenshot.Helpers { /// calculates the position of an element depending on the desired alignment within a RectangleF /// /// the bounds of the element to be aligned - /// the rectangle reference for aligment of the element + /// the rectangle reference for alignment of the element /// the System.Drawing.ContentAlignment value indicating how the element is to be aligned should the width or height differ from targetSize /// a new RectangleF object with Location aligned aligned to targetRect public static RectangleF GetAlignedRectangle(RectangleF currentRect, RectangleF targetRect, ContentAlignment alignment) { @@ -136,15 +136,13 @@ namespace Greenshot.Helpers { /// coordinates of the used handle/gripper /// ScaleOptions to use when scaling public static void Scale(ref RectangleF originalRectangle, Positions resizeHandlePosition, PointF resizeHandleCoords, ScaleOptions? options) { - if(options == null) { - options = GetScaleOptions(); - } + options ??= GetScaleOptions(); - if((options & ScaleOptions.Rational) == ScaleOptions.Rational) { + if ((options & ScaleOptions.Rational) == ScaleOptions.Rational) { adjustCoordsForRationalScale(originalRectangle, resizeHandlePosition, ref resizeHandleCoords); } - if((options & ScaleOptions.Centered) == ScaleOptions.Centered) { + if ((options & ScaleOptions.Centered) == ScaleOptions.Centered) { // store center coordinates of rectangle float rectCenterX = originalRectangle.Left + originalRectangle.Width / 2; float rectCenterY = originalRectangle.Top + originalRectangle.Height / 2; @@ -332,14 +330,14 @@ namespace Greenshot.Helpers { } public class ShapeAngleRoundBehavior : IDoubleProcessor { - public static ShapeAngleRoundBehavior Instance = new ShapeAngleRoundBehavior(); + public static ShapeAngleRoundBehavior Instance = new(); private ShapeAngleRoundBehavior() {} public double Process(double angle) { return Math.Round((angle+45)/90)*90 - 45; } } public class LineAngleRoundBehavior : IDoubleProcessor { - public static LineAngleRoundBehavior Instance = new LineAngleRoundBehavior(); + public static LineAngleRoundBehavior Instance = new(); private LineAngleRoundBehavior() {} public double Process(double angle) { return Math.Round(angle/15)*15; @@ -354,21 +352,6 @@ namespace Greenshot.Helpers { return fixedAngle; } } - - - - - - /*public static int FindGripperPostition(float anchorX, float anchorY, float gripperX, float gripperY) { - if(gripperY > anchorY) { - if(gripperX > anchorY) return Gripper.POSITION_BOTTOM_RIGHT; - else return Gripper.POSITION_BOTTOM_LEFT; - } else { - if(gripperX > anchorY) return Gripper.POSITION_TOP_RIGHT; - else return Gripper.POSITION_TOP_LEFT; - } - }*/ - } } \ No newline at end of file diff --git a/Greenshot/Helpers/SoundHelper.cs b/Greenshot/Helpers/SoundHelper.cs index eb9139290..427909d86 100644 --- a/Greenshot/Helpers/SoundHelper.cs +++ b/Greenshot/Helpers/SoundHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/StartupHelper.cs b/Greenshot/Helpers/StartupHelper.cs index 9e5e4461b..1ca5180e8 100644 --- a/Greenshot/Helpers/StartupHelper.cs +++ b/Greenshot/Helpers/StartupHelper.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -226,9 +226,9 @@ namespace Greenshot.Helpers { } /// - /// Test if there is a link in the Statup folder + /// Test if there is a link in the Startup folder /// - /// + /// bool public static bool IsInStartupFolder() { try { string lnkName = Path.GetFileNameWithoutExtension(Application.ExecutablePath) + ".lnk"; diff --git a/Greenshot/Helpers/ToolStripItemEndisabler.cs b/Greenshot/Helpers/ToolStripItemEndisabler.cs index 268a8d2b2..db5a5d178 100644 --- a/Greenshot/Helpers/ToolStripItemEndisabler.cs +++ b/Greenshot/Helpers/ToolStripItemEndisabler.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -63,24 +63,26 @@ namespace Greenshot.Helpers { Endisable(tsi, false, PropagationMode.CHILDREN); } - private static void Endisable(ToolStrip ts, bool enable, PropagationMode mode){ - if((mode & PropagationMode.CHILDREN) == PropagationMode.CHILDREN) { - foreach(ToolStripItem tsi in ts.Items) { - Endisable(tsi, enable, PropagationMode.CHILDREN); - } + private static void Endisable(ToolStrip ts, bool enable, PropagationMode mode) + { + if ((mode & PropagationMode.CHILDREN) != PropagationMode.CHILDREN) return; + + foreach(ToolStripItem tsi in ts.Items) { + Endisable(tsi, enable, PropagationMode.CHILDREN); } } private static void Endisable(ToolStripItem tsi, bool enable, PropagationMode mode){ - if(tsi is ToolStripDropDownItem) { - Endisable(tsi as ToolStripDropDownItem, enable, mode); + if (tsi is ToolStripDropDownItem item) { + Endisable(item, enable, mode); } else { tsi.Enabled = enable; } - if((mode & PropagationMode.ANCESTORS) == PropagationMode.ANCESTORS) { - if(tsi.OwnerItem != null) Endisable(tsi.OwnerItem, enable, PropagationMode.ANCESTORS); - } + + if ((mode & PropagationMode.ANCESTORS) != PropagationMode.ANCESTORS) return; + if (tsi.OwnerItem != null) Endisable(tsi.OwnerItem, enable, PropagationMode.ANCESTORS); + } private static void Endisable(ToolStripDropDownItem tsddi, bool enable, PropagationMode mode) { diff --git a/Greenshot/Helpers/UpdateService.cs b/Greenshot/Helpers/UpdateService.cs index ceb3488be..8c1728fb8 100644 --- a/Greenshot/Helpers/UpdateService.cs +++ b/Greenshot/Helpers/UpdateService.cs @@ -1,5 +1,5 @@ // Greenshot - a free and open source screenshot tool -// Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom +// Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom // // For more information see: http://getgreenshot.org/ // The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Helpers/WindowWrapper.cs b/Greenshot/Helpers/WindowWrapper.cs deleted file mode 100644 index 1fde215e0..000000000 --- a/Greenshot/Helpers/WindowWrapper.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Windows.Forms; - -namespace Greenshot.Helpers { - public class WindowWrapper : IWin32Window { - public WindowWrapper(IntPtr handle) { - Handle = handle; - } - - public IntPtr Handle { get; } - } -} diff --git a/Greenshot/Languages/language-ar-SY.xml b/Greenshot/Languages/language-ar-SY.xml index eec227d75..c5c6edc84 100644 --- a/Greenshot/Languages/language-ar-SY.xml +++ b/Greenshot/Languages/language-ar-SY.xml @@ -5,7 +5,7 @@ اذا اعجبك البرنامج انت مدعو لدعمنا: جرين شوت استضيف بواسطة GitHub في الايقونات بواسطة مجموعة ايقونات يوسوكي كامياماني (تحت رخصة المشاع الإبداعي الاصدار 3.0) - حقوق النشر © 2007 - 2020 توماس براون, جينس كلنجين, روبين كروم + حقوق النشر © 2007 -2021 توماس براون, جينس كلنجين, روبين كروم جرين شوت لا يأتي مع أية ضمان. هذا برنامج حر, مرحبا بك لتعيد توزيعه تحت شروط معينة. تفاصيل حول رخصة جنو العمومية: حول جرين شوت diff --git a/Greenshot/Languages/language-ca-CA.xml b/Greenshot/Languages/language-ca-CA.xml index 374d58705..9f92f7446 100644 --- a/Greenshot/Languages/language-ca-CA.xml +++ b/Greenshot/Languages/language-ca-CA.xml @@ -5,7 +5,7 @@ Si Greenshot us agrada , us agrairem que ens ajudeu: Greenshot s'allotja a sourceforge.net Icones del conjunt d'icones Fugue de Yusuke Kamiyamane(Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot s'ofereix SENSE CAP GARANTIA. Aquest és un programari gratuït, i podeu redistribuir-lo amb algunes condicions. Detalls sobre la Llicència General Publica GNU: Quant a Greenshot diff --git a/Greenshot/Languages/language-cs-CZ.xml b/Greenshot/Languages/language-cs-CZ.xml index 392ba617d..c34389ebf 100644 --- a/Greenshot/Languages/language-cs-CZ.xml +++ b/Greenshot/Languages/language-cs-CZ.xml @@ -5,7 +5,7 @@ Pokud se vám Greenshot líbí, uvítáme Vaší podporu Greenshot je hostován na sourceforge.net Ikony pochází ze sady Yusuke Kamiyamane's Fugue (licence Creative Commons Attribution 3.0) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot je ABSOLUTNĚ BEZ ZÁRUKY. Toto je svobodný software, můžete jej dále šířit za určitých podmínek. Podrobnosti o GNU General Public License: O programu Greenshot diff --git a/Greenshot/Languages/language-de-DE.xml b/Greenshot/Languages/language-de-DE.xml index 2435a7105..9ece82568 100644 --- a/Greenshot/Languages/language-de-DE.xml +++ b/Greenshot/Languages/language-de-DE.xml @@ -5,7 +5,7 @@ Wenn Sie Greenshot mögen, können Sie uns gerne unterstützen: Greenshot wird von GitHub gehostet unter Icons aus Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Für Greenshot besteht KEINERLEI GARANTIE. Greenshot ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen. Detaillierte Informationen zur GNU General Public License: Über Greenshot diff --git a/Greenshot/Languages/language-de-x-franconia.xml b/Greenshot/Languages/language-de-x-franconia.xml index abbf24bbf..b989bcfe7 100644 --- a/Greenshot/Languages/language-de-x-franconia.xml +++ b/Greenshot/Languages/language-de-x-franconia.xml @@ -5,7 +5,7 @@ Wenn der Greenshot gfälld, kannsd uns gern a weng helfn: Greenshot is a bei GitHub, und zwa dordn: Dei Fuztl-Bildla sin vom Yusuke Kamiyamane's Fugue icon set (Griäidif Gommens Äddribuschn 3.0 Laisns) - Kobbireid (C) 2007-2020 Domas Braun, Jens Glingen, Robin Grohm + Kobbireid (C) 2007-2021 Domas Braun, Jens Glingen, Robin Grohm A Garandie gibds für Greenshot ned, des kannst vergessn. Greenshot is umsonsd und wennsd mogst, kannsd es a rumreichn. Mehr Infos zur GNU Dschännerel Bablig Laisns: Was issn Greenshot??? diff --git a/Greenshot/Languages/language-el-GR.xml b/Greenshot/Languages/language-el-GR.xml index 732b54f0c..14cb68bef 100644 --- a/Greenshot/Languages/language-el-GR.xml +++ b/Greenshot/Languages/language-el-GR.xml @@ -5,7 +5,7 @@ Αν σας αρέσει το Greenshot, είστε ευπρόσδεκτοι να μας υποστηρίξετε: Το Greenshot φιλοξενείται από τη GitHub: Εικονίδια από Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Δεν παρέχεται ΚΑΜΙΑ ΕΓΓΥΗΣΗ για το Greenshot. Είναι ελεύθερο λογισμικό. Είστε ελεύθεροι να το αναδιανείμετε κάτω από ορισμένες συνθήκες. Λεπτομέρειες σχετικά με την GNU General Public License: Πληροφορίες για το Greenshot diff --git a/Greenshot/Languages/language-en-US.xml b/Greenshot/Languages/language-en-US.xml index 1efcd15e9..0537c965b 100644 --- a/Greenshot/Languages/language-en-US.xml +++ b/Greenshot/Languages/language-en-US.xml @@ -5,7 +5,7 @@ If you like Greenshot, you are welcome to support us: Greenshot is hosted by GitHub at Icons from Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Details about the GNU General Public License: About Greenshot diff --git a/Greenshot/Languages/language-es-ES.xml b/Greenshot/Languages/language-es-ES.xml index 22d44abf5..b84aee912 100644 --- a/Greenshot/Languages/language-es-ES.xml +++ b/Greenshot/Languages/language-es-ES.xml @@ -5,7 +5,7 @@ Si te gusta Greenshot, te agradeceremos que nos ayudes: Greenshot está alojado en GitHub en Iconos del conjunto de iconos Fugue de Yusuke Kamiyamane(Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot viene ABSOLUTAMENTE SIN GARANTIA. Este es software gratuito, y eres bienvenido a redistribuirlo bajo ciertas condiciones. Detalles acerca de la Licencia General Publica GNU: Acerca de Greenshot diff --git a/Greenshot/Languages/language-et-EE.xml b/Greenshot/Languages/language-et-EE.xml index 0de7a68f7..b358977e8 100644 --- a/Greenshot/Languages/language-et-EE.xml +++ b/Greenshot/Languages/language-et-EE.xml @@ -5,7 +5,7 @@ Greenshoti kasutamismugavust ja arendust saate toetada siin: Greenshot asub portaalis GitHub Yusuke Kamiyamane on ikoonide tegija Fugue ikooni paketist (Creative Commons Attribution 3.0 litsents) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot ei paku GARANTIID. See on vabaravaline programm ja Te võite seda levitava vabalt teatud tingimuste alusel. Lisainfo GNU Põhilise Avaliku Litsentsi kohta: Info Greenshoti kohta diff --git a/Greenshot/Languages/language-fi-FI.xml b/Greenshot/Languages/language-fi-FI.xml index 13a01263c..f66cc5013 100644 --- a/Greenshot/Languages/language-fi-FI.xml +++ b/Greenshot/Languages/language-fi-FI.xml @@ -5,7 +5,7 @@ Jos pidät Greenshotista niin toivottavasti tuet meitä: Greenshot is hosted by GitHub at Ikonit ovat Yusuke Kamiyamane:n Fugue ikonisarjasta (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Details about the GNU General Public License: Tietoja Greenshotista diff --git a/Greenshot/Languages/language-fr-FR.xml b/Greenshot/Languages/language-fr-FR.xml index 26349708d..53f8e21f6 100644 --- a/Greenshot/Languages/language-fr-FR.xml +++ b/Greenshot/Languages/language-fr-FR.xml @@ -5,7 +5,7 @@ Si vous aimez Greenshot, vous pouvez nous soutenir : Greenshot est hébergé par GitHub à Icônes provenant du lot d'icônes Fugue de Kamiyamane Yuusuke (Creative Commons Attribution 3.0 license) - Copyright © 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright © 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot vous est fourni SANS AUCUNE GARANTIE. C'est un logiciel gratuit que vous êtes libres de redistribuer sous certaines conditions. Détails de la GNU General Public License : À propos de Greenshot diff --git a/Greenshot/Languages/language-fr-QC.xml b/Greenshot/Languages/language-fr-QC.xml index 629591d62..17c0e5537 100644 --- a/Greenshot/Languages/language-fr-QC.xml +++ b/Greenshot/Languages/language-fr-QC.xml @@ -5,7 +5,7 @@ Si vous aimez Greenshot, vous pouvez nous soutenir : Greenshot est hébergé par GitHub à Icônes provenant du lot d'icônes Fugue de Kamiyamane Yuusuke (Creative Commons Attribution 3.0 license) - Copyright © 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright © 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot vous est fourni SANS AUCUNE GARANTIE. C'est un logiciel gratuit que vous êtes libres de redistribuer sous certaines conditions. Détails de la GNU General Public License : A propos de Greenshot diff --git a/Greenshot/Languages/language-he-IL.xml b/Greenshot/Languages/language-he-IL.xml index 10f5a3c31..4df909d37 100644 --- a/Greenshot/Languages/language-he-IL.xml +++ b/Greenshot/Languages/language-he-IL.xml @@ -5,7 +5,7 @@ :אם את\ה נהנה\ית משימוש בתוכנה, את\ה מוזמן לתרום לנו Greenshot is hosted by GitHub at Icons from Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Details about the GNU General Public License: Greenshot אודות התוכנה diff --git a/Greenshot/Languages/language-hu-HU.xml b/Greenshot/Languages/language-hu-HU.xml index c20c0cf99..0d5a06df9 100644 --- a/Greenshot/Languages/language-hu-HU.xml +++ b/Greenshot/Languages/language-hu-HU.xml @@ -5,7 +5,7 @@ Ha szereted Greenshot -ot, akkor támogass minket: Greenshot kiszolgálója a GitHub Az ikonokat Yusuke Kamiyamane's Fugue készítette (Creative Commons Attribution 3.0 license) - Szerzői jog (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Szerzői jog (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom SEMMIFÉLE GARANCIA sincs a Greenshot -hoz. Ez egy ingyenes program, és hálásak vagyunk, hogy terjeszted bizonyos feltételekkel. Részletek a GNU Fő Nyílvános Engedélyről: Greenshot névjegye diff --git a/Greenshot/Languages/language-id-ID.xml b/Greenshot/Languages/language-id-ID.xml index ea35af361..e474cae59 100644 --- a/Greenshot/Languages/language-id-ID.xml +++ b/Greenshot/Languages/language-id-ID.xml @@ -5,18 +5,18 @@ Jika anda menyukai Greenshot, anda dipersilahkan untuk mendukung kami: Greenshot dikelola oleh GitHub di Ikon dari Yusuke Kamiyamane Fugue ikon set (lisensi Creative Commons Attribution 3.0) - Hak Cipta milik Thomas Braun, Jens Klingen, Robin Krom 2007-2020 -Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. + Hak Cipta milik Thomas Braun, Jens Klingen, Robin Krom 2007-2021 +Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Details about the GNU General Public License: Tentang Greenshot Greenshot - utilitas penangkap layar yang revolusioner Tutup - Maaf, kesalahan yang tak terduga terjadi. - -Kabar baiknya: anda dapat membantu kami memperbaikinya dengan mengisi laporan kesalahan. -Harap kunjungi laman berikut, buat laporan kesalahan baru dan letakkan konten dari area teks ke wadah deskripsi. - -Harap tambah penjelasan yang berarti dan sertakan informasi lain yang penting untuk kami tiru kesalahannya. + Maaf, kesalahan yang tak terduga terjadi. + +Kabar baiknya: anda dapat membantu kami memperbaikinya dengan mengisi laporan kesalahan. +Harap kunjungi laman berikut, buat laporan kesalahan baru dan letakkan konten dari area teks ke wadah deskripsi. + +Harap tambah penjelasan yang berarti dan sertakan informasi lain yang penting untuk kami tiru kesalahannya. Juga, kami sangat terbantu apabila anda mengecek laporan lain yang sama dengan kepunyaan anda. (Anda dapat menggunakan pencarian untuk mencari dengan cepat.) Terima kasih :) Kesalahan Batal @@ -180,7 +180,7 @@ Juga, kami sangat terbantu apabila anda mengecek laporan lain yang sama dengan k Outlook dengan teks Kesalahan Sesuatu dari Greenshot telah dijalankan. - Tidak dapat berkas {0}. + Tidak dapat berkas {0}. Harap cek aksesibilitas menuis pada lokasi penyimpanan yang dipilih. Berkas "{0}" tidak dapat dibuka. Tidak dapat membuka link '{0}'. @@ -245,22 +245,22 @@ Harap cek aksesibilitas menuis pada lokasi penyimpanan yang dipilih. Tangkap Internet Explorer Kualitas JPEG Bahasa - Pedoman berikut akan ditimpa otomatis dalam pola yang ditetapkan: -${YYYY} tahun, 4 digit -${MM} bulan, 2 digit -${DD} hari, 2 digit -${hh} jam, 2 digit -${mm} menit, 2 digit -${ss} detik, 2 digit -${NUM} angka tambahan, 6 digit -${title} judul jendela -${user} pengguna Windows -${domain} domain Windows -${hostname} nama PC - -Anda juga dapat membuat direktori Greenshot secara dinamis, cukup gunakan simbol garis miring {\} untuk memisahkan folder dan nama berkas -Contoh: pola ${YYYY}-${MM}-${DD}\${hh}-${mm}-${ss} -akan menbuat folder untuk hari terbaru di lokasi penyimpan default, cont. 2008-06-29, nama berkas didasarkan pada waktu terbaru + Pedoman berikut akan ditimpa otomatis dalam pola yang ditetapkan: +${YYYY} tahun, 4 digit +${MM} bulan, 2 digit +${DD} hari, 2 digit +${hh} jam, 2 digit +${mm} menit, 2 digit +${ss} detik, 2 digit +${NUM} angka tambahan, 6 digit +${title} judul jendela +${user} pengguna Windows +${domain} domain Windows +${hostname} nama PC + +Anda juga dapat membuat direktori Greenshot secara dinamis, cukup gunakan simbol garis miring {\} untuk memisahkan folder dan nama berkas +Contoh: pola ${YYYY}-${MM}-${DD}\${hh}-${mm}-${ss} +akan menbuat folder untuk hari terbaru di lokasi penyimpan default, cont. 2008-06-29, nama berkas didasarkan pada waktu terbaru cont, 11_58_32 (ditambah ekstensi yang ditetapkan pada pengaturan) Jaringan dan pembaruan Output @@ -296,8 +296,8 @@ cont, 11_58_32 (ditambah ekstensi yang ditetapkan pada pengaturan) Versi baru Greenshot telah tersedia! Apakah anda ingin mengunduh Greenshot {0}? Harap tunggu ketika halaman Internet Explorer sedang ditangkap Peringatan - hotkey {0} tak dapat terdaftar, kemungkinan akibat alat lain telah mengklaim penggunaan hotkey, anda dapat mengganti hotkey yang lain atau menonaktifkannya. - + hotkey {0} tak dapat terdaftar, kemungkinan akibat alat lain telah mengklaim penggunaan hotkey, anda dapat mengganti hotkey yang lain atau menonaktifkannya. + Semua fitur Greenshot masih bekerja dengan baik dari ikon tray menu konteks tanpa hotkey. Gunakan warna kesukaan Pertahankan kebeningan diff --git a/Greenshot/Languages/language-it-IT.xml b/Greenshot/Languages/language-it-IT.xml index 2d9fc43e0..53fa10837 100644 --- a/Greenshot/Languages/language-it-IT.xml +++ b/Greenshot/Languages/language-it-IT.xml @@ -5,12 +5,12 @@ Se ti piace Greenshot, supportaci su: Greenshot è disponibile nel repository GitHub Libreria icone del set icone Fugue di Yusuke Kamiyamane (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot viene fornito SENZA ALCUNA GARANZIA. -Questo software è garuitio", e potete ri-distribuirlo secondo certe condizioni. +Questo software è gratuito", e potete ri-distribuirlo secondo certe condizioni. Dettagli della General Public License GNU: Info su Greenshot - Traduzione italiana (v. 16.08.2020) di bovirus e tonytogna + Traduzione italiana (v. 29.01.2021) di bovirus e tonytogna Greenshot - Uno straordinario strumento per copiare immagini dallo schermo Chiudi Si è verificato un errore inaspettato. @@ -133,7 +133,7 @@ Controlla i permessi di accesso per '{0}'. Adatta a dimensioni di cattura Offusca (O) Sfuma - Modalità di offuscamento + Modalità offuscamento Offusca/pixelizza Oggetti Apri cartella su Windows Explorer @@ -185,7 +185,7 @@ Correggi la maschera noem file e riprova. Esegui ottimizzazioni per uso con desktop remoto Riutilizza se possibile la gestione immagini Evita avviso di salvataggio in chiusura della gestione immagini - Visualizza anteprima finestra nel menù di contesto (Vista e Windows 7) + Visualizza anteprima finestra nel menù contestuale (Vista e Windows 7) Esportato in: {0} Si è verificato un errore durante l'esportazione in {0}: Guida in linea Greenshot @@ -207,7 +207,7 @@ Correggi la maschera noem file e riprova. Aggiungi data/ora nel piè di pagina Opzioni di stampa di Greenshot Salva come qualità predefinita e non chiedere più - Qualità di Greenshot + Qualità Greenshot Salva direttamente (usando le impostazioni preferite file destinazione) Visualizza scelta opzioni di stampa ogni volta che stampi un'immagine Visualizza scelta qualità ogni volta che si salva un'immagine diff --git a/Greenshot/Languages/language-ja-JP.xml b/Greenshot/Languages/language-ja-JP.xml index 2111930ad..c894b9573 100644 --- a/Greenshot/Languages/language-ja-JP.xml +++ b/Greenshot/Languages/language-ja-JP.xml @@ -5,7 +5,7 @@ Greenshot がお気に召したなら、是非支援をお願いします : Greenshot は GitHub によって運営されています : 上山根 祐輔氏の Fugue Icons を使用しています (Creative Commons Attribution 3.0 license) : - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot には一切の保障がありません。GNU General Public License に定められた条件下で再配布をおこなうことができます。: Greenshot について Greenshot - the revolutionary screenshot utility diff --git a/Greenshot/Languages/language-kab-DZ.xml b/Greenshot/Languages/language-kab-DZ.xml index 39244e170..31930d2db 100644 --- a/Greenshot/Languages/language-kab-DZ.xml +++ b/Greenshot/Languages/language-kab-DZ.xml @@ -5,7 +5,7 @@ Ma tḥemled Greenshot, Mudd-aɣ-d afus : Greenshot yezdeɣ di sourceforge.net di Tignitin i d-yekkan seg uqettun n tignitin Fugue n Kamiyamane Yuusuke (Creative Commons Attribution 3.0 license) - Copyright © 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright © 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot yettunefk-d S WAR ṬMANA. d aseɣẓan ilelli i tzemreḍ ad tezuzreḍ s kra n tewtilin. Talqayt ɣef GNU General Public License : Ɣef Greenshot diff --git a/Greenshot/Languages/language-ko-KR.xml b/Greenshot/Languages/language-ko-KR.xml index 64379ce8c..a332cea33 100644 --- a/Greenshot/Languages/language-ko-KR.xml +++ b/Greenshot/Languages/language-ko-KR.xml @@ -5,7 +5,7 @@ Greenshot이 좋다면 아래 URL로 방문하셔서 지원할 수 있습니다. Greenshot은 GitHub 관리하에 아래 링크에서 호스팅되고 있습니다 아이콘은 Yusuke Kamiyamane's Fugue icon set으로부터 제공받은 것입니다. (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Details about the GNU General Public License: Greenshot 프로그램 소개... diff --git a/Greenshot/Languages/language-lt-LT.xml b/Greenshot/Languages/language-lt-LT.xml index f69425916..e84388901 100644 --- a/Greenshot/Languages/language-lt-LT.xml +++ b/Greenshot/Languages/language-lt-LT.xml @@ -5,7 +5,7 @@ Jei jums patiko Greenshot, galite mus paremti: Greenshot talpinamas GitHub IIkonų rinkinys Fugue, аutorius Yusuke Kamiyamane, licencija Creative Commons Attribution 3.0 - Visos teisės saugomos (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Visos teisės saugomos (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot pateikiama BE JOKIŲ GARANTIJŲ. Greenshot — laisvai platinama PĮ su GPL licencija ir jūs galite laisvai ją platinti, laikydamasi licencinės sutarties: Apie Greenshot Greenshot — revoliucinis įrankis ekrano nuotraukoms daryti diff --git a/Greenshot/Languages/language-nl-NL.xml b/Greenshot/Languages/language-nl-NL.xml index 66601348d..507ece7dc 100644 --- a/Greenshot/Languages/language-nl-NL.xml +++ b/Greenshot/Languages/language-nl-NL.xml @@ -5,7 +5,7 @@ Als Greenshot u bevalt, wilt u ons wellicht ondersteunen: Greenshot wordt uitgegeven door sourceforge.net op Iconen afkomstig van Yusuke Kamiyamane's Fugue (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot komt zonder enige garantie! Dit is gratis software en het staat u vrij het onder bepaalde voorwaarden te verspreiden. Details over de GNU General Public License: Over Greenshot diff --git a/Greenshot/Languages/language-nn-NO.xml b/Greenshot/Languages/language-nn-NO.xml index 291e1e2db..003b11b9a 100644 --- a/Greenshot/Languages/language-nn-NO.xml +++ b/Greenshot/Languages/language-nn-NO.xml @@ -5,7 +5,7 @@ Om du likar Greenshot er du velkomen til å støtte oss: Greenshot held virtuelt hus hjå GitHub: Ikon frå Yusuke Kamiyamane sit "Fugue" ikonsett (Creative Commons Attribution 3.0-lisens) - Med kopirett (C) 2007-2020 Thomas Braun, Jens Klingen og Robin Krom. Norsk omsetjing av Ivar Barstad. + Med kopirett (C) 2007-2021 Thomas Braun, Jens Klingen og Robin Krom. Norsk omsetjing av Ivar Barstad. Greenshot har ABSOLUTT INGEN GARANTI. Dette er gratis programvare, og du står fritt til å distribuere det under visse vilkår. Detaljar om GNU General Public-lisens: Om Greenshot diff --git a/Greenshot/Languages/language-pl-PL.xml b/Greenshot/Languages/language-pl-PL.xml index ea6e96b0a..54e2fd993 100644 --- a/Greenshot/Languages/language-pl-PL.xml +++ b/Greenshot/Languages/language-pl-PL.xml @@ -5,7 +5,7 @@ Jeśli podoba Ci się Greenshot, chętnie przyjmiemy Twoje wsparcie: Greenshot jest utrzymywany przez GitHub pod adresem: Ikony z zestawu Fugue od Yusuke Kamiyamane (licencja Creative Commons Attribution 3.0): - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot nie jest objęty JAKĄKOLWIEK GWARANCJĄ. Jako wolne oprogramowanie może być rozpowszechniany na określonych warunkach. Szczegóły na temat Powszechnej Licencji Publicznej GNU: O Greenshot diff --git a/Greenshot/Languages/language-pt-BR.xml b/Greenshot/Languages/language-pt-BR.xml index 4f379ae80..8bfd938ed 100644 --- a/Greenshot/Languages/language-pt-BR.xml +++ b/Greenshot/Languages/language-pt-BR.xml @@ -6,7 +6,7 @@ O Greenshot está armazenado no GitHub em Ícones de Yusuke Kamiyamane (Biblioteca Fugue, licença "Creative Commons Attribution 3.0") - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom O Greenshot não tem NENHUMA GARANTIA. Este software gratuito pode ser redistribuído sob algumas condições. Detalhes sobre a licença GNU: diff --git a/Greenshot/Languages/language-pt-PT.xml b/Greenshot/Languages/language-pt-PT.xml index 8e53f804b..dabc42762 100644 --- a/Greenshot/Languages/language-pt-PT.xml +++ b/Greenshot/Languages/language-pt-PT.xml @@ -5,7 +5,7 @@ Se gostou do Greenshot, por favor contribua: O Greenshot está armazenado no GitHub em Ícones da colecção Fugue de Yusuke Kamiyamane (Licença "Creative Commons Attribution 3.0") - Direitos de Autor (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Direitos de Autor (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom O Greenshot não tem NENHUMA GARANTIA. Este software gratuito pode ser redistribuído sob algumas condições. Detalhes sobre a licença GNU: Acerca do Greenshot diff --git a/Greenshot/Languages/language-ru-RU.xml b/Greenshot/Languages/language-ru-RU.xml index 9823d8bf1..42d85df80 100644 --- a/Greenshot/Languages/language-ru-RU.xml +++ b/Greenshot/Languages/language-ru-RU.xml @@ -5,7 +5,7 @@ Если вам нравится Greenshot, вы можете поддержать нас: Greenshot размещается на GitHub Набор иконок Yusuke Kamiyamane's Fugue (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot поставляется БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ.Это бесплатная программа и вы можете распространять её на определённых условиях. Подробно о GNU General Public License: О программе Greenshot diff --git a/Greenshot/Languages/language-sk-SK.xml b/Greenshot/Languages/language-sk-SK.xml index 47ed2b116..f47c2bd5b 100644 --- a/Greenshot/Languages/language-sk-SK.xml +++ b/Greenshot/Languages/language-sk-SK.xml @@ -5,7 +5,7 @@ Ak se vám Greenshot páči, uvítame vašu podporu: Greenshot je na GitHub Ikony z Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot je ÚPLNE BEZ ZÁRUKY. Toto je FREE software, a môžete ho distribuovať za určitých podmienok. Podrobnosti o GNU General Public License: O Greenshote diff --git a/Greenshot/Languages/language-sl-SI.xml b/Greenshot/Languages/language-sl-SI.xml index 5993e8c89..fd0dc2bc4 100644 --- a/Greenshot/Languages/language-sl-SI.xml +++ b/Greenshot/Languages/language-sl-SI.xml @@ -5,18 +5,18 @@ Če vam je Greenshot všeč nas prosim podprite: Greenshot gostuje pri GitHub Ikone: Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license) - Avtorske pravice (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom -Greenshot absolutno ne ponuja NOBENE GARANCIJE. Program je brezplačen in ga lahko distribuirate pod določenimi pogoji. + Avtorske pravice (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom +Greenshot absolutno ne ponuja NOBENE GARANCIJE. Program je brezplačen in ga lahko distribuirate pod določenimi pogoji. Licenčne podrobnosti GNU General Public License: O Greenshot-u Greenshot - revolucija zajema zaslonskih slik Zapri - Oprostite, program je izvedel nepričakovano napako. - -Dobra novica je, da nam lahko pomagate pri odpravi te napake. -Prosimo obiščite spodnji URL, prijavite napako (create bug) in prilepite vsebino opisa napake. - -Prosimo dopišite še razumljiv opis kako ste prišli do težave, da jo bomo lahko ponovili. + Oprostite, program je izvedel nepričakovano napako. + +Dobra novica je, da nam lahko pomagate pri odpravi te napake. +Prosimo obiščite spodnji URL, prijavite napako (create bug) in prilepite vsebino opisa napake. + +Prosimo dopišite še razumljiv opis kako ste prišli do težave, da jo bomo lahko ponovili. Pred objavo preverite tudi ali je napaka že prijavlja s strani kakšnega drugega uporabnika. Hvala :) Napaka Prekliči @@ -143,7 +143,7 @@ Pred objavo preverite tudi ali je napaka že prijavlja s strani kakšnega drugeg Outlook kot text Napaka Greenshot že teče! - Ne morem shraniti v {0}. + Ne morem shraniti v {0}. Prosim preverite pravice pisanja v ta direktorij. Datoteka "{0}" ne more biti odprta. Ne morem odpreti povezave '{0}'. @@ -235,8 +235,8 @@ Prosim preverite pravice pisanja v ta direktorij. Na voljo je nova verzija Greenshot-a! Ali želite prenesti Greenshot {0}? Prosimo počakajte - zajema se Internet Explorer... Opozorilo - Bližnjica "{0}" ne more biti registrirana. Težava je verjetno v tem, da nek drug program uporablja isto bližnjico ! Nastavite si drugo bližnjično tipko ali deaktivirajte bližnjice za ta program. - + Bližnjica "{0}" ne more biti registrirana. Težava je verjetno v tem, da nek drug program uporablja isto bližnjico ! Nastavite si drugo bližnjično tipko ali deaktivirajte bližnjice za ta program. + Vse funkcije Greenshota še vedno delujejo preko ikone za hitri zagon. Uporabi lastne barve Ohrani prosojnost diff --git a/Greenshot/Languages/language-sr-RS.xml b/Greenshot/Languages/language-sr-RS.xml index f26d84da6..6b624dd9c 100644 --- a/Greenshot/Languages/language-sr-RS.xml +++ b/Greenshot/Languages/language-sr-RS.xml @@ -5,7 +5,7 @@ Ако вам се свиђа Гриншот, помозите нам: Гриншот покреће Сорсфорџ (GitHub): Иконе су преузете из пакета „Fugue“ Јусуке Камијамане (лиценца Кријејтив комонс Ауторство 3.0) - Ауторска права © 2007–2020 Томас Браун, Џенс Клинџен, Робин Кром + Ауторска права © 2007–2021 Томас Браун, Џенс Клинџен, Робин Кром Гриншот се издаје БЕЗ ИКАКВЕ ГАРАНЦИЈЕ. Он је бесплатан програм, који можете да делите под одређеним условима. Више информација о ГНУ-овој општој јавној лиценци: О програму diff --git a/Greenshot/Languages/language-sv-SE.xml b/Greenshot/Languages/language-sv-SE.xml index dedd0b5ef..3fe2df709 100644 --- a/Greenshot/Languages/language-sv-SE.xml +++ b/Greenshot/Languages/language-sv-SE.xml @@ -5,7 +5,7 @@ Om du gillar Greenshot, så är du välkommen att stödja oss: Greenshots hemsida tillhandahålls av GitHub på Ikoner från "Yusuke Kamiyamane's Fugue icon set" (Creative Commons Attribution 3.0 license) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot lämnar ABSOLUT INGA GARANTIER. Detta är ett gratisprogram, och du får vidaredistribuera programmet under vissa villkor. Detaljer om "GNU General Public License": Om Greenshot diff --git a/Greenshot/Languages/language-tr-TR.xml b/Greenshot/Languages/language-tr-TR.xml index 16c5e94ed..b5a43f083 100644 --- a/Greenshot/Languages/language-tr-TR.xml +++ b/Greenshot/Languages/language-tr-TR.xml @@ -5,7 +5,7 @@ Greenshot'ı sevdiyseniz, bizi destekleyin: Greenshot GitHub üzerinde şu adreste barındırılmaktadır: Simgeler Yusuke Kamiyamane'nin Fugue simge setidir (Creative Commons Attribution 3.0 lisansı) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot HİÇ BİR GARANTİ vermez. Serbest bir yazılımdır ve belirli koşullar altında dağıtmakta serbestsiniz. GNU Genel Kamu Lisanslı hakkında daha fazla bilgi için: Greenshot Hakkında diff --git a/Greenshot/Languages/language-uk-UA.xml b/Greenshot/Languages/language-uk-UA.xml index 041d73095..850a5ea7f 100644 --- a/Greenshot/Languages/language-uk-UA.xml +++ b/Greenshot/Languages/language-uk-UA.xml @@ -5,7 +5,7 @@ Якщо Вам подобається Greenshot, можете підтримати нас: Greenshot розташовується на GitHub Набір піктограм Fugue від Yusuke Kamiyamane (ліцензія Creative Commons Attribution 3.0) - Авторство © 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Авторство © 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot постачається АБСОЛЮТНО БЕЗ ГАРАНТІЇ. Це вільне програмне забезпечення, Ви можете розповсюджувати його за певних умов. Подробиці Загальної Публічної Ліцензії GNU: Про Greenshot diff --git a/Greenshot/Languages/language-vi-VN.xml b/Greenshot/Languages/language-vi-VN.xml index 541513466..a4b1a73c2 100644 --- a/Greenshot/Languages/language-vi-VN.xml +++ b/Greenshot/Languages/language-vi-VN.xml @@ -5,7 +5,7 @@ Hãy ủng hộ nếu bạn thấy Greenshot hữu dụng: Greenshot được tài trợ bởi GitHub Dùng biểu tượng Fugue (Giấy phép Commons Attribution 3.0 license) : - Bản quyền (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Bản quyền (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot không đi kèm theo đảm bảo nào và được phân phối dưới giấy phép GNU General Public License. Giới thiệu Greenshot Greenshot - Công cụ chụp màn hình diff --git a/Greenshot/Languages/language-zh-CN.xml b/Greenshot/Languages/language-zh-CN.xml index 77519c498..7325fff33 100644 --- a/Greenshot/Languages/language-zh-CN.xml +++ b/Greenshot/Languages/language-zh-CN.xml @@ -5,7 +5,7 @@ 如果您喜欢这个软件,希望您可以捐助我们: Greenshot 托管在 GitHub 图标来源:Yusuke Kamiyamane的Fugue图标基于(Creative Commons Attribution 3.0 协议) - 版权所有 (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + 版权所有 (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom 作者不会对程序进行任何担保。 此程序为自由软件,您可以在遵守 GNU 通用公共许可协议下任意传播本软件。 关于 GNU 通用公共许可协议: diff --git a/Greenshot/Languages/language-zh-TW.xml b/Greenshot/Languages/language-zh-TW.xml index 320db2614..590ec8f05 100644 --- a/Greenshot/Languages/language-zh-TW.xml +++ b/Greenshot/Languages/language-zh-TW.xml @@ -5,7 +5,7 @@ 如果您喜歡 Greenshot,歡迎您支持我們: Greenshot 的主機在 GitHub 網址是 圖片來源: Yusuke Kamiyamane's Fugue 圖示集 (Creative Commons Attribution 3.0 授權) - Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom Greenshot 不對這個程式做任何擔保。 這個程式是自由軟體,您可以在 GNU General Public License 下任意散佈本軟體。 關於GNU General Public License 詳細資料: 關於 Greenshot diff --git a/Greenshot/Memento/AddElementMemento.cs b/Greenshot/Memento/AddElementMemento.cs index 980bb17b1..07b4f18d3 100644 --- a/Greenshot/Memento/AddElementMemento.cs +++ b/Greenshot/Memento/AddElementMemento.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Memento/AddElementsMemento.cs b/Greenshot/Memento/AddElementsMemento.cs index 91a4f4d56..1f73f2106 100644 --- a/Greenshot/Memento/AddElementsMemento.cs +++ b/Greenshot/Memento/AddElementsMemento.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/Memento/ChangeFieldHolderMemento.cs b/Greenshot/Memento/ChangeFieldHolderMemento.cs index fc94df076..225e8de20 100644 --- a/Greenshot/Memento/ChangeFieldHolderMemento.cs +++ b/Greenshot/Memento/ChangeFieldHolderMemento.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -55,18 +55,11 @@ namespace Greenshot.Memento public bool Merge(IMemento otherMemento) { - if (otherMemento is ChangeFieldHolderMemento other) - { - if (other._drawableContainer.Equals(_drawableContainer)) - { - if (other._fieldToBeChanged.Equals(_fieldToBeChanged)) - { - // Match, do not store anything as the initial state is what we want. - return true; - } - } - } - return false; + if (otherMemento is not ChangeFieldHolderMemento other) return false; + + if (!other._drawableContainer.Equals(_drawableContainer)) return false; + + return other._fieldToBeChanged.Equals(_fieldToBeChanged); } public IMemento Restore() diff --git a/Greenshot/Memento/DeleteElementMemento.cs b/Greenshot/Memento/DeleteElementMemento.cs index fd9e793b2..cf921713f 100644 --- a/Greenshot/Memento/DeleteElementMemento.cs +++ b/Greenshot/Memento/DeleteElementMemento.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -27,12 +27,12 @@ namespace Greenshot.Memento { /// The DeleteElementMemento makes it possible to undo deleting an element /// public class DeleteElementMemento : IMemento { - private IDrawableContainer drawableContainer; - private readonly Surface surface; + private IDrawableContainer _drawableContainer; + private readonly Surface _surface; public DeleteElementMemento(Surface surface, IDrawableContainer drawableContainer) { - this.surface = surface; - this.drawableContainer = drawableContainer; + _surface = surface; + _drawableContainer = drawableContainer; } public void Dispose() { @@ -40,12 +40,13 @@ namespace Greenshot.Memento { GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) { - if (disposing) { - if (drawableContainer != null) { - drawableContainer.Dispose(); - drawableContainer = null; - } + protected virtual void Dispose(bool disposing) + { + if (!disposing) return; + + if (_drawableContainer != null) { + _drawableContainer.Dispose(); + _drawableContainer = null; } } @@ -55,17 +56,17 @@ namespace Greenshot.Memento { public IMemento Restore() { // Before - drawableContainer.Invalidate(); + _drawableContainer.Invalidate(); - AddElementMemento oldState = new AddElementMemento(surface, drawableContainer); - surface.AddElement(drawableContainer, false); + var oldState = new AddElementMemento(_surface, _drawableContainer); + _surface.AddElement(_drawableContainer, false); // The container has a selected flag which represents the state at the moment it was deleted. - if (drawableContainer.Selected) { - surface.SelectElement(drawableContainer); + if (_drawableContainer.Selected) { + _surface.SelectElement(_drawableContainer); } // After - drawableContainer.Invalidate(); + _drawableContainer.Invalidate(); return oldState; } } diff --git a/Greenshot/Memento/DeleteElementsMemento.cs b/Greenshot/Memento/DeleteElementsMemento.cs index 98e3c63bf..33b0fe0ac 100644 --- a/Greenshot/Memento/DeleteElementsMemento.cs +++ b/Greenshot/Memento/DeleteElementsMemento.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -59,7 +59,7 @@ namespace Greenshot.Memento public IMemento Restore() { - AddElementsMemento oldState = new AddElementsMemento(_surface, _containerList); + var oldState = new AddElementsMemento(_surface, _containerList); _surface.AddElements(_containerList, false); // After _surface.Invalidate(); diff --git a/Greenshot/Memento/DrawableContainerBoundsChangeMemento.cs b/Greenshot/Memento/DrawableContainerBoundsChangeMemento.cs index 9d29ea05d..32870a88a 100644 --- a/Greenshot/Memento/DrawableContainerBoundsChangeMemento.cs +++ b/Greenshot/Memento/DrawableContainerBoundsChangeMemento.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -31,8 +31,8 @@ namespace Greenshot.Memento /// public class DrawableContainerBoundsChangeMemento : IMemento { - private readonly List _points = new List(); - private readonly List _sizes = new List(); + private readonly List _points = new(); + private readonly List _sizes = new(); private IDrawableContainerList _listOfdrawableContainer; private void StoreBounds() @@ -76,15 +76,14 @@ namespace Greenshot.Memento public bool Merge(IMemento otherMemento) { - if (otherMemento is DrawableContainerBoundsChangeMemento other) - { - if (ObjectExtensions.CompareLists(_listOfdrawableContainer, other._listOfdrawableContainer)) - { - // Lists are equal, as we have the state already we can ignore the new memento - return true; - } - } - return false; + if (otherMemento is not DrawableContainerBoundsChangeMemento other) return false; + + if (ObjectExtensions.CompareLists(_listOfdrawableContainer, other._listOfdrawableContainer)) + { + // Lists are equal, as we have the state already we can ignore the new memento + return true; + } + return false; } public IMemento Restore() diff --git a/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs b/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs index efece64d2..a20823878 100644 --- a/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs +++ b/Greenshot/Memento/SurfaceBackgroundChangeMemento.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -45,18 +45,19 @@ namespace Greenshot.Memento { Dispose(true); } - protected virtual void Dispose(bool disposing) { - if (disposing) { - if (_matrix != null) { - _matrix.Dispose(); - _matrix = null; - } - if (_image != null) { - _image.Dispose(); - _image = null; - } - _surface = null; + protected virtual void Dispose(bool disposing) + { + if (!disposing) return; + + if (_matrix != null) { + _matrix.Dispose(); + _matrix = null; } + if (_image != null) { + _image.Dispose(); + _image = null; + } + _surface = null; } public bool Merge(IMemento otherMemento) { diff --git a/Greenshot/Memento/TextChangeMemento.cs b/Greenshot/Memento/TextChangeMemento.cs index a15907adb..4971b8ff0 100644 --- a/Greenshot/Memento/TextChangeMemento.cs +++ b/Greenshot/Memento/TextChangeMemento.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -27,12 +27,12 @@ namespace Greenshot.Memento { /// The TextChangeMemento makes it possible to undo-redo an IDrawableContainer move /// public class TextChangeMemento : IMemento { - private TextContainer textContainer; - private readonly string oldText; + private TextContainer _textContainer; + private readonly string _oldText; public TextChangeMemento(TextContainer textContainer) { - this.textContainer = textContainer; - oldText = textContainer.Text; + _textContainer = textContainer; + _oldText = textContainer.Text; } public void Dispose() { @@ -41,27 +41,23 @@ namespace Greenshot.Memento { protected virtual void Dispose(bool disposing) { if (disposing) { - textContainer = null; + _textContainer = null; } } public bool Merge(IMemento otherMemento) { - if (otherMemento is TextChangeMemento other) { - if (other.textContainer.Equals(textContainer)) { - // Match, do not store anything as the initial state is what we want. - return true; - } - } - return false; + if (otherMemento is not TextChangeMemento other) return false; + + return other._textContainer.Equals(_textContainer); } public IMemento Restore() { // Before - textContainer.Invalidate(); - TextChangeMemento oldState = new TextChangeMemento(textContainer); - textContainer.ChangeText(oldText, false); + _textContainer.Invalidate(); + TextChangeMemento oldState = new TextChangeMemento(_textContainer); + _textContainer.ChangeText(_oldText, false); // After - textContainer.Invalidate(); + _textContainer.Invalidate(); return oldState; } } diff --git a/Greenshot/Processors/TitleFixProcessor.cs b/Greenshot/Processors/TitleFixProcessor.cs index 7c44e218e..7bcc59f01 100644 --- a/Greenshot/Processors/TitleFixProcessor.cs +++ b/Greenshot/Processors/TitleFixProcessor.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/Greenshot/releases/innosetup/scripts/products.pas b/Greenshot/releases/innosetup/scripts/products.pas index 3fa140e54..3335007e7 100644 --- a/Greenshot/releases/innosetup/scripts/products.pas +++ b/Greenshot/releases/innosetup/scripts/products.pas @@ -251,7 +251,7 @@ begin //if SuppressibleMsgBox(FmtMessage(CustomMessage('depdownload_msg'), [FmtMessage(downloadMessage, [''])]), mbConfirmation, MB_YESNO, IDYES) = IDNO then // Result := false //else if - if isxdl_DownloadFiles(StrToInt(ExpandConstant('{wizardhwnd}'))) = 0 then + if isxdl_DownloadFiles(StrToInt(ExpandConstant('{wizardhWnd}'))) = 0 then Result := false; end; end; diff --git a/Greenshot/releases/innosetup/setup.iss b/Greenshot/releases/innosetup/setup.iss index 7735af213..3195d1f55 100644 --- a/Greenshot/releases/innosetup/setup.iss +++ b/Greenshot/releases/innosetup/setup.iss @@ -85,7 +85,7 @@ Source: {#BaseDir}\GreenshotOCRCommand\{#BinDir}\GreenshotOCRCommand.exe; DestDi Source: {#BaseDir}\GreenshotOCRCommand\{#BinDir}\GreenshotOCRCommand.exe.config; DestDir: {app}\Plugins\GreenshotOCRPlugin; Components: plugins\ocr; Flags: overwritereadonly recursesubdirs ignoreversion replacesameversion; ;JIRA Plugin Source: {#BaseDir}\GreenshotJiraPlugin\{#BinDir}\GreenshotJiraPlugin.dll; DestDir: {app}\Plugins\GreenshotJiraPlugin; Components: plugins\jira; Flags: overwritereadonly recursesubdirs ignoreversion replacesameversion; -Source: {#BaseDir}\GreenshotJiraPlugin\{#BinDir}\Dapplo.Jira.dll; DestDir: {app}\Plugins\GreenshotJiraPlugin; Components: plugins\jira; Flags: overwritereadonly recursesubdirs ignoreversion replacesameversion; +Source: {#BaseDir}\GreenshotJiraPlugin\{#BinDir}\Dapplo.Jira*.dll; DestDir: {app}\Plugins\GreenshotJiraPlugin; Components: plugins\jira; Flags: overwritereadonly recursesubdirs ignoreversion replacesameversion; Source: {#BaseDir}\GreenshotJiraPlugin\Languages\language_jira*.xml; DestDir: {app}\Languages\Plugins\GreenshotJiraPlugin; Components: plugins\jira; Flags: overwritereadonly ignoreversion replacesameversion; ;Imgur Plugin Source: {#BaseDir}\GreenshotImgurPlugin\{#BinDir}\GreenshotImgurPlugin.dll; DestDir: {app}\Plugins\GreenshotImgurPlugin; Components: plugins\imgur; Flags: overwritereadonly recursesubdirs ignoreversion replacesameversion; @@ -133,7 +133,7 @@ DefaultGroupName={#ExeName} InfoBeforeFile=..\additional_files\readme.txt LicenseFile=..\additional_files\license.txt LanguageDetectionMethod=uilanguage -MinVersion=6.1.7600 +MinVersion=6.1sp1 OutputBaseFilename={#ExeName}-INSTALLER-{#Version}-UNSTABLE OutputDir=..\ PrivilegesRequired=lowest diff --git a/GreenshotBoxPlugin/BoxConfiguration.cs b/GreenshotBoxPlugin/BoxConfiguration.cs index 27ac67676..b8e9e0965 100644 --- a/GreenshotBoxPlugin/BoxConfiguration.cs +++ b/GreenshotBoxPlugin/BoxConfiguration.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -22,6 +22,7 @@ using System.Windows.Forms; using GreenshotPlugin.Core; using System; +using GreenshotBoxPlugin.Forms; using GreenshotPlugin.IniFile; namespace GreenshotBoxPlugin { diff --git a/GreenshotBoxPlugin/BoxDestination.cs b/GreenshotBoxPlugin/BoxDestination.cs index 8cdd53515..06402ca89 100644 --- a/GreenshotBoxPlugin/BoxDestination.cs +++ b/GreenshotBoxPlugin/BoxDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/GreenshotBoxPlugin/BoxEntities.cs b/GreenshotBoxPlugin/BoxEntities.cs index 23cc4a8c4..a1f1a5c61 100644 --- a/GreenshotBoxPlugin/BoxEntities.cs +++ b/GreenshotBoxPlugin/BoxEntities.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/GreenshotBoxPlugin/BoxPlugin.cs b/GreenshotBoxPlugin/BoxPlugin.cs index 4848c4df2..b15835063 100644 --- a/GreenshotBoxPlugin/BoxPlugin.cs +++ b/GreenshotBoxPlugin/BoxPlugin.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -45,13 +45,14 @@ namespace GreenshotBoxPlugin { GC.SuppressFinalize(this); } - protected void Dispose(bool disposing) { - if (disposing) { - if (_itemPlugInConfig != null) { - _itemPlugInConfig.Dispose(); - _itemPlugInConfig = null; - } - } + protected void Dispose(bool disposing) + { + if (!disposing) return; + + if (_itemPlugInConfig == null) return; + + _itemPlugInConfig.Dispose(); + _itemPlugInConfig = null; } /// diff --git a/GreenshotBoxPlugin/BoxUtils.cs b/GreenshotBoxPlugin/BoxUtils.cs index fb14aae29..7b4d50756 100644 --- a/GreenshotBoxPlugin/BoxUtils.cs +++ b/GreenshotBoxPlugin/BoxUtils.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/GreenshotBoxPlugin/Forms/BoxForm.cs b/GreenshotBoxPlugin/Forms/BoxForm.cs index 7083d89d0..1ab7aed75 100644 --- a/GreenshotBoxPlugin/Forms/BoxForm.cs +++ b/GreenshotBoxPlugin/Forms/BoxForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/GreenshotBoxPlugin/Forms/SettingsForm.Designer.cs b/GreenshotBoxPlugin/Forms/SettingsForm.Designer.cs index 385452002..556cfe413 100644 --- a/GreenshotBoxPlugin/Forms/SettingsForm.Designer.cs +++ b/GreenshotBoxPlugin/Forms/SettingsForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace GreenshotBoxPlugin { +namespace GreenshotBoxPlugin.Forms { partial class SettingsForm { /// /// Designer variable used to keep track of non-visual components. diff --git a/GreenshotBoxPlugin/Forms/SettingsForm.cs b/GreenshotBoxPlugin/Forms/SettingsForm.cs index 954dc13de..49e62fd17 100644 --- a/GreenshotBoxPlugin/Forms/SettingsForm.cs +++ b/GreenshotBoxPlugin/Forms/SettingsForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -19,9 +19,7 @@ * along with this program. If not, see . */ -using GreenshotBoxPlugin.Forms; - -namespace GreenshotBoxPlugin { +namespace GreenshotBoxPlugin.Forms { /// /// Description of PasswordRequestForm. /// diff --git a/GreenshotBoxPlugin/GreenshotBoxPlugin.Credentials.template b/GreenshotBoxPlugin/GreenshotBoxPlugin.Credentials.template index 253514e60..9ad35eced 100644 --- a/GreenshotBoxPlugin/GreenshotBoxPlugin.Credentials.template +++ b/GreenshotBoxPlugin/GreenshotBoxPlugin.Credentials.template @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/GreenshotBoxPlugin/LanguageKeys.cs b/GreenshotBoxPlugin/LanguageKeys.cs index 7019cdca2..6e757a01d 100644 --- a/GreenshotBoxPlugin/LanguageKeys.cs +++ b/GreenshotBoxPlugin/LanguageKeys.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/GreenshotBoxPlugin/Properties/AssemblyInfo.cs b/GreenshotBoxPlugin/Properties/AssemblyInfo.cs index ce75d8750..b6b19f1c8 100644 --- a/GreenshotBoxPlugin/Properties/AssemblyInfo.cs +++ b/GreenshotBoxPlugin/Properties/AssemblyInfo.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/GreenshotConfluencePlugin/Confluence.cs b/GreenshotConfluencePlugin/Confluence.cs index 3ccfce630..bb803602c 100644 --- a/GreenshotConfluencePlugin/Confluence.cs +++ b/GreenshotConfluencePlugin/Confluence.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -18,15 +18,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; using System.Windows.Forms; -using GreenshotConfluencePlugin; using GreenshotConfluencePlugin.confluence; using GreenshotPlugin.Core; using GreenshotPlugin.IniFile; -namespace Confluence { +namespace GreenshotConfluencePlugin { public class Page { public Page(RemotePage page) { Id = page.id; diff --git a/GreenshotConfluencePlugin/ConfluenceConfiguration.cs b/GreenshotConfluencePlugin/ConfluenceConfiguration.cs index a62dcbf38..5a3e7019c 100644 --- a/GreenshotConfluencePlugin/ConfluenceConfiguration.cs +++ b/GreenshotConfluencePlugin/ConfluenceConfiguration.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/GreenshotConfluencePlugin/ConfluenceDestination.cs b/GreenshotConfluencePlugin/ConfluenceDestination.cs index 63bf60f01..d7794989a 100644 --- a/GreenshotConfluencePlugin/ConfluenceDestination.cs +++ b/GreenshotConfluencePlugin/ConfluenceDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -25,7 +25,6 @@ using System.Drawing; using System.IO; using System.Threading; using System.Windows; -using Confluence; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; using GreenshotPlugin.IniFile; @@ -129,7 +128,7 @@ namespace GreenshotConfluencePlugin { bool openPage = (_page == null) && ConfluenceConfig.OpenPageAfterUpload; string filename = FilenameHelper.GetFilenameWithoutExtensionFromPattern(CoreConfig.OutputFileFilenamePattern, captureDetails); if (selectedPage == null) { - ConfluenceUpload confluenceUpload = new ConfluenceUpload(filename); + Forms.ConfluenceUpload confluenceUpload = new Forms.ConfluenceUpload(filename); bool? dialogResult = confluenceUpload.ShowDialog(); if (dialogResult.HasValue && dialogResult.Value) { selectedPage = confluenceUpload.SelectedPage; diff --git a/GreenshotConfluencePlugin/ConfluencePlugin.cs b/GreenshotConfluencePlugin/ConfluencePlugin.cs index 78680f24a..f0014f221 100644 --- a/GreenshotConfluencePlugin/ConfluencePlugin.cs +++ b/GreenshotConfluencePlugin/ConfluencePlugin.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -19,14 +19,14 @@ * along with this program. If not, see . */ -using Confluence; using GreenshotPlugin.Core; using System; using System.Windows; +using GreenshotConfluencePlugin.Forms; +using GreenshotConfluencePlugin.Support; using GreenshotPlugin.IniFile; using GreenshotPlugin.Interfaces; using GreenshotPlugin.Interfaces.Plugin; -using TranslationByMarkupExtension; namespace GreenshotConfluencePlugin { /// diff --git a/GreenshotConfluencePlugin/ConfluenceUtils.cs b/GreenshotConfluencePlugin/ConfluenceUtils.cs index 7c9e84b00..ccb808a0f 100644 --- a/GreenshotConfluencePlugin/ConfluenceUtils.cs +++ b/GreenshotConfluencePlugin/ConfluenceUtils.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot @@ -33,8 +33,8 @@ namespace GreenshotConfluencePlugin { public class ConfluenceUtils { private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ConfluenceUtils)); - public static List GetCurrentPages() { - List pages = new List(); + public static List GetCurrentPages() { + List pages = new List(); Regex pageIdRegex = new Regex(@"pageId=(\d+)"); Regex spacePageRegex = new Regex(@"\/display\/([^\/]+)\/([^#]+)"); foreach(string browserurl in GetBrowserUrls()) { @@ -50,7 +50,7 @@ namespace GreenshotConfluencePlugin { long pageId = long.Parse(pageIdMatch[0].Groups[1].Value); try { bool pageDouble = false; - foreach(Confluence.Page page in pages) { + foreach(Page page in pages) { if (page.Id == pageId) { pageDouble = true; LOG.DebugFormat("Skipping double page with ID {0}", pageId); @@ -58,7 +58,7 @@ namespace GreenshotConfluencePlugin { } } if (!pageDouble) { - Confluence.Page page = ConfluencePlugin.ConfluenceConnector.GetPage(pageId); + Page page = ConfluencePlugin.ConfluenceConnector.GetPage(pageId); LOG.DebugFormat("Adding page {0}", page.Title); pages.Add(page); } @@ -82,7 +82,7 @@ namespace GreenshotConfluencePlugin { } try { bool pageDouble = false; - foreach(Confluence.Page page in pages) { + foreach(Page page in pages) { if (page.Title.Equals(title)) { LOG.DebugFormat("Skipping double page with title {0}", title); pageDouble = true; @@ -90,7 +90,7 @@ namespace GreenshotConfluencePlugin { } } if (!pageDouble) { - Confluence.Page page = ConfluencePlugin.ConfluenceConnector.GetPage(space, title); + Page page = ConfluencePlugin.ConfluenceConnector.GetPage(space, title); LOG.DebugFormat("Adding page {0}", page.Title); pages.Add(page); diff --git a/GreenshotConfluencePlugin/EnumDisplayer.cs b/GreenshotConfluencePlugin/EnumDisplayer.cs index 2e4ded768..84ca2925e 100644 --- a/GreenshotConfluencePlugin/EnumDisplayer.cs +++ b/GreenshotConfluencePlugin/EnumDisplayer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2021 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot diff --git a/GreenshotConfluencePlugin/Forms/ConfluenceConfigurationForm.xaml b/GreenshotConfluencePlugin/Forms/ConfluenceConfigurationForm.xaml index b22e55d9b..c6b6b48a6 100644 --- a/GreenshotConfluencePlugin/Forms/ConfluenceConfigurationForm.xaml +++ b/GreenshotConfluencePlugin/Forms/ConfluenceConfigurationForm.xaml @@ -1,33 +1,33 @@ - + xmlns:gsc="clr-namespace:GreenshotPlugin.Core;assembly=GreenshotPlugin" + xmlns:support="clr-namespace:GreenshotConfluencePlugin.Support" + Title="{support:Translate plugin_settings}" SizeToContent="WidthAndHeight" ResizeMode="NoResize" Icon="/GreenshotConfluencePlugin;component/Images/Confluence.ico"> - - - + + + - - - -