mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-30 23:34:09 +02:00
Fix file type description in Save image dialog
This commit is contained in:
parent
b1ef00746f
commit
cb24a859f4
@ -49,14 +49,14 @@ public static string GetImageLink(string url, ImageQuality quality){
|
|||||||
|
|
||||||
public static void DownloadImage(string url, ImageQuality quality){
|
public static void DownloadImage(string url, ImageQuality quality){
|
||||||
string file = BrowserUtils.GetFileNameFromUrl(ExtractImageBaseLink(url));
|
string file = BrowserUtils.GetFileNameFromUrl(ExtractImageBaseLink(url));
|
||||||
string ext = Path.GetExtension(file);
|
string ext = Path.GetExtension(file); // includes dot
|
||||||
|
|
||||||
using(SaveFileDialog dialog = new SaveFileDialog{
|
using(SaveFileDialog dialog = new SaveFileDialog{
|
||||||
AutoUpgradeEnabled = true,
|
AutoUpgradeEnabled = true,
|
||||||
OverwritePrompt = true,
|
OverwritePrompt = true,
|
||||||
Title = "Save image",
|
Title = "Save image",
|
||||||
FileName = file,
|
FileName = file,
|
||||||
Filter = "Image ("+(string.IsNullOrEmpty(ext) ? "unknown" : ext)+")|*.*"
|
Filter = string.IsNullOrEmpty(ext) ? "Image (unknown)|*.*" : $"Image (*{ext})|*{ext}"
|
||||||
}){
|
}){
|
||||||
if (dialog.ShowDialog() == DialogResult.OK){
|
if (dialog.ShowDialog() == DialogResult.OK){
|
||||||
BrowserUtils.DownloadFileAsync(GetImageLink(url, quality), dialog.FileName, null, ex => {
|
BrowserUtils.DownloadFileAsync(GetImageLink(url, quality), dialog.FileName, null, ex => {
|
||||||
|
Loading…
Reference in New Issue
Block a user