mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Refactorings for the new IniConfig
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@853 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
232fd4e33d
commit
14b0863bcd
34 changed files with 338 additions and 499 deletions
|
@ -72,10 +72,7 @@ namespace GreenshotConfluencePlugin {
|
|||
/// Implementation of the IPlugin.Configure
|
||||
/// </summary>
|
||||
public virtual void Configure() {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendLine("This plugin doesn't have a configuration screen.");
|
||||
stringBuilder.AppendLine("Configuration is stored at: " + Path.Combine(host.ConfigurationPath, ConfluenceConnector.CONFIG_FILENAME));
|
||||
MessageBox.Show(stringBuilder.ToString());
|
||||
IniConfig.GetIniSection<ConfluenceConfiguration>().ShowConfigDialog();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -110,21 +107,21 @@ namespace GreenshotConfluencePlugin {
|
|||
IImageEditor imageEditor = (IImageEditor)item.Tag;
|
||||
|
||||
ConfluenceForm confluenceForm = new ConfluenceForm(confluenceConnector);
|
||||
confluenceForm.setFilename(host.GetFilename("png", imageEditor.CaptureDetails));
|
||||
confluenceForm.setFilename(host.GetFilename(OutputFormat.Png, imageEditor.CaptureDetails));
|
||||
DialogResult result = confluenceForm.ShowDialog();
|
||||
if (result == DialogResult.OK) {
|
||||
using (MemoryStream stream = new MemoryStream()) {
|
||||
imageEditor.SaveToStream(stream, "PNG", 100);
|
||||
imageEditor.SaveToStream(stream, OutputFormat.Png, 100);
|
||||
byte [] buffer = stream.GetBuffer();
|
||||
try {
|
||||
confluenceForm.upload(buffer);
|
||||
LOG.Debug("Uploaded to Confluence.");
|
||||
MessageBox.Show(lang.GetString(LangKey.upload_success));
|
||||
} catch(Exception e) {
|
||||
MessageBox.Show(lang.GetString(LangKey.upload_failure) + " " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG.Debug("Uploaded to Confluence.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue