mirror of
https://github.com/greenshot/greenshot
synced 2025-07-14 17:13:44 -07:00
First code analysis changes, this "should" make Greenshot more stable and implement things as is supposed.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2481 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
3f4d93f2b6
commit
a394904aa3
64 changed files with 514 additions and 343 deletions
|
@ -406,22 +406,23 @@ namespace GreenshotPlugin.Core {
|
|||
/// <returns>Path to filename</returns>
|
||||
public static string SaveWithDialog(ISurface surface, ICaptureDetails captureDetails) {
|
||||
string returnValue = null;
|
||||
SaveImageFileDialog saveImageFileDialog = new SaveImageFileDialog(captureDetails);
|
||||
DialogResult dialogResult = saveImageFileDialog.ShowDialog();
|
||||
if (dialogResult.Equals(DialogResult.OK)) {
|
||||
try {
|
||||
string fileNameWithExtension = saveImageFileDialog.FileNameWithExtension;
|
||||
SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(FormatForFilename(fileNameWithExtension));
|
||||
if (conf.OutputFilePromptQuality) {
|
||||
QualityDialog qualityDialog = new QualityDialog(outputSettings);
|
||||
qualityDialog.ShowDialog();
|
||||
using (SaveImageFileDialog saveImageFileDialog = new SaveImageFileDialog(captureDetails)) {
|
||||
DialogResult dialogResult = saveImageFileDialog.ShowDialog();
|
||||
if (dialogResult.Equals(DialogResult.OK)) {
|
||||
try {
|
||||
string fileNameWithExtension = saveImageFileDialog.FileNameWithExtension;
|
||||
SurfaceOutputSettings outputSettings = new SurfaceOutputSettings(FormatForFilename(fileNameWithExtension));
|
||||
if (conf.OutputFilePromptQuality) {
|
||||
QualityDialog qualityDialog = new QualityDialog(outputSettings);
|
||||
qualityDialog.ShowDialog();
|
||||
}
|
||||
// TODO: For now we always overwrite, should be changed
|
||||
ImageOutput.Save(surface, fileNameWithExtension, true, outputSettings, conf.OutputFileCopyPathToClipboard);
|
||||
returnValue = fileNameWithExtension;
|
||||
IniConfig.Save();
|
||||
} catch (System.Runtime.InteropServices.ExternalException) {
|
||||
MessageBox.Show(Language.GetFormattedString("error_nowriteaccess", saveImageFileDialog.FileName).Replace(@"\\", @"\"), Language.GetString("error"));
|
||||
}
|
||||
// TODO: For now we always overwrite, should be changed
|
||||
ImageOutput.Save(surface, fileNameWithExtension, true, outputSettings, conf.OutputFileCopyPathToClipboard);
|
||||
returnValue = fileNameWithExtension;
|
||||
IniConfig.Save();
|
||||
} catch (System.Runtime.InteropServices.ExternalException) {
|
||||
MessageBox.Show(Language.GetFormattedString("error_nowriteaccess", saveImageFileDialog.FileName).Replace(@"\\", @"\"), Language.GetString("error"));
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue