extracted imgur credentials to another class

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2047 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
JKlingen 2012-09-16 22:09:26 +00:00
commit ef4b1344e5
3 changed files with 28 additions and 5 deletions

View file

@ -14,7 +14,7 @@
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@ -68,6 +68,7 @@
<Compile Include="Forms\SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
<Compile Include="ImgurCredentials.cs" />
<Compile Include="ImgurDestination.cs" />
<Compile Include="ImgurInfo.cs" />
<Compile Include="ImgurPlugin.cs" />
@ -100,8 +101,18 @@
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<PreBuildEvent>"$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs"</PreBuildEvent>
<PostBuildEvent>mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
<PreBuildEvent>"$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs"
if exist "$(ProjectDir)ImgurCredentials.private.cs" (
rename "$(ProjectDir)ImgurCredentials.cs" "ImgurCredentials.orig.cs"
rename "$(ProjectDir)ImgurCredentials.private.cs" "ImgurCredentials.cs"
) else exit /b -1</PreBuildEvent>
<PostBuildEvent>if exist "$(ProjectDir)ImgurCredentials.orig.cs" (
rename "$(ProjectDir)ImgurCredentials.cs" "ImgurCredentials.private.cs"
rename "$(ProjectDir)ImgurCredentials.orig.cs" "ImgurCredentials.cs"
) else exit /b -1
mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\"</PostBuildEvent>

View file

@ -0,0 +1,12 @@
using System;
namespace GreenshotImgurPlugin {
/// <summary>
/// This class is merely a placeholder for the file keeping the API key and secret for imgur integration.
/// Copy this file to ImgurCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the Imgur plugin then.)
/// </summary>
public static class ImgurCredentials {
public static string CONSUMER_KEY = empty;
public static string CONSUMER_SECRET = empty;
}
}

View file

@ -150,8 +150,8 @@ namespace GreenshotImgurPlugin {
oAuth.AccessTokenUrl = "http://api.imgur.com/oauth/access_token";
oAuth.AuthorizeUrl = "http://api.imgur.com/oauth/authorize";
oAuth.RequestTokenUrl = "http://api.imgur.com/oauth/request_token";
oAuth.ConsumerKey = fill in;
oAuth.ConsumerSecret = fill in;
oAuth.ConsumerKey = ImgurCredentials.CONSUMER_KEY;
oAuth.ConsumerSecret = ImgurCredentials.CONSUMER_SECRET;
oAuth.UserAgent = "Greenshot";
if (string.IsNullOrEmpty(config.ImgurToken)) {
LOG.Debug("Creating Imgur Token");