mirror of
https://github.com/greenshot/greenshot
synced 2025-08-22 22:34:27 -07:00
Renamed INetworkConfiguration to IHttpConfiguration
This commit is contained in:
parent
a65e2292b9
commit
ed90f2eb43
14 changed files with 46 additions and 46 deletions
|
@ -60,7 +60,7 @@ namespace Greenshot.Addon.Box
|
|||
private readonly IBoxConfiguration _boxConfiguration;
|
||||
private readonly IBoxLanguage _boxLanguage;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
private readonly INetworkConfiguration _networkConfiguration;
|
||||
private readonly IHttpConfiguration _httpConfiguration;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly OAuth2Settings _oauth2Settings;
|
||||
private static readonly Uri UploadFileUri = new Uri("https://upload.box.com/api/2.0/files/content");
|
||||
|
@ -73,14 +73,14 @@ namespace Greenshot.Addon.Box
|
|||
IBoxConfiguration boxConfiguration,
|
||||
IBoxLanguage boxLanguage,
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IHttpConfiguration httpConfiguration,
|
||||
IResourceProvider resourceProvider) : base(coreConfiguration, greenshotLanguage)
|
||||
{
|
||||
_exportNotification = exportNotification;
|
||||
_boxConfiguration = boxConfiguration;
|
||||
_boxLanguage = boxLanguage;
|
||||
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
||||
_networkConfiguration = networkConfiguration;
|
||||
_httpConfiguration = httpConfiguration;
|
||||
_resourceProvider = resourceProvider;
|
||||
|
||||
_oauth2Settings = new OAuth2Settings
|
||||
|
@ -187,7 +187,7 @@ namespace Greenshot.Addon.Box
|
|||
|
||||
var oauthHttpBehaviour = HttpBehaviour.Current.ShallowClone();
|
||||
// Use the network settings
|
||||
oauthHttpBehaviour.HttpSettings = _networkConfiguration;
|
||||
oauthHttpBehaviour.HttpSettings = _httpConfiguration;
|
||||
// Use UploadProgress
|
||||
if (progress != null)
|
||||
{
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace Greenshot.Addon.Dropbox
|
|||
public DropboxDestination(
|
||||
IDropboxConfiguration dropboxPluginConfiguration,
|
||||
IDropboxLanguage dropboxLanguage,
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IHttpConfiguration httpConfiguration,
|
||||
IResourceProvider resourceProvider,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
|
@ -108,7 +108,7 @@ namespace Greenshot.Addon.Dropbox
|
|||
|
||||
_oAuthHttpBehaviour = httpBehaviour;
|
||||
// Use the default network settings
|
||||
httpBehaviour.HttpSettings = networkConfiguration;
|
||||
httpBehaviour.HttpSettings = httpConfiguration;
|
||||
}
|
||||
|
||||
public override Bitmap DisplayIcon
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace Greenshot.Addon.Flickr
|
|||
public FlickrDestination(
|
||||
IFlickrConfiguration flickrConfiguration,
|
||||
IFlickrLanguage flickrLanguage,
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IHttpConfiguration httpConfiguration,
|
||||
IResourceProvider resourceProvider,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
|
@ -123,7 +123,7 @@ namespace Greenshot.Addon.Flickr
|
|||
_oAuthHttpBehaviour = OAuth1HttpBehaviourFactory.Create(_oAuthSettings);
|
||||
_oAuthHttpBehaviour.ValidateResponseContentType = false;
|
||||
// Use the default network settings
|
||||
_oAuthHttpBehaviour.HttpSettings = networkConfiguration;
|
||||
_oAuthHttpBehaviour.HttpSettings = httpConfiguration;
|
||||
}
|
||||
|
||||
public override string Description => _flickrLanguage.UploadMenuItem;
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace Greenshot.Addon.GooglePhotos
|
|||
private static readonly LogSource Log = new LogSource();
|
||||
private readonly IGooglePhotosConfiguration _googlePhotosConfiguration;
|
||||
private readonly IGooglePhotosLanguage _googlePhotosLanguage;
|
||||
private readonly INetworkConfiguration _networkConfiguration;
|
||||
private readonly IHttpConfiguration _httpConfiguration;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly ExportNotification _exportNotification;
|
||||
private readonly Func<CancellationTokenSource, Owned<PleaseWaitForm>> _pleaseWaitFormFactory;
|
||||
|
@ -66,7 +66,7 @@ namespace Greenshot.Addon.GooglePhotos
|
|||
public GooglePhotosDestination(
|
||||
IGooglePhotosConfiguration googlePhotosConfiguration,
|
||||
IGooglePhotosLanguage googlePhotosLanguage,
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IHttpConfiguration httpConfiguration,
|
||||
IResourceProvider resourceProvider,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
|
@ -76,7 +76,7 @@ namespace Greenshot.Addon.GooglePhotos
|
|||
{
|
||||
_googlePhotosConfiguration = googlePhotosConfiguration;
|
||||
_googlePhotosLanguage = googlePhotosLanguage;
|
||||
_networkConfiguration = networkConfiguration;
|
||||
_httpConfiguration = httpConfiguration;
|
||||
_resourceProvider = resourceProvider;
|
||||
_exportNotification = exportNotification;
|
||||
_pleaseWaitFormFactory = pleaseWaitFormFactory;
|
||||
|
@ -178,7 +178,7 @@ namespace Greenshot.Addon.GooglePhotos
|
|||
string filename = surface.GenerateFilename(CoreConfiguration, _googlePhotosConfiguration);
|
||||
|
||||
var oAuthHttpBehaviour = HttpBehaviour.Current.ShallowClone();
|
||||
oAuthHttpBehaviour.HttpSettings = _networkConfiguration;
|
||||
oAuthHttpBehaviour.HttpSettings = _httpConfiguration;
|
||||
// Use UploadProgress
|
||||
if (progress != null)
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace Greenshot.Addon.Imgur
|
|||
public ImgurApi(
|
||||
IImgurConfiguration imgurConfiguration,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
INetworkConfiguration networkConfiguration)
|
||||
IHttpConfiguration httpConfiguration)
|
||||
{
|
||||
_imgurConfiguration = imgurConfiguration;
|
||||
_coreConfiguration = coreConfiguration;
|
||||
|
@ -88,7 +88,7 @@ namespace Greenshot.Addon.Imgur
|
|||
|
||||
Behaviour = new HttpBehaviour
|
||||
{
|
||||
HttpSettings = networkConfiguration,
|
||||
HttpSettings = httpConfiguration,
|
||||
JsonSerializer = new JsonNetJsonSerializer(),
|
||||
OnHttpClientCreated = httpClient =>
|
||||
{
|
||||
|
|
|
@ -66,13 +66,13 @@ namespace Greenshot.Addon.Jira
|
|||
IJiraConfiguration jiraConfiguration,
|
||||
JiraMonitor jiraMonitor,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
INetworkConfiguration networkConfiguration)
|
||||
IHttpConfiguration httpConfiguration)
|
||||
{
|
||||
jiraConfiguration.Url = jiraConfiguration.Url.Replace(DefaultPostfix, "");
|
||||
_jiraConfiguration = jiraConfiguration;
|
||||
_jiraMonitor = jiraMonitor;
|
||||
_coreConfiguration = coreConfiguration;
|
||||
_jiraClient = JiraClient.Create(new Uri(jiraConfiguration.Url), networkConfiguration);
|
||||
_jiraClient = JiraClient.Create(new Uri(jiraConfiguration.Url), httpConfiguration);
|
||||
}
|
||||
|
||||
public Bitmap FavIcon { get; private set; }
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace Greenshot.Addon.OneDrive
|
|||
public OneDriveDestination(
|
||||
IOneDriveConfiguration oneDriveConfiguration,
|
||||
IOneDriveLanguage oneDriveLanguage,
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IHttpConfiguration httpConfiguration,
|
||||
IResourceProvider resourceProvider,
|
||||
Func<CancellationTokenSource, Owned<PleaseWaitForm>> pleaseWaitFormFactory,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
|
@ -109,7 +109,7 @@ namespace Greenshot.Addon.OneDrive
|
|||
};
|
||||
_oneDriveHttpBehaviour = new HttpBehaviour
|
||||
{
|
||||
HttpSettings = networkConfiguration,
|
||||
HttpSettings = httpConfiguration,
|
||||
JsonSerializer = new JsonNetJsonSerializer()
|
||||
};
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace Greenshot.Addon.Photobucket
|
|||
private readonly string _albumPath;
|
||||
private readonly IPhotobucketConfiguration _photobucketConfiguration;
|
||||
private readonly IPhotobucketLanguage _photobucketLanguage;
|
||||
private readonly INetworkConfiguration _networkConfiguration;
|
||||
private readonly IHttpConfiguration _httpConfiguration;
|
||||
private readonly IResourceProvider _resourceProvider;
|
||||
private readonly ExportNotification _exportNotification;
|
||||
private readonly OAuth1Settings _oAuthSettings;
|
||||
|
@ -69,7 +69,7 @@ namespace Greenshot.Addon.Photobucket
|
|||
public PhotobucketDestination(
|
||||
IPhotobucketConfiguration photobucketConfiguration,
|
||||
IPhotobucketLanguage photobucketLanguage,
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IHttpConfiguration httpConfiguration,
|
||||
IResourceProvider resourceProvider,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
|
@ -78,7 +78,7 @@ namespace Greenshot.Addon.Photobucket
|
|||
{
|
||||
_photobucketConfiguration = photobucketConfiguration;
|
||||
_photobucketLanguage = photobucketLanguage;
|
||||
_networkConfiguration = networkConfiguration;
|
||||
_httpConfiguration = httpConfiguration;
|
||||
_resourceProvider = resourceProvider;
|
||||
_exportNotification = exportNotification;
|
||||
|
||||
|
@ -105,7 +105,7 @@ namespace Greenshot.Addon.Photobucket
|
|||
CheckVerifier = false
|
||||
};
|
||||
var oAuthHttpBehaviour = OAuth1HttpBehaviourFactory.Create(_oAuthSettings);
|
||||
oAuthHttpBehaviour.HttpSettings = networkConfiguration;
|
||||
oAuthHttpBehaviour.HttpSettings = httpConfiguration;
|
||||
// Store the leftover values
|
||||
oAuthHttpBehaviour.OnAccessTokenValues = values =>
|
||||
{
|
||||
|
@ -144,12 +144,12 @@ namespace Greenshot.Addon.Photobucket
|
|||
protected PhotobucketDestination(
|
||||
IPhotobucketConfiguration photobucketConfiguration,
|
||||
IPhotobucketLanguage photobucketLanguage,
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IHttpConfiguration httpConfiguration,
|
||||
IResourceProvider resourceProvider,
|
||||
string albumPath,
|
||||
ICoreConfiguration coreConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage,
|
||||
ExportNotification exportNotification) : this(photobucketConfiguration, photobucketLanguage, networkConfiguration, resourceProvider, coreConfiguration, greenshotLanguage, exportNotification)
|
||||
ExportNotification exportNotification) : this(photobucketConfiguration, photobucketLanguage, httpConfiguration, resourceProvider, coreConfiguration, greenshotLanguage, exportNotification)
|
||||
{
|
||||
_photobucketConfiguration = photobucketConfiguration;
|
||||
_albumPath = albumPath;
|
||||
|
@ -204,7 +204,7 @@ namespace Greenshot.Addon.Photobucket
|
|||
yield return new PhotobucketDestination(
|
||||
_photobucketConfiguration,
|
||||
_photobucketLanguage,
|
||||
_networkConfiguration,
|
||||
_httpConfiguration,
|
||||
_resourceProvider,
|
||||
album,
|
||||
CoreConfiguration,
|
||||
|
|
|
@ -51,14 +51,14 @@ namespace Greenshot.Addon.Tfs
|
|||
public TfsClient(
|
||||
ICoreConfiguration coreConfiguration,
|
||||
ITfsConfiguration tfsConfiguration,
|
||||
INetworkConfiguration networkConfiguration)
|
||||
IHttpConfiguration httpConfiguration)
|
||||
{
|
||||
_coreConfiguration = coreConfiguration;
|
||||
_tfsConfiguration = tfsConfiguration;
|
||||
|
||||
_tfsHttpBehaviour = new HttpBehaviour
|
||||
{
|
||||
HttpSettings = networkConfiguration,
|
||||
HttpSettings = httpConfiguration,
|
||||
JsonSerializer = new JsonNetJsonSerializer()
|
||||
};
|
||||
|
||||
|
|
|
@ -54,8 +54,8 @@ namespace Greenshot.Addons
|
|||
.SingleInstance();
|
||||
|
||||
builder
|
||||
.Register(context => IniConfig.Current.Get<INetworkConfiguration>())
|
||||
.As<INetworkConfiguration>()
|
||||
.Register(context => IniConfig.Current.Get<IHttpConfiguration>())
|
||||
.As<IHttpConfiguration>()
|
||||
.SingleInstance();
|
||||
|
||||
builder
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace Greenshot.Addons.Core
|
|||
/// </summary>
|
||||
[IniSection("Network")]
|
||||
[Description("Greenshot network configuration")]
|
||||
public interface INetworkConfiguration : IIniSection, IHttpSettings, INotifyPropertyChanged, IWriteProtectProperties, IDefaultValue, ITransactionalProperties
|
||||
public interface IHttpConfiguration : IIniSection, IHttpSettings, INotifyPropertyChanged, IWriteProtectProperties, IDefaultValue, ITransactionalProperties
|
||||
{
|
||||
}
|
||||
}
|
|
@ -223,7 +223,7 @@
|
|||
<Compile Include="Core\ExplorerHelper.cs" />
|
||||
<Compile Include="Core\Enums\OutputFormats.cs" />
|
||||
<Compile Include="Core\Enums\WindowCaptureModes.cs" />
|
||||
<Compile Include="Core\INetworkConfiguration.cs" />
|
||||
<Compile Include="Core\IHttpConfiguration.cs" />
|
||||
<Compile Include="Core\IDestinationFileConfiguration.cs" />
|
||||
<Compile Include="Core\ImageOutput.cs" />
|
||||
<Compile Include="Core\InteropWindowExtensions.cs" />
|
||||
|
|
|
@ -38,16 +38,16 @@ namespace Greenshot.Ui.Configuration.ViewModels
|
|||
/// </summary>
|
||||
private CompositeDisposable _disposables;
|
||||
|
||||
public INetworkConfiguration NetworkConfiguration { get; }
|
||||
public IHttpConfiguration HttpConfiguration { get; }
|
||||
|
||||
public IGreenshotLanguage GreenshotLanguage { get; }
|
||||
|
||||
public NetworkConfigViewModel(
|
||||
INetworkConfiguration networkConfiguration,
|
||||
IHttpConfiguration httpConfiguration,
|
||||
IGreenshotLanguage greenshotLanguage
|
||||
)
|
||||
{
|
||||
NetworkConfiguration = networkConfiguration;
|
||||
HttpConfiguration = httpConfiguration;
|
||||
GreenshotLanguage = greenshotLanguage;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ namespace Greenshot.Ui.Configuration.ViewModels
|
|||
_disposables?.Dispose();
|
||||
|
||||
// Make sure Commit/Rollback is called on the IUiConfiguration
|
||||
config.Register(NetworkConfiguration);
|
||||
config.Register(HttpConfiguration);
|
||||
|
||||
this.VisibleOnPermissions("Expert");
|
||||
|
||||
|
|
|
@ -8,19 +8,19 @@
|
|||
d:DataContext="{d:DesignInstance viewModels:NetworkConfigViewModel,IsDesignTimeCreatable=False}"
|
||||
>
|
||||
<StackPanel>
|
||||
<CheckBox Content="Allow auto redirect" IsChecked="{Binding NetworkConfiguration.AllowAutoRedirect}" />
|
||||
<CheckBox Content="Allow pipelining" IsChecked="{Binding NetworkConfiguration.AllowPipelining}" />
|
||||
<CheckBox Content="Ignore SSL certificate errors" IsChecked="{Binding NetworkConfiguration.IgnoreSslCertificateErrors}" />
|
||||
<CheckBox Content="Pre authenticate" IsChecked="{Binding NetworkConfiguration.PreAuthenticate}" />
|
||||
<CheckBox Content="Expect 100 continue" IsChecked="{Binding NetworkConfiguration.Expect100Continue}" />
|
||||
<CheckBox Content="Use cookies" IsChecked="{Binding NetworkConfiguration.UseCookies}" />
|
||||
<CheckBox Content="Use default credentials" IsChecked="{Binding NetworkConfiguration.UseDefaultCredentials}" />
|
||||
<CheckBox Content="Use default proxy" IsChecked="{Binding NetworkConfiguration.UseDefaultProxy}" />
|
||||
<CheckBox Content="Use proxy" IsChecked="{Binding NetworkConfiguration.UseProxy}" />
|
||||
<CheckBox Content="Use default credentials for proxy" IsChecked="{Binding NetworkConfiguration.UseDefaultCredentialsForProxy}" />
|
||||
<CheckBox Content="Allow auto redirect" IsChecked="{Binding HttpConfiguration.AllowAutoRedirect}" />
|
||||
<CheckBox Content="Allow pipelining" IsChecked="{Binding HttpConfiguration.AllowPipelining}" />
|
||||
<CheckBox Content="Ignore SSL certificate errors" IsChecked="{Binding HttpConfiguration.IgnoreSslCertificateErrors}" />
|
||||
<CheckBox Content="Pre authenticate" IsChecked="{Binding HttpConfiguration.PreAuthenticate}" />
|
||||
<CheckBox Content="Expect 100 continue" IsChecked="{Binding HttpConfiguration.Expect100Continue}" />
|
||||
<CheckBox Content="Use cookies" IsChecked="{Binding HttpConfiguration.UseCookies}" />
|
||||
<CheckBox Content="Use default credentials" IsChecked="{Binding HttpConfiguration.UseDefaultCredentials}" />
|
||||
<CheckBox Content="Use default proxy" IsChecked="{Binding HttpConfiguration.UseDefaultProxy}" />
|
||||
<CheckBox Content="Use proxy" IsChecked="{Binding HttpConfiguration.UseProxy}" />
|
||||
<CheckBox Content="Use default credentials for proxy" IsChecked="{Binding HttpConfiguration.UseDefaultCredentialsForProxy}" />
|
||||
<DockPanel LastChildFill="True">
|
||||
<Label Content="DefaultUseAgent" Width="100" />
|
||||
<TextBox Text="{Binding NetworkConfiguration.DefaultUserAgent}"></TextBox>
|
||||
<TextBox Text="{Binding HttpConfiguration.DefaultUserAgent}"></TextBox>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue