Preparations for RC5, removed all the non 1.0 plug-ins out and the 1.0 in.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2184 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-10-21 15:19:59 +00:00
parent f421d468b6
commit 3358352303
131 changed files with 3209 additions and 3186 deletions

View file

@ -47,4 +47,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.4.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

View file

@ -18,13 +18,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotOCRPlugin", "..\Gr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotOCRCommand", "..\GreenshotOCRCommand\GreenshotOCRCommand.csproj", "{D61E6ECE-E0B6-4467-B492-F08A06BA8F02}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotBoxPlugin", "..\..\Greenshot-Plugins\GreenshotBoxPlugin\GreenshotBoxPlugin.csproj", "{697CF066-9077-4F22-99D9-D989CCE7282B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotBoxPlugin", "..\GreenshotBoxPlugin\GreenshotBoxPlugin.csproj", "{697CF066-9077-4F22-99D9-D989CCE7282B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotDropboxPlugin", "..\..\Greenshot-Plugins\GreenshotDropboxPlugin\GreenshotDropboxPlugin.csproj", "{AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotDropboxPlugin", "..\GreenshotDropboxPlugin\GreenshotDropboxPlugin.csproj", "{AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotFlickrPlugin", "..\..\Greenshot-Plugins\GreenshotFlickrPlugin\GreenshotFlickrPlugin.csproj", "{7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotFlickrPlugin", "..\GreenshotFlickrPlugin\GreenshotFlickrPlugin.csproj", "{7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotPicasaPlugin", "..\..\Greenshot-Plugins\GreenshotPicasaPlugin\GreenshotPicasaPlugin.csproj", "{1893A2E4-A78A-4713-A8E7-E70058DABEE0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotPicasaPlugin", "..\GreenshotPicasaPlugin\GreenshotPicasaPlugin.csproj", "{1893A2E4-A78A-4713-A8E7-E70058DABEE0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotOfficePlugin", "..\GreenshotOfficePlugin\GreenshotOfficePlugin.csproj", "{92599C09-FF29-4ABD-B6E6-C48ECD781BAB}"
EndProject

BIN
GreenshotBoxPlugin/Box.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -20,41 +20,37 @@
*/
using System.Windows.Forms;
using Greenshot.IniFile;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
namespace GreenshotImmioPlugin {
namespace GreenshotBoxPlugin {
/// <summary>
/// Description of ImmioConfiguration.
/// Description of ImgurConfiguration.
/// </summary>
[IniSection("Immio", Description="Greenshot Immio Plugin configuration")]
public class ImmioConfiguration : IniSection {
[IniSection("Box", Description = "Greenshot Box Plugin configuration")]
public class BoxConfiguration : IniSection {
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
public OutputFormat UploadFormat;
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
public int UploadJpegQuality;
[IniProperty("UploadReduceColors", Description="Reduce color amount of the uploaded image to 256", DefaultValue="False")]
public bool UploadReduceColors;
[IniProperty("UsePageLink", Description = "Use pagelink instead of direct link on the clipboard", DefaultValue = "False")]
public bool UsePageLink;
[IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send Box link to clipboard.", DefaultValue = "true")]
public bool AfterUploadLinkToClipBoard;
[IniProperty("BoxToken", Description = "Token.", DefaultValue = "")]
public string BoxToken;
/// <summary>
/// A form for username/password
/// A form for token
/// </summary>
/// <returns>bool true if OK was pressed, false if cancel</returns>
public bool ShowConfigDialog() {
SettingsForm settingsForm = null;
new PleaseWaitForm().ShowAndWait(ImmioPlugin.Attributes.Name, Language.GetString("immio", LangKey.communication_wait),
delegate() {
settingsForm = new SettingsForm(this);
}
);
DialogResult result = settingsForm.ShowDialog();
DialogResult result = new SettingsForm(this).ShowDialog();
if (result == DialogResult.OK) {
return true;
}
return false;
}
}
}

View file

@ -0,0 +1,31 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace GreenshotBoxPlugin {
/// <summary>
/// This class is merely a placeholder for the file keeping the API key and secret for Box integration.
/// Copy this file to BoxCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the plugin then.)
/// </summary>
public static class BoxCredentials {
public static string API_KEY = empty;
}
}

View file

@ -0,0 +1,31 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace GreenshotBoxPlugin {
/// <summary>
/// This class is merely a placeholder for the file keeping the API key and secret for Box integration.
/// Copy this file to BoxCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the plugin then.)
/// </summary>
public static class BoxCredentials {
public static string API_KEY = "gwjm9lx8df7y2xskay4f1yxkrakhgy7n";
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -24,44 +24,43 @@ using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
namespace GreenshotImmioPlugin {
/// <summary>
/// Description of ImmioDestination.
/// </summary>
public class ImmioDestination : AbstractDestination {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImmioDestination));
private static ImmioConfiguration config = IniConfig.GetIniSection<ImmioConfiguration>();
private ImmioPlugin plugin = null;
namespace GreenshotBoxPlugin {
public class BoxDestination : AbstractDestination {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BoxDestination));
private static BoxConfiguration config = IniConfig.GetIniSection<BoxConfiguration>();
public ImmioDestination(ImmioPlugin plugin) {
private BoxPlugin plugin = null;
public BoxDestination(BoxPlugin plugin) {
this.plugin = plugin;
}
public override string Designation {
get {
return "Immio";
return "Box";
}
}
public override string Description {
get {
return Language.GetString("immio", LangKey.upload_menu_item);
return Language.GetString("box", LangKey.upload_menu_item);
}
}
public override Image DisplayIcon {
get {
ComponentResourceManager resources = new ComponentResourceManager(typeof(ImmioPlugin));
return (Image)resources.GetObject("Immio");
ComponentResourceManager resources = new ComponentResourceManager(typeof(BoxPlugin));
return (Image)resources.GetObject("Box");
}
}
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
using (Image image = surface.GetImageForExport()) {
string uploadURL = null;
exportInformation.ExportMade = plugin.Upload(captureDetails, image, out uploadURL);
exportInformation.Uri = uploadURL;
string uploadUrl = plugin.Upload(captureDetails, image);
if (uploadUrl != null) {
exportInformation.ExportMade = true;
exportInformation.Uri = uploadUrl;
}
}
ProcessExport(exportInformation, surface);
return exportInformation;

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -24,47 +24,30 @@ using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using System.Threading;
using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
using CommunicatorAPI;
using System.Runtime.InteropServices;
namespace GreenshotOfficeCommunicatorPlugin {
namespace GreenshotBoxPlugin {
/// <summary>
/// This is the OfficeCommunicatorPlugin
/// This is the Box base code
/// </summary>
public class OfficeCommunicatorPlugin : IGreenshotPlugin {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OfficeCommunicatorPlugin));
public class BoxPlugin : IGreenshotPlugin {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BoxPlugin));
private static BoxConfiguration config;
public static PluginAttribute Attributes;
private OfficeCommunicatorConfiguration config = IniConfig.GetIniSection<OfficeCommunicatorConfiguration>();
private IGreenshotHost host;
private Communicator communicator;
public IGreenshotHost Host {
get {
return host;
}
}
private ComponentResourceManager resources;
public Communicator Communicator {
get {
return communicator;
}
set {
communicator = value;
}
}
public OfficeCommunicatorPlugin() {
public BoxPlugin() {
}
public IEnumerable<IDestination> Destinations() {
yield return new OfficeCommunicatorDestination(this);
yield return new BoxDestination(this);
}
public IEnumerable<IProcessor> Processors() {
yield break;
}
@ -73,20 +56,27 @@ namespace GreenshotOfficeCommunicatorPlugin {
/// Implementation of the IGreenshotPlugin.Initialize
/// </summary>
/// <param name="host">Use the IGreenshotPluginHost interface to register events</param>
/// <param name="captureHost">Use the ICaptureHost interface to register in the MainContextMenu</param>
/// <param name="pluginAttribute">My own attributes</param>
/// <returns>true if plugin is initialized, false if not (doesn't show)</returns>
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
this.host = (IGreenshotHost)pluginHost;
Attributes = myAttributes;
communicator = new Communicator();
communicator.Signin(null, null);
// Register configuration (don't need the configuration itself)
config = IniConfig.GetIniSection<BoxConfiguration>();
resources = new ComponentResourceManager(typeof(BoxPlugin));
ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem();
itemPlugInConfig.Image = (Image)resources.GetObject("Box");
itemPlugInConfig.Text = Language.GetString("box", LangKey.Configure);
itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick);
PluginUtils.AddToContextMenu(host, itemPlugInConfig);
return true;
}
public virtual void Shutdown() {
LOG.Debug("OfficeCommunicator Plugin shutdown.");
LOG.Debug("Box Plugin shutdown.");
}
/// <summary>
@ -102,8 +92,40 @@ namespace GreenshotOfficeCommunicatorPlugin {
/// <param name="sender"></param>
/// <param name="e"></param>
public void Closing(object sender, FormClosingEventArgs e) {
LOG.Debug("Application closing, de-registering OfficeCommunicator Plugin!");
LOG.Debug("Application closing, de-registering Box Plugin!");
Shutdown();
}
public void ConfigMenuClick(object sender, EventArgs eventArgs) {
config.ShowConfigDialog();
}
/// <summary>
/// This will be called when the menu item in the Editor is clicked
/// </summary>
public string Upload(ICaptureDetails captureDetails, Image image) {
OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, false);
try {
string url = null;
string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails));
ImageContainer imageToUpload = new ImageContainer(image, outputSettings, filename);
new PleaseWaitForm().ShowAndWait(BoxPlugin.Attributes.Name, Language.GetString("box", LangKey.communication_wait),
delegate() {
url = BoxUtils.UploadToBox(imageToUpload, captureDetails.Title, filename);
}
);
if (url != null && config.AfterUploadLinkToClipBoard) {
ClipboardHelper.SetClipboardData(url);
}
return url;
} catch (Exception ex) {
LOG.Error("Error uploading.", ex);
MessageBox.Show(Language.GetString("box", LangKey.upload_failure) + " " + ex.ToString());
return null;
}
}
}
}

View file

@ -117,15 +117,8 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="Immio" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAMVJREFUOE9jDA0J
ZSAJADW8ffeOSAQyHaJhzvHXaGjR6TdoCKgMi4Zzj79+/vH3Pxg8ePfz2cdfQBGgTqBx2DVAlKKB9Zfe
49QAlIOofvP1N9BsINp69QPEtdhtAEoAHbDi3FtMX+HUgKkUiw29m6e0rshsWORfO88WSLatyp+4fRqa
ThQbgKqBStuWO6ChpcdTFx+vXnh8IbofkFUvPOKDhhYciVlwtATFBojBmEqRRdA14FcNlEXRQFA1ugbS
Eh8wSRGPAL2C6QdnoO9oAAAAAElFTkSuQmCC
</value>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Box" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>box.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -0,0 +1,132 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Net;
using System.Xml;
using Greenshot.IniFile;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
namespace GreenshotBoxPlugin {
/// <summary>
/// Description of ImgurUtils.
/// </summary>
public class BoxUtils {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BoxUtils));
private static BoxConfiguration config = IniConfig.GetIniSection<BoxConfiguration>();
private BoxUtils() {
}
private static string ParseTicket(string response) {
try {
XmlDocument doc = new XmlDocument();
doc.LoadXml(response);
XmlNodeList nodes = doc.GetElementsByTagName("ticket");
if(nodes.Count > 0) {
return nodes.Item(0).InnerText;
}
} catch (Exception ex) {
LOG.Error("Error parsing Box Response.", ex);
}
return null;
}
private static bool Authorize() {
string ticketUrl = string.Format("https://www.box.com/api/1.0/rest?action=get_ticket&api_key={0}", BoxCredentials.API_KEY);
string ticketXML = NetworkHelper.GetAsString(new Uri(ticketUrl));
string ticket = ParseTicket(ticketXML);
string authorizeUrl = string.Format("https://www.box.com/api/1.0/auth/{0}", ticket);
OAuthLoginForm loginForm = new OAuthLoginForm("Box Authorize", new Size(1060,600), authorizeUrl, "http://getgreenshot.org");
loginForm.ShowDialog();
if (loginForm.isOk) {
if (loginForm.CallbackParameters != null && loginForm.CallbackParameters.ContainsKey("auth_token")) {
config.BoxToken = loginForm.CallbackParameters["auth_token"];
IniConfig.Save();
return true;
}
}
return false;
}
/// <summary>
/// Upload file by post
/// </summary>
/// <param name="url"></param>
/// <param name="parameters"></param>
/// <returns>response</returns>
public static string HttpUploadFile(string url, Dictionary<string, object> parameters) {
HttpWebRequest webRequest = (HttpWebRequest)NetworkHelper.CreateWebRequest(url);
webRequest.Method = "POST";
webRequest.KeepAlive = true;
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
NetworkHelper.WriteMultipartFormData(webRequest, parameters);
return NetworkHelper.GetResponse(webRequest);
}
/// <summary>
/// Do the actual upload to Box
/// For more details on the available parameters, see: http://developers.box.net/w/page/12923951/ApiFunction_Upload%20and%20Download
/// </summary>
/// <param name="imageData">byte[] with image data</param>
/// <returns>url to uploaded image</returns>
public static string UploadToBox(ImageContainer image, string title, string filename) {
string folderId = "0";
if (string.IsNullOrEmpty(config.BoxToken)) {
if (!Authorize()) {
return null;
}
}
string strUrl = string.Format("https://upload.box.net/api/1.0/upload/{0}/{1}?file_name={2}&new_copy=1", config.BoxToken, folderId, filename);
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("share", "1");
parameters.Add("new_file", image);
string response = HttpUploadFile(strUrl, parameters);
// Check if the token is wrong
if ("wrong auth token".Equals(response)) {
config.BoxToken = null;
IniConfig.Save();
return UploadToBox(image, title, filename);
}
LOG.DebugFormat("Box response: {0}", response);
XmlDocument doc = new XmlDocument();
doc.LoadXml(response);
XmlNodeList nodes = doc.GetElementsByTagName("status");
if(nodes.Count > 0) {
if ("upload_ok".Equals(nodes.Item(0).InnerText)) {
nodes = doc.GetElementsByTagName("file");
if (nodes.Count > 0) {
long id = long.Parse(nodes.Item(0).Attributes["id"].Value);
return string.Format("http://www.box.com/files/0/f/0/1/f_{0}", id);
}
}
}
return null;
}
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,14 +18,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using GreenshotPlugin.Controls;
namespace GreenshotOfficeCommunicatorPlugin {
/// <summary>
/// This class is needed for design-time resolving of the language files
/// </summary>
public class OfficeCommunicatorForm : GreenshotPlugin.Controls.GreenshotForm {
public OfficeCommunicatorForm() : base() {
}
namespace GreenshotBoxPlugin.Forms {
public class BoxForm : GreenshotForm {
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace GreenshotImmioPlugin {
namespace GreenshotBoxPlugin {
partial class SettingsForm {
/// <summary>
/// Designer variable used to keep track of non-visual components.
@ -50,70 +50,99 @@ namespace GreenshotImmioPlugin {
this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton();
this.combobox_uploadimageformat = new GreenshotPlugin.Controls.GreenshotComboBox();
this.label_upload_format = new GreenshotPlugin.Controls.GreenshotLabel();
this.label_AfterUpload = new GreenshotPlugin.Controls.GreenshotLabel();
this.checkboxAfterUploadLinkToClipBoard = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.LanguageKey = "immio.OK";
this.buttonOK.Location = new System.Drawing.Point(222, 88);
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(267, 72);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 2;
this.buttonOK.TabIndex = 12;
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOKClick);
//
// buttonCancel
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.LanguageKey = "immio.CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(303, 88);
this.buttonCancel.LanguageKey = "CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(348, 72);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 3;
this.buttonCancel.TabIndex = 13;
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// combobox_uploadimageformat
//
this.combobox_uploadimageformat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.combobox_uploadimageformat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.combobox_uploadimageformat.FormattingEnabled = true;
this.combobox_uploadimageformat.Location = new System.Drawing.Point(102, 7);
this.combobox_uploadimageformat.Location = new System.Drawing.Point(208, 12);
this.combobox_uploadimageformat.Name = "combobox_uploadimageformat";
this.combobox_uploadimageformat.PropertyName = "UploadFormat";
this.combobox_uploadimageformat.SectionName = "Immio";
this.combobox_uploadimageformat.Size = new System.Drawing.Size(276, 21);
this.combobox_uploadimageformat.TabIndex = 8;
this.combobox_uploadimageformat.SectionName = "Box";
this.combobox_uploadimageformat.Size = new System.Drawing.Size(215, 21);
this.combobox_uploadimageformat.TabIndex = 5;
//
// label_upload_format
//
this.label_upload_format.LanguageKey = "immio.label_upload_format";
this.label_upload_format.Location = new System.Drawing.Point(12, 10);
this.label_upload_format.LanguageKey = "box.label_upload_format";
this.label_upload_format.Location = new System.Drawing.Point(10, 12);
this.label_upload_format.Name = "label_upload_format";
this.label_upload_format.Size = new System.Drawing.Size(84, 20);
this.label_upload_format.TabIndex = 9;
this.label_upload_format.Size = new System.Drawing.Size(192, 20);
this.label_upload_format.TabIndex = 4;
//
// label_AfterUpload
//
this.label_AfterUpload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label_AfterUpload.LanguageKey = "box.label_AfterUpload";
this.label_AfterUpload.Location = new System.Drawing.Point(10, 46);
this.label_AfterUpload.Name = "label_AfterUpload";
this.label_AfterUpload.Size = new System.Drawing.Size(84, 21);
this.label_AfterUpload.TabIndex = 8;
//
// checkboxAfterUploadLinkToClipBoard
//
this.checkboxAfterUploadLinkToClipBoard.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkboxAfterUploadLinkToClipBoard.AutoSize = true;
this.checkboxAfterUploadLinkToClipBoard.LanguageKey = "box.label_AfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.Location = new System.Drawing.Point(208, 48);
this.checkboxAfterUploadLinkToClipBoard.Name = "checkboxAfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.PropertyName = "AfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.SectionName = "Box";
this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(15, 14);
this.checkboxAfterUploadLinkToClipBoard.TabIndex = 10;
this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true;
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(387, 123);
this.ClientSize = new System.Drawing.Size(432, 104);
this.Controls.Add(this.checkboxAfterUploadLinkToClipBoard);
this.Controls.Add(this.label_AfterUpload);
this.Controls.Add(this.label_upload_format);
this.Controls.Add(this.combobox_uploadimageformat);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.LanguageKey = "immio.settings_title";
this.LanguageKey = "box.settings_title";
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.ResumeLayout(false);
this.PerformLayout();
}
private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat;
private GreenshotPlugin.Controls.GreenshotLabel label_upload_format;
private GreenshotPlugin.Controls.GreenshotButton buttonCancel;
private GreenshotPlugin.Controls.GreenshotButton buttonOK;
private GreenshotPlugin.Controls.GreenshotLabel label_AfterUpload;
private GreenshotPlugin.Controls.GreenshotCheckBox checkboxAfterUploadLinkToClipBoard;
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -19,21 +19,26 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
using GreenshotPlugin.Core;
using GreenshotPlugin.Controls;
namespace GreenshotPhotobucketPlugin {
using GreenshotBoxPlugin.Forms;
using GreenshotPlugin.Core;
namespace GreenshotBoxPlugin {
/// <summary>
/// Description of PasswordRequestForm.
/// </summary>
public partial class SettingsForm : PhotobucketForm {
public SettingsForm(PhotobucketConfiguration config) : base() {
public partial class SettingsForm : BoxForm {
string boxTicket = string.Empty;
public SettingsForm(BoxConfiguration config) {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
void ButtonOKClick(object sender, EventArgs e) {

View file

@ -2,10 +2,10 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<PropertyGroup>
<ProjectGuid>{9C0ECC4C-7807-4111-916A-4F57BB29788A}</ProjectGuid>
<ProjectGuid>{697CF066-9077-4F22-99D9-D989CCE7282B}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>GreenshotPhotobucketPlugin</RootNamespace>
<AssemblyName>GreenshotPhotobucketPlugin</AssemblyName>
<RootNamespace>GreenshotBoxPlugin</RootNamespace>
<AssemblyName>GreenshotBoxPlugin</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -13,16 +13,14 @@
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<TargetFrameworkProfile />
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\Greenshot\Lib\log4net.dll</HintPath>
<HintPath>..\lib\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
@ -30,7 +28,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Forms\PhotobucketForm.cs">
<Compile Include="BoxConfiguration.cs" />
<Compile Include="BoxCredentials.cs" />
<Compile Include="BoxDestination.cs" />
<Compile Include="BoxPlugin.cs" />
<Compile Include="BoxUtils.cs" />
<Compile Include="Forms\BoxForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SettingsForm.cs">
@ -39,45 +42,47 @@
<Compile Include="Forms\SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
<Compile Include="PhotobucketDestination.cs" />
<Compile Include="PhotobucketInfo.cs" />
<Compile Include="PhotobucketPlugin.cs" />
<Compile Include="PhotobucketConfiguration.cs" />
<Compile Include="PhotobucketUtils.cs" />
<Compile Include="LanguageKeys.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="Languages\language_Photobucketplugin-de-DE.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_Photobucketplugin-en-US.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_Photobucketplugin-fr_FR.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_Photobucketplugin-nl-NL.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Languages\language_Photobucketplugin-zh-CN.xml" />
<None Include="Properties\AssemblyInfo.cs.template" />
<EmbeddedResource Include="PhotobucketPlugin.resx">
<DependentUpon>PhotobucketPlugin.cs</DependentUpon>
<EmbeddedResource Include="BoxPlugin.resx">
<DependentUpon>BoxPlugin.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj">
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<None Include="box.png" />
<Content Include="Languages\language_Boxplugin-en-US.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Greenshot\GreenshotPlugin\GreenshotPlugin.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>GreenshotPlugin</Name>
</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)"
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
<PostBuildEvent>if exist "$(ProjectDir)BoxCredentials.orig.cs" (
rename "$(ProjectDir)BoxCredentials.cs" "BoxCredentials.private.cs"
rename "$(ProjectDir)BoxCredentials.orig.cs" "BoxCredentials.cs"
) else exit /b -1
mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\"
mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\"</PostBuildEvent>
copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\"
</PostBuildEvent>
<PreBuildEvent>"$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs"
if exist "$(ProjectDir)BoxCredentials.private.cs" (
rename "$(ProjectDir)BoxCredentials.cs" "BoxCredentials.orig.cs"
rename "$(ProjectDir)BoxCredentials.private.cs" "BoxCredentials.cs"
) else exit /b -1</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<RegisterForComInterop>False</RegisterForComInterop>
@ -97,8 +102,8 @@ copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languag
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DebugType>None</DebugType>
<DebugSymbols>false</DebugSymbols>
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>TRACE</DefineConstants>

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,18 +18,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace GreenshotImmioPlugin {
namespace GreenshotBoxPlugin {
public enum LangKey {
upload_menu_item,
settings_title,
label_url,
label_upload_format,
OK,
CANCEL,
upload_success,
upload_failure,
communication_wait,
configure
Configure,
label_AfterUpload,
label_AfterUploadLinkToClipBoard
}
}

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="English" ietf="en-US" version="1.0.0">
<resources>
<resource name="label_AfterUploadLinkToClipBoard">
Link to clipboard
</resource>
<resource name="label_AfterUpload">
After upload
</resource>
<resource name="Configure">
Configure Box
</resource>
<resource name="upload_menu_item">
Upload to Box
</resource>
<resource name="settings_title">
Box settings
</resource>
<resource name="upload_success">
Successfully uploaded image to Box!
</resource>
<resource name="upload_failure">
An error occured while uploading to Box:
</resource>
<resource name="label_upload_format">
Image format
</resource>
<resource name="communication_wait">
Communicating with Box. Please wait...
</resource>
</resources>
</language>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Français" ietf="fr-FR" version="1.0.0" languagegroup="">
<resources>
<resource name="communication_wait">Communication en cours avec le service de stockage en ligne. Veuillez patientez...</resource>
<resource name="Configure">Configurer Box</resource>
<resource name="label_AfterUpload">Après téléversement</resource>
<resource name="label_AfterUploadLinkToClipBoard">Copier le lien dans le presse-papier</resource>
<resource name="label_upload_format">Format image</resource>
<resource name="settings_title">Paramètres du stockage en ligne</resource>
<resource name="upload_failure">Une erreur s'est produite lors du téléversement vers le stockage en ligne :</resource>
<resource name="upload_menu_item">Téléverser vers le stockage en ligne</resource>
<resource name="upload_success">Image téléversée aves succès vers le stockage en ligne !</resource>
</resources>
</language>

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Русский" ietf="ru-RU" version="1.0.0">
<resources>
<resource name="label_AfterUploadLinkToClipBoard">
Ссылка в буфер обмена
</resource>
<resource name="label_AfterUpload">
После загрузки
</resource>
<resource name="Configure">
Настройка Box
</resource>
<resource name="upload_menu_item">
Загрузить на Box
</resource>
<resource name="settings_title">
Параметры Box
</resource>
<resource name="upload_success">
Изображение успешно загружено на Box!
</resource>
<resource name="upload_failure">
Произошла ошибка при загрузке на Box:
</resource>
<resource name="label_upload_format">
Формат изображения
</resource>
<resource name="communication_wait">
Обмен данными с Box. Подождите...
</resource>
</resources>
</language>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Українська" version="1.0.0" ietf="uk-UA">
<resources>
<resource name="label_AfterUploadLinkToClipBoard">Посилання в буфер обміну</resource>
<resource name="label_AfterUpload">Після вивантаження</resource>
<resource name="Configure">Налаштувати Box</resource>
<resource name="upload_menu_item">Вивантажити на Box</resource>
<resource name="settings_title">Параметри Box</resource>
<resource name="upload_success">Зображення вдало вивантажено на Box!</resource>
<resource name="upload_failure">Відбулась помилка під час вивантаження на Box:</resource>
<resource name="label_upload_format">Формат зображення</resource>
<resource name="communication_wait">З’єднання з Box. Будь ласка, зачекайте...</resource>
</resources>
</language>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="简体中文" ietf="zh-CN" version="1.0.3" languagegroup="a">
<resources>
<resource name="communication_wait">正在连接Box。请稍后...</resource>
<resource name="Configure">配置Box</resource>
<resource name="label_AfterUpload">上传之后</resource>
<resource name="label_AfterUploadLinkToClipBoard">复制链接到剪贴板</resource>
<resource name="label_upload_format">图片格式</resource>
<resource name="settings_title">Box设置</resource>
<resource name="upload_failure">上传图片到Box时发生错误</resource>
<resource name="upload_menu_item">上传到Box</resource>
<resource name="upload_success">图片已成功上传到Box</resource>
</resources>
</language>

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -30,16 +30,16 @@ using Greenshot.Plugin;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot-Photobucket-Plugin")]
[assembly: AssemblyDescription("A plugin to upload images to Photobucket")]
[assembly: AssemblyTitle("Greenshot-Box-Plugin")]
[assembly: AssemblyDescription("A plugin to upload images to Box")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot")]
[assembly: AssemblyProduct("Photobucket Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2007-2012")]
[assembly: AssemblyCompany("Greenshot & F. Noel")]
[assembly: AssemblyProduct("Box Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The PluginAttribute describes the "entryType" and if the plugin is configurable
[assembly: PluginAttribute("GreenshotPhotobucketPlugin.PhotobucketPlugin", true)]
[assembly: PluginAttribute("GreenshotBoxPlugin.BoxPlugin", true)]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
@ -51,4 +51,4 @@ using Greenshot.Plugin;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.3.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="boxnetBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://box.net/api/1.0/soap" binding="basicHttpBinding" bindingConfiguration="boxnetBinding" contract="BoxNet.boxnetPort" name="boxnetPort" />
</client>
</system.serviceModel>
<startup><supportedRuntime version="v2.0.50727" /></startup></configuration>

View file

@ -51,4 +51,4 @@ using Greenshot.Plugin;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.4.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

View file

@ -0,0 +1,31 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace GreenshotDropboxPlugin {
/// <summary>
/// This class is merely a placeholder for the file keeping the API key and secret for dropbox integration.
/// Copy this file to DropBoxCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the DropBox plugin then.)
/// </summary>
public static class DropBoxCredentials {
public static string CONSUMER_KEY = empty;
public static string CONSUMER_SECRET = empty;
}
}

View file

@ -0,0 +1,9 @@
using System;
namespace GreenshotDropboxPlugin
{
public static class DropBoxCredentials {
public static string CONSUMER_KEY = "u7c1rpxht2x5s1r";
public static string CONSUMER_SECRET = "apitf6xvdaysaww";
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,58 +18,51 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows;
using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
namespace GreenshotDropboxPlugin {
class DropboxDestination : AbstractDestination {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(DropboxDestination));
private static DropboxPluginConfiguration config = IniConfig.GetIniSection<DropboxPluginConfiguration>();
namespace GreenshotPhotobucketPlugin {
/// <summary>
/// Description of PhotobucketDestination.
/// </summary>
public class PhotobucketDestination : AbstractDestination {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PhotobucketDestination));
private static PhotobucketConfiguration config = IniConfig.GetIniSection<PhotobucketConfiguration>();
private PhotobucketPlugin plugin = null;
public PhotobucketDestination(PhotobucketPlugin plugin) {
private DropboxPlugin plugin = null;
public DropboxDestination(DropboxPlugin plugin) {
this.plugin = plugin;
}
public override string Designation {
get {
return "Photobucket";
return "Dropbox";
}
}
public override string Description {
get {
return Language.GetString("photobucket", LangKey.upload_menu_item);
return Language.GetString("dropbox", LangKey.upload_menu_item);
}
}
public override Image DisplayIcon {
get {
ComponentResourceManager resources = new ComponentResourceManager(typeof(PhotobucketPlugin));
return (Image)resources.GetObject("Photobucket");
ComponentResourceManager resources = new ComponentResourceManager(typeof(DropboxPlugin));
return (Image)resources.GetObject("Dropbox");
}
}
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
public override ExportInformation ExportCapture(bool manually, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
using (Image image = surface.GetImageForExport()) {
string uploadURL = null;
bool uploaded = plugin.Upload(captureDetails, image, out uploadURL);
if (uploaded) {
exportInformation.ExportMade = true;
exportInformation.Uri = uploadURL;
exportInformation.ExportMade = true;
if (config.AfterUploadLinkToClipBoard) {
ClipboardHelper.SetClipboardData(uploadURL);
}
}
}
ProcessExport(exportInformation, surface);

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -29,24 +29,25 @@ using Greenshot.Plugin;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
namespace GreenshotImmioPlugin {
namespace GreenshotDropboxPlugin {
/// <summary>
/// This is the ImmioPlugin code
/// This is the Dropbox base code
/// </summary>
public class ImmioPlugin : IGreenshotPlugin {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImmioPlugin));
private static ImmioConfiguration config;
public class DropboxPlugin : IGreenshotPlugin {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(DropboxPlugin));
private static DropboxPluginConfiguration config;
public static PluginAttribute Attributes;
private IGreenshotHost host;
private ComponentResourceManager resources;
public ImmioPlugin() {
public DropboxPlugin() {
}
public IEnumerable<IDestination> Destinations() {
yield return new ImmioDestination(this);
yield return new DropboxDestination(this);
}
public IEnumerable<IProcessor> Processors() {
yield break;
}
@ -55,29 +56,28 @@ namespace GreenshotImmioPlugin {
/// Implementation of the IGreenshotPlugin.Initialize
/// </summary>
/// <param name="host">Use the IGreenshotPluginHost interface to register events</param>
/// <param name="captureHost">Use the ICaptureHost interface to register in the MainContextMenu</param>
/// <param name="pluginAttribute">My own attributes</param>
/// <returns>true if plugin is initialized, false if not (doesn't show)</returns>
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
this.host = (IGreenshotHost)pluginHost;
Attributes = myAttributes;
// Get configuration
config = IniConfig.GetIniSection<ImmioConfiguration>();
resources = new ComponentResourceManager(typeof(ImmioPlugin));
// Register configuration (don't need the configuration itself)
config = IniConfig.GetIniSection<DropboxPluginConfiguration>();
resources = new ComponentResourceManager(typeof(DropboxPlugin));
ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(Language.GetString("immio", LangKey.configure));
itemPlugInRoot.Image = (Image)resources.GetObject("Immio");
itemPlugInRoot.Click += delegate {
config.ShowConfigDialog();
};
ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem();
itemPlugInConfig.Text = Language.GetString("dropbox", LangKey.Configure);
itemPlugInConfig.Tag = host;
itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick);
itemPlugInConfig.Image = (Image)resources.GetObject("Dropbox");
PluginUtils.AddToContextMenu(host, itemPlugInConfig);
PluginUtils.AddToContextMenu(host, itemPlugInRoot);
return true;
}
public virtual void Shutdown() {
LOG.Debug("Immio Plugin shutdown.");
LOG.Debug("Dropbox Plugin shutdown.");
}
/// <summary>
@ -93,44 +93,38 @@ namespace GreenshotImmioPlugin {
/// <param name="sender"></param>
/// <param name="e"></param>
public void Closing(object sender, FormClosingEventArgs e) {
LOG.Debug("Application closing, de-registering Immio Plugin!");
LOG.Debug("Application closing, de-registering Dropbox Plugin!");
Shutdown();
}
/// <summary>
/// Upload the capture to Immio
/// </summary>
/// <param name="captureDetails"></param>
/// <param name="image"></param>
/// <param name="uploadURL">out string for the url</param>
/// <returns>true if the upload succeeded</returns>
public bool Upload(ICaptureDetails captureDetails, Image image, out string uploadURL) {
OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors);
uploadURL = null;
try {
string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails));
string url = null;
public void ConfigMenuClick(object sender, EventArgs eventArgs) {
config.ShowConfigDialog();
}
// Run upload in the background
new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("immio", LangKey.communication_wait),
/// <summary>
/// This will be called when the menu item in the Editor is clicked
/// </summary>
public bool Upload(ICaptureDetails captureDetails, Image image, out string uploadUrl) {
uploadUrl = null;
OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, false);
try {
string dropboxUrl = null;
new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("dropbox", LangKey.communication_wait),
delegate() {
url = ImmioUtils.UploadToImmio(image, outputSettings, captureDetails.Title, filename);
string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails));
dropboxUrl = DropboxUtils.UploadToDropbox(image, outputSettings, filename);
}
);
uploadURL = url;
IniConfig.Save();
try {
ClipboardHelper.SetClipboardData(url);
} catch (Exception ex) {
LOG.Error("Can't write to clipboard: ", ex);
if (dropboxUrl == null) {
return false;
}
uploadUrl = dropboxUrl;
return true;
} catch (Exception e) {
LOG.Error(e);
MessageBox.Show(Language.GetString("immio", LangKey.upload_failure) + " " + e.Message);
}
MessageBox.Show(Language.GetString("dropbox", LangKey.upload_failure) + " " + e.ToString());
return false;
}
}
}
}

View file

@ -117,20 +117,8 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="Photobucket" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAIsSURBVDhPjZLfT1JhHMbP39DOUcKy0LpptRi57hC6YToTwzIsl26tm35dJl2oQaiX0axs1ECE
xC1CLHWzBZLVlKy2qDZFsqX/xrl4ep+XaK6rc/GMd9/383nO+x6O0tQdsllcg5vW8/d1a/eYsQiWzsme
BzbF4hoqByKrGHhSgG98xVDI0qGr1LeM6oe8z2DumEDdmZihkKVDV9FOjejmjpgoiMHknkBte1SW7RXr
o5emZbjmrMpVf+mKgmFZcOLyczzOfMfL979w494ylta2kZz/hqm5InJrv3Ez9A59wzkZsnToKpozqPMJ
4+kiQokCMtl1vMqXUO9+CmtvElMLP+APf5CzTG5DMmTp0FVU511Z8OhFEc7rM3j7ZQcHOytXMLmjUFvC
uDa6iGCkgPznHcmQ5T5dRXUExBUqBZ2355Fe2kTN6agEqqlpi2D69TpS2ZJkyNKhKwvqPDE59PjmkM6X
ZQFfaDW17eKFXoiL8rJkyNL5V7DfMymHzVfTyH/aRsO5BExC2h3OuEeGLJ2/BX79wNlJPEx9xViqiIy4
wuJHUdIVhyqOznDNGffIkKWjOvziCs1+vaErgWMX4/D6ZuHtn8WVwALerPzEzPKWTHZ1S864R4YsHbqi
4I5+WHxVvPfu7HGFYRF/JcP1//t06CqafVA/0pOEJo6qtUUNJgLpCFfZ5+gvN/XFcby38tkaCVk6dJXG
1qDNbL9V0uwDuiaOZCiCpdPYOmL7A+GxSANdcOqRAAAAAElFTkSuQmCC
</value>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Dropbox" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>dropbox.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,36 +18,37 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
using GreenshotPlugin.Core;
namespace GreenshotOfficeCommunicatorPlugin {
namespace GreenshotDropboxPlugin {
/// <summary>
/// Description of OfficeCommunicatorConfiguration.
/// Description of ImgurConfiguration.
/// </summary>
[IniSection("OfficeCommunicator", Description="Greenshot OfficeCommunicator Plugin configuration")]
public class OfficeCommunicatorConfiguration : IniSection {
[IniProperty("Destination", Description = "The designation of the destination which is used to export via, the returned URL is used in the message.", DefaultValue = "FileDialog")]
public string DestinationDesignation;
[IniSection("Dropbox", Description = "Greenshot Dropbox Plugin configuration")]
public class DropboxPluginConfiguration : IniSection {
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
public OutputFormat UploadFormat;
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
public int UploadJpegQuality;
[IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send Dropbox link to clipboard.", DefaultValue = "true")]
public bool AfterUploadLinkToClipBoard;
[IniProperty("DropboxToken", Description = "The Dropbox token", Encrypted = true, ExcludeIfNull = true)]
public string DropboxToken;
[IniProperty("DropboxTokenSecret", Description = "The Dropbox token secret", Encrypted = true, ExcludeIfNull = true)]
public string DropboxTokenSecret;
/// <summary>
/// A form for username/password
/// A form for token
/// </summary>
/// <returns>bool true if OK was pressed, false if cancel</returns>
public bool ShowConfigDialog() {
SettingsForm settingsForm = null;
new PleaseWaitForm().ShowAndWait(OfficeCommunicatorPlugin.Attributes.Name, Language.GetString("officecommunicator", LangKey.communication_wait),
delegate() {
settingsForm = new SettingsForm(this);
}
);
DialogResult result = settingsForm.ShowDialog();
DialogResult result = new SettingsForm().ShowDialog();
if (result == DialogResult.OK) {
return true;
}

View file

@ -0,0 +1,80 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
namespace GreenshotDropboxPlugin {
/// <summary>
/// Description of DropboxUtils.
/// </summary>
public class DropboxUtils {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(DropboxUtils));
private static DropboxPluginConfiguration config = IniConfig.GetIniSection<DropboxPluginConfiguration>();
private DropboxUtils() {
}
public static string UploadToDropbox(Image image, OutputSettings outputSettings, string filename) {
OAuthSession oAuth = new OAuthSession(DropBoxCredentials.CONSUMER_KEY, DropBoxCredentials.CONSUMER_SECRET);
oAuth.BrowserSize = new Size(1080, 650);
oAuth.CheckVerifier = false;
oAuth.AccessTokenUrl = "https://api.dropbox.com/1/oauth/access_token";
oAuth.AuthorizeUrl = "https://api.dropbox.com/1/oauth/authorize";
oAuth.RequestTokenUrl = "https://api.dropbox.com/1/oauth/request_token";
oAuth.LoginTitle = "Dropbox authorization";
oAuth.Token = config.DropboxToken;
oAuth.TokenSecret = config.DropboxTokenSecret;
try {
ImageContainer imageToUpload = new ImageContainer(image, outputSettings, filename);
string uploadResponse = oAuth.MakeOAuthRequest(HTTPMethod.POST, "https://api-content.dropbox.com/1/files_put/sandbox/" + OAuthSession.UrlEncode3986(filename), null, null, imageToUpload);
LOG.DebugFormat("Upload response: {0}", uploadResponse);
} catch (Exception ex) {
LOG.Error("Upload error: ", ex);
throw ex;
} finally {
if (!string.IsNullOrEmpty(oAuth.Token)) {
config.DropboxToken = oAuth.Token;
}
if (!string.IsNullOrEmpty(oAuth.TokenSecret)) {
config.DropboxTokenSecret = oAuth.TokenSecret;
}
}
// Try to get a URL to the uploaded image
try {
string responseString = oAuth.MakeOAuthRequest(HTTPMethod.GET, "https://api.dropbox.com/1/shares/sandbox/" + OAuthSession.UrlEncode3986(filename), null, null, null);
LOG.DebugFormat("Parsing output: {0}", responseString);
IDictionary<string, object> returnValues = JSONHelper.JsonDecode(responseString);
if (returnValues.ContainsKey("url")) {
return returnValues["url"] as string;
}
} catch (Exception ex) {
LOG.Error("Can't parse response.", ex);
}
return null;
}
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -19,16 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Windows.Forms;
using GreenshotPlugin.Core;
using GreenshotPlugin.Controls;
namespace GreenshotImmioPlugin {
/// <summary>
/// Description of ImmioForm.
/// </summary>
public class ImmioForm : GreenshotForm {
public ImmioForm() : base() {
}
namespace GreenshotDropboxPlugin.Forms {
public class DropboxForm : GreenshotForm {
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2011 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace GreenshotPhotobucketPlugin {
namespace GreenshotDropboxPlugin {
partial class SettingsForm {
/// <summary>
/// Designer variable used to keep track of non-visual components.
@ -44,115 +44,109 @@ namespace GreenshotPhotobucketPlugin {
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
private void InitializeComponent() {
this.buttonOK = new GreenshotPlugin.Controls.GreenshotButton();
this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton();
this.label_url = new GreenshotPlugin.Controls.GreenshotLabel();
this.textBoxUrl = new GreenshotPlugin.Controls.GreenshotTextBox();
this.combobox_uploadimageformat = new GreenshotPlugin.Controls.GreenshotComboBox();
this.label_upload_format = new GreenshotPlugin.Controls.GreenshotLabel();
this.checkbox_usepagelink = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.label_AfterUpload = new GreenshotPlugin.Controls.GreenshotLabel();
this.checkboxAfterUploadLinkToClipBoard = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.LanguageKey = "photobucket.OK";
this.buttonOK.Location = new System.Drawing.Point(222, 129);
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(267, 64);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 2;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOKClick);
//
// buttonCancel
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.LanguageKey = "photobucket.CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(303, 129);
this.buttonCancel.LanguageKey = "CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(348, 64);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 3;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// label_url
//
this.label_url.LanguageKey = "photobucket.label_url";
this.label_url.Location = new System.Drawing.Point(12, 21);
this.label_url.Name = "label_url";
this.label_url.Size = new System.Drawing.Size(84, 20);
this.label_url.TabIndex = 7;
//
// textBoxUrl
//
this.textBoxUrl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.textBoxUrl.Location = new System.Drawing.Point(102, 21);
this.textBoxUrl.Name = "textBoxUrl";
this.textBoxUrl.PropertyName = "PhotobucketApiUrl";
this.textBoxUrl.SectionName = "Photobucket";
this.textBoxUrl.Size = new System.Drawing.Size(276, 20);
this.textBoxUrl.TabIndex = 6;
//
// combobox_uploadimageformat
//
this.combobox_uploadimageformat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.combobox_uploadimageformat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.combobox_uploadimageformat.FormattingEnabled = true;
this.combobox_uploadimageformat.Location = new System.Drawing.Point(102, 47);
this.combobox_uploadimageformat.Location = new System.Drawing.Point(116, 9);
this.combobox_uploadimageformat.Name = "combobox_uploadimageformat";
this.combobox_uploadimageformat.PropertyName = "UploadFormat";
this.combobox_uploadimageformat.SectionName = "Photobucket";
this.combobox_uploadimageformat.Size = new System.Drawing.Size(276, 21);
this.combobox_uploadimageformat.SectionName = "Dropbox";
this.combobox_uploadimageformat.Size = new System.Drawing.Size(309, 21);
this.combobox_uploadimageformat.TabIndex = 8;
//
// label_upload_format
//
this.label_upload_format.LanguageKey = "photobucket.label_upload_format";
this.label_upload_format.Location = new System.Drawing.Point(12, 50);
this.label_upload_format.LanguageKey = "dropbox.label_upload_format";
this.label_upload_format.Location = new System.Drawing.Point(11, 12);
this.label_upload_format.Name = "label_upload_format";
this.label_upload_format.Size = new System.Drawing.Size(84, 20);
this.label_upload_format.TabIndex = 9;
this.label_upload_format.Text = "Image format";
//
// checkbox_usepagelink
// label_AfterUpload
//
this.checkbox_usepagelink.AutoSize = true;
this.checkbox_usepagelink.LanguageKey = "photobucket.use_page_link";
this.checkbox_usepagelink.Location = new System.Drawing.Point(15, 97);
this.checkbox_usepagelink.Name = "checkbox_usepagelink";
this.checkbox_usepagelink.PropertyName = "UsePageLink";
this.checkbox_usepagelink.SectionName = "Photobucket";
this.checkbox_usepagelink.Size = new System.Drawing.Size(297, 17);
this.checkbox_usepagelink.TabIndex = 13;
this.checkbox_usepagelink.UseVisualStyleBackColor = true;
this.label_AfterUpload.LanguageKey = "dropbox.label_AfterUpload";
this.label_AfterUpload.Location = new System.Drawing.Point(10, 37);
this.label_AfterUpload.Name = "label_AfterUpload";
this.label_AfterUpload.Size = new System.Drawing.Size(84, 21);
this.label_AfterUpload.TabIndex = 22;
this.label_AfterUpload.Text = "After upload";
//
// checkboxAfterUploadLinkToClipBoard
//
this.checkboxAfterUploadLinkToClipBoard.AutoSize = true;
this.checkboxAfterUploadLinkToClipBoard.LanguageKey = "dropbox.label_AfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.Location = new System.Drawing.Point(116, 37);
this.checkboxAfterUploadLinkToClipBoard.Name = "checkboxAfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.PropertyName = "AfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.SectionName = "Dropbox";
this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(104, 17);
this.checkboxAfterUploadLinkToClipBoard.TabIndex = 24;
this.checkboxAfterUploadLinkToClipBoard.Text = "Link to clipboard";
this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true;
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(387, 168);
this.Controls.Add(this.checkbox_usepagelink);
this.ClientSize = new System.Drawing.Size(432, 96);
this.Controls.Add(this.checkboxAfterUploadLinkToClipBoard);
this.Controls.Add(this.label_AfterUpload);
this.Controls.Add(this.label_upload_format);
this.Controls.Add(this.combobox_uploadimageformat);
this.Controls.Add(this.label_url);
this.Controls.Add(this.textBoxUrl);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.LanguageKey = "photobucket.settings_title";
this.LanguageKey = "dropbox.settings_title";
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.Text = "Dropbox settings";
this.ResumeLayout(false);
this.PerformLayout();
}
private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat;
private GreenshotPlugin.Controls.GreenshotLabel label_upload_format;
private GreenshotPlugin.Controls.GreenshotTextBox textBoxUrl;
private GreenshotPlugin.Controls.GreenshotLabel label_url;
private GreenshotPlugin.Controls.GreenshotButton buttonCancel;
private GreenshotPlugin.Controls.GreenshotButton buttonOK;
private GreenshotPlugin.Controls.GreenshotCheckBox checkbox_usepagelink;
private GreenshotPlugin.Controls.GreenshotLabel label_AfterUpload;
private GreenshotPlugin.Controls.GreenshotCheckBox checkboxAfterUploadLinkToClipBoard;
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -20,15 +20,19 @@
*/
using System;
using System.Windows.Forms;
using GreenshotDropboxPlugin.Forms;
using GreenshotPlugin.Core;
using GreenshotPlugin.Controls;
using Greenshot.IniFile;
namespace GreenshotOfficeCommunicatorPlugin {
namespace GreenshotDropboxPlugin {
/// <summary>
/// Description of PasswordRequestForm.
/// </summary>
public partial class SettingsForm : OfficeCommunicatorForm {
public SettingsForm(OfficeCommunicatorConfiguration config) : base() {
public partial class SettingsForm : DropboxForm {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SettingsForm));
private static DropboxPluginConfiguration config = IniConfig.GetIniSection<DropboxPluginConfiguration>();
public SettingsForm() {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//

View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<PropertyGroup>
<ProjectGuid>{AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>GreenshotDropboxPlugin</RootNamespace>
<AssemblyName>GreenshotDropboxPlugin</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DropBoxCredentials.cs" />
<Compile Include="DropboxPluginConfiguration.cs" />
<Compile Include="DropboxDestination.cs" />
<Compile Include="DropboxPlugin.cs" />
<Compile Include="DropboxUtils.cs" />
<Compile Include="Forms\DropboxForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
<Compile Include="LanguageKeys.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="DropboxPlugin.resx">
<DependentUpon>DropboxPlugin.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="Dropbox.gif" />
<None Include="Languages\language_dropboxplugin-en-US.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Greenshot\GreenshotPlugin\GreenshotPlugin.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>GreenshotPlugin</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>if exist "$(ProjectDir)DropBoxCredentials.orig.cs" (
rename "$(ProjectDir)DropBoxCredentials.cs" "DropBoxCredentials.private.cs"
rename "$(ProjectDir)DropBoxCredentials.orig.cs" "DropBoxCredentials.cs"
) else exit /b -1
mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\"
mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)"
copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\"
</PostBuildEvent>
<PreBuildEvent>"$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs"
if exist "$(ProjectDir)DropBoxCredentials.private.cs" (
rename "$(ProjectDir)DropBoxCredentials.cs" "DropBoxCredentials.orig.cs"
rename "$(ProjectDir)DropBoxCredentials.private.cs" "DropBoxCredentials.cs"
) else exit /b -1</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>x86</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>TRACE</DefineConstants>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DebugType>None</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
</Project>

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,25 +18,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace GreenshotPhotobucketPlugin {
namespace GreenshotDropboxPlugin {
public enum LangKey {
upload_menu_item,
settings_title,
label_url,
label_upload_format,
label_clear,
OK,
CANCEL,
upload_success,
upload_failure,
communication_wait,
delete_question,
clear_question,
delete_title,
use_page_link,
history,
configure
Configure,
label_AfterUpload,
label_AfterUploadLinkToClipBoard
}
}

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="English" ietf="en-US" version="1.0.0">
<resources>
<resource name="label_AfterUploadLinkToClipBoard">
Link to clipboard
</resource>
<resource name="label_AfterUploadOpenHistory">
Open history
</resource>
<resource name="label_AfterUpload">
After upload
</resource>
<resource name="Configure">
Configure Dropbox
</resource>
<resource name="upload_menu_item">
Upload to Dropbox
</resource>
<resource name="settings_title">
Dropbox settings
</resource>
<resource name="upload_success">
Successfully uploaded image to Dropbox!
</resource>
<resource name="upload_failure">
An error occured while uploading to Dropbox:
</resource>
<resource name="label_upload_format">
Image format
</resource>
<resource name="communication_wait">
Communicating with Dropbox. Please wait...
</resource>
</resources>
</language>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Français" ietf="fr-FR" version="1.0.0" languagegroup="">
<resources>
<resource name="communication_wait">Communication en cours avec Dropbox. Veuillez patientez...</resource>
<resource name="Configure">Configurer Dropbox</resource>
<resource name="label_AfterUpload">Après téléversement</resource>
<resource name="label_AfterUploadLinkToClipBoard">Copier le lien dans le presse-papier</resource>
<resource name="label_upload_format">Format image</resource>
<resource name="settings_title">Paramètres Dropbox</resource>
<resource name="upload_failure">Une erreur s'est produite lors du téléversement vers Dropbox :</resource>
<resource name="upload_menu_item">Téléverser vers Dropbox</resource>
<resource name="upload_success">Image téléversée aves succès vers Dropbox !</resource>
</resources>
</language>

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Русский" ietf="ru-RU" version="1.0.0" languagegroup="">
<resources>
<resource name="label_AfterUploadLinkToClipBoard">
Ссылку в буфер обмена</resource>
<resource name="label_AfterUploadOpenHistory">
Открыть историию</resource>
<resource name="label_AfterUpload">
После загрузки</resource>
<resource name="Configure">Настройка Dropbox
</resource>
<resource name="upload_menu_item">
Добавить в Dropbox
</resource>
<resource name="settings_title">
Настройки Dropbox
</resource>
<resource name="upload_success">
Изображение успешно загружено на Dropbox!
</resource>
<resource name="upload_failure">
Произошла ошибка при загрузке на Dropbox:
</resource>
<resource name="label_upload_format">
Формат изображения</resource>
<resource name="communication_wait">Обмен информацией с Dropbox. Подождите...</resource>
</resources>
</language>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Українська" ietf="uk-UA" version="1.0.0">
<resources>
<resource name="label_AfterUploadLinkToClipBoard">Посилання в буфер обміну</resource>
<resource name="label_AfterUpload">Після вивантаження</resource>
<resource name="Configure">Налаштувати Dropbox</resource>
<resource name="upload_menu_item">Вивантажити на Dropbox</resource>
<resource name="settings_title">Параметри Dropbox</resource>
<resource name="upload_success">Зображення вдало вивантажено на Dropbox!</resource>
<resource name="upload_failure">Відбулась помилка при вивантаженні зображення на Dropbox:</resource>
<resource name="label_upload_format">Формат зображення</resource>
<resource name="communication_wait">З’єднання з Dropbox. Будь ласка, зачекайте...</resource>
</resources>
</language>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="简体中文" ietf="zh-CN" version="1.0.3" languagegroup="a">
<resources>
<resource name="communication_wait">正在连接Dropbox。请稍后...</resource>
<resource name="Configure">配置Dropbox</resource>
<resource name="label_AfterUpload">上传之后</resource>
<resource name="label_AfterUploadLinkToClipBoard">复制链接到剪贴板</resource>
<resource name="label_upload_format">图片格式</resource>
<resource name="settings_title">Dropbox设置</resource>
<resource name="upload_failure">在上传到Dropbox时发生错误</resource>
<resource name="upload_menu_item">上传到Dropbox</resource>
<resource name="upload_success">图片已成功上传到了Dropbox</resource>
</resources>
</language>

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -30,16 +30,16 @@ using Greenshot.Plugin;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Greenshot-OfficeCommunicator-Plugin")]
[assembly: AssemblyDescription("A plugin to upload images to office communicator")]
[assembly: AssemblyTitle("Greenshot-Dropbox-Plugin")]
[assembly: AssemblyDescription("A plugin to upload images to Dropbox")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot")]
[assembly: AssemblyProduct("OfficeCommunicator Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2007-2012")]
[assembly: AssemblyCompany("Greenshot & F. Noel")]
[assembly: AssemblyProduct("Dropbox Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The PluginAttribute describes the "entryType" and if the plugin is configurable
[assembly: PluginAttribute("GreenshotOfficeCommunicatorPlugin.OfficeCommunicatorPlugin", true)]
[assembly: PluginAttribute("GreenshotDropboxPlugin.DropboxPlugin", true)]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
@ -51,4 +51,4 @@ using Greenshot.Plugin;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.3.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

View file

@ -50,4 +50,4 @@ using Greenshot.Plugin;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.4.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,53 +18,56 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
using GreenshotPlugin.Core;
namespace GreenshotPhotobucketPlugin {
namespace GreenshotFlickrPlugin {
public enum SafetyLevel {
Safe = 1,
Moderate = 2,
Restricted = 3
}
/// <summary>
/// Description of PhotobucketConfiguration.
/// Description of FlickrConfiguration.
/// </summary>
[IniSection("Photobucket", Description="Greenshot Photobucket Plugin configuration")]
public class PhotobucketConfiguration : IniSection {
[IniSection("Flickr", Description = "Greenshot Flickr Plugin configuration")]
public class FlickrConfiguration : IniSection {
[IniProperty("flickrIsPublic", Description = "IsPublic.", DefaultValue = "true")]
public bool IsPublic;
[IniProperty("flickrIsFamily", Description = "IsFamily.", DefaultValue = "true")]
public bool IsFamily;
[IniProperty("flickrIsFriend", Description = "IsFriend.", DefaultValue = "true")]
public bool IsFriend;
[IniProperty("SafetyLevel", Description = "Safety level", DefaultValue = "Safe")]
public SafetyLevel SafetyLevel;
[IniProperty("HiddenFromSearch", Description = "Hidden from search", DefaultValue = "false")]
public bool HiddenFromSearch;
[IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")]
public OutputFormat UploadFormat;
[IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")]
public int UploadJpegQuality;
[IniProperty("UploadReduceColors", Description="Reduce color amount of the uploaded image to 256", DefaultValue="False")]
public bool UploadReduceColors;
[IniProperty("UsePageLink", Description = "Use pagelink instead of direct link on the clipboard", DefaultValue = "False")]
public bool UsePageLink;
[IniProperty("Token", Description = "The Photobucket token", Encrypted=true, ExcludeIfNull=true)]
public string Token;
[IniProperty("TokenSecret", Description = "The Photobucket token secret", Encrypted=true, ExcludeIfNull=true)]
public string TokenSecret;
[IniProperty("SubDomain", Description = "The Photobucket api subdomain", Encrypted = true, ExcludeIfNull = true)]
public string SubDomain;
public int Credits {
get;
set;
}
[IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send flickr link to clipboard.", DefaultValue = "true")]
public bool AfterUploadLinkToClipBoard;
[IniProperty("FlickrToken", Description = "The Flickr token", Encrypted = true, ExcludeIfNull = true)]
public string FlickrToken;
[IniProperty("FlickrTokenSecret", Description = "The Flickr token secret", Encrypted = true, ExcludeIfNull = true)]
public string FlickrTokenSecret;
/// <summary>
/// A form for username/password
/// A form for token
/// </summary>
/// <returns>bool true if OK was pressed, false if cancel</returns>
public bool ShowConfigDialog() {
SettingsForm settingsForm = null;
new PleaseWaitForm().ShowAndWait(PhotobucketPlugin.Attributes.Name, Language.GetString("photobucket", LangKey.communication_wait),
delegate() {
settingsForm = new SettingsForm(this);
}
);
DialogResult result = settingsForm.ShowDialog();
DialogResult result = new SettingsForm(this).ShowDialog();
if (result == DialogResult.OK) {
return true;
}

View file

@ -0,0 +1,31 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace GreenshotFlickrPlugin {
/// <summary>
/// This class is merely a placeholder for the file keeping the API key and secret for dropbox integration.
/// Copy this file to FlickrCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the DropBox plugin then.)
/// </summary>
public static class FlickrCredentials {
public static string ConsumerKey = empty;
public static string ConsumerSecret = empty;
}
}

View file

@ -0,0 +1,8 @@
using System;
namespace GreenshotFlickrPlugin {
public static class FlickrCredentials {
public static string ConsumerKey = "f967e5148945cb3c4e149cc5be97796a";
public static string ConsumerSecret = "4180a21a1d2f8666";
}
}

View file

@ -0,0 +1,64 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.ComponentModel;
using System.Drawing;
using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
namespace GreenshotFlickrPlugin {
public class FlickrDestination : AbstractDestination {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FlickrDestination));
private static FlickrConfiguration config = IniConfig.GetIniSection<FlickrConfiguration>();
private FlickrPlugin plugin = null;
public FlickrDestination(FlickrPlugin plugin) {
this.plugin = plugin;
}
public override string Designation {
get {
return "Flickr";
}
}
public override string Description {
get {
return Language.GetString("flickr", LangKey.upload_menu_item);
}
}
public override Image DisplayIcon {
get {
ComponentResourceManager resources = new ComponentResourceManager(typeof(FlickrPlugin));
return (Image)resources.GetObject("flickr");
}
}
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
using (Image image = surface.GetImageForExport()) {
plugin.Upload(captureDetails, image, exportInformation);
}
ProcessExport(exportInformation, surface);
return exportInformation;
}
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -24,31 +24,31 @@ using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using System.Threading;
using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Controls;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
namespace GreenshotPhotobucketPlugin {
namespace GreenshotFlickrPlugin
{
/// <summary>
/// This is the GreenshotPhotobucketPlugin base code
/// This is the Flickr base code
/// </summary>
public class PhotobucketPlugin : IGreenshotPlugin {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PhotobucketPlugin));
private static PhotobucketConfiguration config;
public class FlickrPlugin : IGreenshotPlugin {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FlickrPlugin));
private static FlickrConfiguration config;
public static PluginAttribute Attributes;
private IGreenshotHost host;
private ComponentResourceManager resources;
public PhotobucketPlugin() {
public FlickrPlugin() {
}
public IEnumerable<IDestination> Destinations() {
yield return new PhotobucketDestination(this);
yield return new FlickrDestination(this);
}
public IEnumerable<IProcessor> Processors() {
yield break;
}
@ -57,23 +57,21 @@ namespace GreenshotPhotobucketPlugin {
/// Implementation of the IGreenshotPlugin.Initialize
/// </summary>
/// <param name="host">Use the IGreenshotPluginHost interface to register events</param>
/// <param name="captureHost">Use the ICaptureHost interface to register in the MainContextMenu</param>
/// <param name="pluginAttribute">My own attributes</param>
/// <returns>true if plugin is initialized, false if not (doesn't show)</returns>
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
this.host = (IGreenshotHost)pluginHost;
Attributes = myAttributes;
// Get configuration
config = IniConfig.GetIniSection<PhotobucketConfiguration>();
resources = new ComponentResourceManager(typeof(PhotobucketPlugin));
ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem("Photobucket " + Language.GetString("photobucket", LangKey.configure));
// Register configuration (don't need the configuration itself)
config = IniConfig.GetIniSection<FlickrConfiguration>();
resources = new ComponentResourceManager(typeof(FlickrPlugin));
ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem();
itemPlugInConfig.Text = Language.GetString("flickr", LangKey.Configure);
itemPlugInConfig.Tag = host;
itemPlugInConfig.Click += delegate {
config.ShowConfigDialog();
};
itemPlugInConfig.Image = (Image)resources.GetObject("Photobucket");
itemPlugInConfig.Image = (Image)resources.GetObject("flickr");
itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick);
PluginUtils.AddToContextMenu(host, itemPlugInConfig);
@ -81,7 +79,7 @@ namespace GreenshotPhotobucketPlugin {
}
public virtual void Shutdown() {
LOG.Debug("Photobucket Plugin shutdown.");
LOG.Debug("Flickr Plugin shutdown.");
}
/// <summary>
@ -97,50 +95,38 @@ namespace GreenshotPhotobucketPlugin {
/// <param name="sender"></param>
/// <param name="e"></param>
public void Closing(object sender, FormClosingEventArgs e) {
LOG.Debug("Application closing, de-registering Photobucket Plugin!");
LOG.Debug("Application closing, de-registering Flickr Plugin!");
Shutdown();
}
/// <summary>
/// Upload the capture to Photobucket
/// </summary>
/// <param name="captureDetails"></param>
/// <param name="image"></param>
/// <param name="uploadURL">out string for the url</param>
/// <returns>true if the upload succeeded</returns>
public bool Upload(ICaptureDetails captureDetails, Image image, out string uploadURL) {
OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors);
try {
string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails));
PhotobucketInfo photobucketInfo = null;
public void ConfigMenuClick(object sender, EventArgs eventArgs) {
config.ShowConfigDialog();
}
// Run upload in the background
new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("photobucket", LangKey.communication_wait),
public void Upload(ICaptureDetails captureDetails, Image image, ExportInformation exportInformation) {
OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, false);
try {
string flickrUrl = null;
new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("flickr", LangKey.communication_wait),
delegate() {
photobucketInfo = PhotobucketUtils.UploadToPhotobucket(image, outputSettings, captureDetails.Title, filename);
string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails));
flickrUrl = FlickrUtils.UploadToFlickr(image, outputSettings, captureDetails.Title, filename);
}
);
// This causes an exeption if the upload failed :)
LOG.DebugFormat("Uploaded to Photobucket page: " + photobucketInfo.Page);
uploadURL = null;
try {
if (config.UsePageLink) {
uploadURL = photobucketInfo.Page;
Clipboard.SetText(photobucketInfo.Page);
} else {
uploadURL = photobucketInfo.Original;
Clipboard.SetText(photobucketInfo.Original);
if (flickrUrl == null) {
exportInformation.ExportMade = false;
return;
}
} catch (Exception ex) {
LOG.Error("Can't write to clipboard: ", ex);
exportInformation.ExportMade = true;
exportInformation.Uri = flickrUrl;
if (config.AfterUploadLinkToClipBoard) {
ClipboardHelper.SetClipboardData(flickrUrl);
}
return true;
} catch (Exception e) {
LOG.Error(e);
MessageBox.Show(Language.GetString("photobucket", LangKey.upload_failure) + " " + e.Message);
}
uploadURL = null;
return false;
MessageBox.Show(Language.GetString("flickr", LangKey.upload_failure) + " " + e.Message);
}
}
}
}

View file

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="flickr" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>flickr.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -0,0 +1,129 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Xml;
using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
namespace GreenshotFlickrPlugin {
/// <summary>
/// Description of FlickrUtils.
/// </summary>
public class FlickrUtils {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FlickrUtils));
private static FlickrConfiguration config = IniConfig.GetIniSection<FlickrConfiguration>();
private FlickrUtils() {
}
/// <summary>
/// Do the actual upload to Flickr
/// For more details on the available parameters, see: http://flickrnet.codeplex.com
/// </summary>
/// <param name="imageData">byte[] with image data</param>
/// <returns>url to image</returns>
public static string UploadToFlickr(Image image, OutputSettings outputSettings, string title, string filename) {
OAuthSession oAuth = new OAuthSession(FlickrCredentials.ConsumerKey, FlickrCredentials.ConsumerSecret);
oAuth.BrowserSize = new Size(520, 800);
oAuth.CheckVerifier = false;
oAuth.AccessTokenUrl = "http://api.flickr.com/services/oauth/access_token";
oAuth.AuthorizeUrl = "http://api.flickr.com/services/oauth/authorize";
oAuth.RequestTokenUrl = "http://api.flickr.com/services/oauth/request_token";
oAuth.LoginTitle = "Flickr authorization";
oAuth.Token = config.FlickrToken;
oAuth.TokenSecret = config.FlickrTokenSecret;
if (string.IsNullOrEmpty(oAuth.Token)) {
if (!oAuth.Authorize()) {
return null;
}
if (!string.IsNullOrEmpty(oAuth.Token)) {
config.FlickrToken = oAuth.Token;
}
if (!string.IsNullOrEmpty(oAuth.TokenSecret)) {
config.FlickrTokenSecret = oAuth.TokenSecret;
}
IniConfig.Save();
}
try {
IDictionary<string, object> signedParameters = new Dictionary<string, object>();
signedParameters.Add("content_type","2"); // Screenshot
signedParameters.Add("tags","Greenshot");
signedParameters.Add("is_public", config.IsPublic?"1":"0");
signedParameters.Add("is_friend", config.IsFriend?"1":"0");
signedParameters.Add("is_family", config.IsFamily?"1":"0");
signedParameters.Add("safety_level", string.Format("{0}", (int)config.SafetyLevel));
signedParameters.Add("hidden", config.HiddenFromSearch?"1":"2");
IDictionary<string, object> otherParameters = new Dictionary<string, object>();
otherParameters.Add("photo", new ImageContainer(image, outputSettings, filename));
string response = oAuth.MakeOAuthRequest(HTTPMethod.POST, "http://api.flickr.com/services/upload/", signedParameters, otherParameters, null);
string photoId = GetPhotoId(response);
// Get Photo Info
signedParameters = new Dictionary<string, object>();
signedParameters.Add("photo_id", photoId);
string photoInfo = oAuth.MakeOAuthRequest(HTTPMethod.POST, "http://api.flickr.com/services/rest/?method=flickr.photos.getInfo", signedParameters, null, null);
return GetUrl(photoInfo);
} catch (Exception ex) {
LOG.Error("Upload error: ", ex);
throw ex;
} finally {
if (!string.IsNullOrEmpty(oAuth.Token)) {
config.FlickrToken = oAuth.Token;
}
if (!string.IsNullOrEmpty(oAuth.TokenSecret)) {
config.FlickrTokenSecret = oAuth.TokenSecret;
}
}
}
private static string GetUrl(string response) {
try {
XmlDocument doc = new XmlDocument();
doc.LoadXml(response);
XmlNodeList nodes = doc.GetElementsByTagName("url");
if(nodes.Count > 0) {
return nodes.Item(0).InnerText;
}
} catch (Exception ex) {
LOG.Error("Error parsing Flickr Response.", ex);
}
return null;
}
private static string GetPhotoId(string response) {
try {
XmlDocument doc = new XmlDocument();
doc.LoadXml(response);
XmlNodeList nodes = doc.GetElementsByTagName("photoid");
if(nodes.Count > 0) {
return nodes.Item(0).InnerText;
}
} catch (Exception ex) {
LOG.Error("Error parsing Flickr Response.", ex);
}
return null;
}
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -19,13 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using GreenshotPlugin.Controls;
namespace GreenshotPhotobucketPlugin {
/// <summary>
/// This class is needed for design-time resolving of the language files
/// </summary>
public class PhotobucketForm : GreenshotPlugin.Controls.GreenshotForm {
public PhotobucketForm() : base() {
}
namespace GreenshotFlickrPlugin.Forms {
public class FlickrForm : GreenshotForm {
}
}

View file

@ -0,0 +1,244 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace GreenshotFlickrPlugin {
partial class SettingsForm {
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.buttonOK = new GreenshotPlugin.Controls.GreenshotButton();
this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton();
this.combobox_uploadimageformat = new GreenshotPlugin.Controls.GreenshotComboBox();
this.label_upload_format = new GreenshotPlugin.Controls.GreenshotLabel();
this.checkBoxPublic = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.checkBoxFamily = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.checkBoxFriend = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.label_SafetyLevel = new GreenshotPlugin.Controls.GreenshotLabel();
this.combobox_safetyLevel = new GreenshotPlugin.Controls.GreenshotComboBox();
this.label_AfterUpload = new GreenshotPlugin.Controls.GreenshotLabel();
this.checkboxAfterUploadLinkToClipBoard = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.checkBox_hiddenfromsearch = new GreenshotPlugin.Controls.GreenshotCheckBox();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(270, 151);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 18;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOKClick);
//
// buttonCancel
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.LanguageKey = "CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(351, 151);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 19;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// combobox_uploadimageformat
//
this.combobox_uploadimageformat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.combobox_uploadimageformat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.combobox_uploadimageformat.FormattingEnabled = true;
this.combobox_uploadimageformat.Location = new System.Drawing.Point(174, 6);
this.combobox_uploadimageformat.Name = "combobox_uploadimageformat";
this.combobox_uploadimageformat.PropertyName = "UploadFormat";
this.combobox_uploadimageformat.SectionName = "Flickr";
this.combobox_uploadimageformat.Size = new System.Drawing.Size(251, 21);
this.combobox_uploadimageformat.TabIndex = 4;
//
// label_upload_format
//
this.label_upload_format.LanguageKey = "flickr.label_upload_format";
this.label_upload_format.Location = new System.Drawing.Point(11, 9);
this.label_upload_format.Name = "label_upload_format";
this.label_upload_format.Size = new System.Drawing.Size(157, 20);
this.label_upload_format.TabIndex = 3;
this.label_upload_format.Text = "Image format";
//
// checkBoxPublic
//
this.checkBoxPublic.AutoSize = true;
this.checkBoxPublic.LanguageKey = "flickr.public";
this.checkBoxPublic.Location = new System.Drawing.Point(174, 88);
this.checkBoxPublic.Name = "checkBoxPublic";
this.checkBoxPublic.PropertyName = "IsPublic";
this.checkBoxPublic.SectionName = "Flickr";
this.checkBoxPublic.Size = new System.Drawing.Size(55, 17);
this.checkBoxPublic.TabIndex = 11;
this.checkBoxPublic.Text = "Public";
this.checkBoxPublic.UseVisualStyleBackColor = true;
//
// checkBoxFamily
//
this.checkBoxFamily.AutoSize = true;
this.checkBoxFamily.LanguageKey = "flickr.family";
this.checkBoxFamily.Location = new System.Drawing.Point(265, 88);
this.checkBoxFamily.Name = "checkBoxFamily";
this.checkBoxFamily.PropertyName = "IsFamily";
this.checkBoxFamily.SectionName = "Flickr";
this.checkBoxFamily.Size = new System.Drawing.Size(55, 17);
this.checkBoxFamily.TabIndex = 12;
this.checkBoxFamily.Text = "Family";
this.checkBoxFamily.UseVisualStyleBackColor = true;
//
// checkBoxFriend
//
this.checkBoxFriend.AutoSize = true;
this.checkBoxFriend.LanguageKey = "flickr.friend";
this.checkBoxFriend.Location = new System.Drawing.Point(350, 88);
this.checkBoxFriend.Name = "checkBoxFriend";
this.checkBoxFriend.PropertyName = "IsFriend";
this.checkBoxFriend.SectionName = "Flickr";
this.checkBoxFriend.Size = new System.Drawing.Size(52, 17);
this.checkBoxFriend.TabIndex = 13;
this.checkBoxFriend.Text = "Fiend";
this.checkBoxFriend.UseVisualStyleBackColor = true;
//
// label_SafetyLevel
//
this.label_SafetyLevel.LanguageKey = "flickr.label_SafetyLevel";
this.label_SafetyLevel.Location = new System.Drawing.Point(11, 36);
this.label_SafetyLevel.Name = "label_SafetyLevel";
this.label_SafetyLevel.Size = new System.Drawing.Size(157, 21);
this.label_SafetyLevel.TabIndex = 7;
this.label_SafetyLevel.Text = "Safety level";
//
// combobox_safetyLevel
//
this.combobox_safetyLevel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.combobox_safetyLevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.combobox_safetyLevel.FormattingEnabled = true;
this.combobox_safetyLevel.Location = new System.Drawing.Point(174, 33);
this.combobox_safetyLevel.Name = "combobox_safetyLevel";
this.combobox_safetyLevel.PropertyName = "SafetyLevel";
this.combobox_safetyLevel.SectionName = "Flickr";
this.combobox_safetyLevel.Size = new System.Drawing.Size(251, 21);
this.combobox_safetyLevel.TabIndex = 8;
//
// label_AfterUpload
//
this.label_AfterUpload.LanguageKey = "flickr.label_AfterUpload";
this.label_AfterUpload.Location = new System.Drawing.Point(12, 117);
this.label_AfterUpload.Name = "label_AfterUpload";
this.label_AfterUpload.Size = new System.Drawing.Size(155, 21);
this.label_AfterUpload.TabIndex = 14;
this.label_AfterUpload.Text = "After upload";
//
// checkboxAfterUploadLinkToClipBoard
//
this.checkboxAfterUploadLinkToClipBoard.AutoSize = true;
this.checkboxAfterUploadLinkToClipBoard.LanguageKey = "flickr.label_AfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.Location = new System.Drawing.Point(173, 116);
this.checkboxAfterUploadLinkToClipBoard.Name = "checkboxAfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.PropertyName = "AfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.SectionName = "Flickr";
this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(104, 17);
this.checkboxAfterUploadLinkToClipBoard.TabIndex = 16;
this.checkboxAfterUploadLinkToClipBoard.Text = "Link to clipboard";
this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true;
//
// checkBox_hiddenfromsearch
//
this.checkBox_hiddenfromsearch.AutoSize = true;
this.checkBox_hiddenfromsearch.LanguageKey = "flickr.label_HiddenFromSearch";
this.checkBox_hiddenfromsearch.Location = new System.Drawing.Point(174, 60);
this.checkBox_hiddenfromsearch.Name = "checkBox_hiddenfromsearch";
this.checkBox_hiddenfromsearch.PropertyName = "HiddenFromSearch";
this.checkBox_hiddenfromsearch.SectionName = "Flickr";
this.checkBox_hiddenfromsearch.Size = new System.Drawing.Size(118, 17);
this.checkBox_hiddenfromsearch.TabIndex = 20;
this.checkBox_hiddenfromsearch.Text = "Hidden from search";
this.checkBox_hiddenfromsearch.UseVisualStyleBackColor = true;
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(432, 186);
this.Controls.Add(this.checkBox_hiddenfromsearch);
this.Controls.Add(this.checkboxAfterUploadLinkToClipBoard);
this.Controls.Add(this.label_AfterUpload);
this.Controls.Add(this.label_SafetyLevel);
this.Controls.Add(this.combobox_safetyLevel);
this.Controls.Add(this.checkBoxFriend);
this.Controls.Add(this.checkBoxFamily);
this.Controls.Add(this.checkBoxPublic);
this.Controls.Add(this.label_upload_format);
this.Controls.Add(this.combobox_uploadimageformat);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.LanguageKey = "flickr.settings_title";
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.Text = "Flickr settings";
this.ResumeLayout(false);
this.PerformLayout();
}
private GreenshotPlugin.Controls.GreenshotCheckBox checkBox_hiddenfromsearch;
private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat;
private GreenshotPlugin.Controls.GreenshotLabel label_upload_format;
private GreenshotPlugin.Controls.GreenshotButton buttonCancel;
private GreenshotPlugin.Controls.GreenshotButton buttonOK;
private GreenshotPlugin.Controls.GreenshotCheckBox checkBoxPublic;
private GreenshotPlugin.Controls.GreenshotCheckBox checkBoxFamily;
private GreenshotPlugin.Controls.GreenshotCheckBox checkBoxFriend;
private GreenshotPlugin.Controls.GreenshotLabel label_SafetyLevel;
private GreenshotPlugin.Controls.GreenshotComboBox combobox_safetyLevel;
private GreenshotPlugin.Controls.GreenshotLabel label_AfterUpload;
private GreenshotPlugin.Controls.GreenshotCheckBox checkboxAfterUploadLinkToClipBoard;
}
}

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -19,16 +19,20 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
using GreenshotPlugin.Core;
using GreenshotPlugin.Controls;
namespace GreenshotImmioPlugin {
using GreenshotFlickrPlugin.Forms;
using GreenshotPlugin.Core;
namespace GreenshotFlickrPlugin {
/// <summary>
/// Description of PasswordRequestForm.
/// </summary>
public partial class SettingsForm : ImmioForm {
public SettingsForm(ImmioConfiguration config) : base() {
public partial class SettingsForm : FlickrForm {
private string flickrFrob = string.Empty;
public SettingsForm(FlickrConfiguration config) {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//

View file

@ -2,10 +2,10 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<PropertyGroup>
<ProjectGuid>{B7B30064-1034-4C53-AB7C-17A007360C19}</ProjectGuid>
<ProjectGuid>{7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>GreenshotImmioPlugin</RootNamespace>
<AssemblyName>GreenshotImmioPlugin</AssemblyName>
<RootNamespace>GreenshotFlickrPlugin</RootNamespace>
<AssemblyName>GreenshotFlickrPlugin</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -13,16 +13,12 @@
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\Greenshot\Lib\log4net.dll</HintPath>
<HintPath>..\lib\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
@ -30,56 +26,56 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Forms\ImmioForm.cs" />
<Compile Include="FlickrCredentials.cs" />
<Compile Include="FlickrDestination.cs" />
<Compile Include="Forms\FlickrForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
<Compile Include="ImmioDestination.cs" />
<Compile Include="ImmioPlugin.cs" />
<Compile Include="ImmioConfiguration.cs" />
<Compile Include="ImmioUtils.cs" />
<Compile Include="FlickrPlugin.cs" />
<Compile Include="FlickrConfiguration.cs" />
<Compile Include="FlickrUtils.cs" />
<Compile Include="LanguageKeys.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="Languages\language_immioplugin-en-US.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<None Include="Languages\language_flickrplugin-en-US.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType>
</None>
<None Include="Properties\AssemblyInfo.cs.template" />
<EmbeddedResource Include="ImmioPlugin.resx">
<DependentUpon>ImmioPlugin.cs</DependentUpon>
<EmbeddedResource Include="FlickrPlugin.resx">
<DependentUpon>FlickrPlugin.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj">
<None Include="flickr.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Greenshot\GreenshotPlugin\GreenshotPlugin.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>GreenshotPlugin</Name>
</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)"
<PostBuildEvent>if exist "$(ProjectDir)FlickrCredentials.orig.cs" (
rename "$(ProjectDir)FlickrCredentials.cs" "FlickrCredentials.private.cs"
rename "$(ProjectDir)FlickrCredentials.orig.cs" "FlickrCredentials.cs"
) else exit /b -1
mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\"
mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\"
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\"</PostBuildEvent>
<PreBuildEvent>"$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs"
if exist "$(ProjectDir)FlickrCredentials.private.cs" (
rename "$(ProjectDir)FlickrCredentials.cs" "FlickrCredentials.orig.cs"
rename "$(ProjectDir)FlickrCredentials.private.cs" "FlickrCredentials.cs"
) else exit /b -1</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<RegisterForComInterop>False</RegisterForComInterop>
@ -88,11 +84,25 @@ copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languag
<PlatformTarget>x86</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>TRACE</DefineConstants>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DebugType>None</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
</Project>

View file

@ -1,6 +1,6 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -18,25 +18,18 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
namespace GreenshotOfficeCommunicatorPlugin {
namespace GreenshotFlickrPlugin {
public enum LangKey {
upload_menu_item,
settings_title,
label_url,
label_upload_format,
label_clear,
OK,
CANCEL,
upload_success,
upload_failure,
communication_wait,
delete_question,
clear_question,
delete_title,
use_page_link,
history,
configure
Configure,
label_HiddenFromSearch,
label_SafetyLevel,
label_AfterUpload,
label_AfterUploadLinkToClipBoard
}
}

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="English" ietf="en-US" version="1.0.0">
<resources>
<resource name="label_HiddenFromSearch">
Hidden form search
</resource>
<resource name="label_SafetyLevel">
Safety level
</resource>
<resource name="label_AfterUploadLinkToClipBoard">
Link to clipboard
</resource>
<resource name="label_AfterUpload">
After upload
</resource>
<resource name="Configure">
Configure Flickr
</resource>
<resource name="upload_menu_item">
Upload to Flickr
</resource>
<resource name="settings_title">
Flickr settings
</resource>
<resource name="upload_success">
Successfully uploaded image to Flickr!
</resource>
<resource name="upload_failure">
An error occured while uploading to Flickr:
</resource>
<resource name="label_upload_format">
Image format
</resource>
<resource name="communication_wait">
Communicating with Flickr. Please wait...
</resource>
<resource name="public">
Public
</resource>
<resource name="family">
Family
</resource>
<resource name="friend">
Fiend
</resource>
</resources>
</language>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Français" ietf="fr-FR" version="1.0.0" languagegroup="">
<resources>
<resource name="communication_wait">Communication en cours avec Flickr. Veuillez patientez...</resource>
<resource name="Configure">Configurer Flickr</resource>
<resource name="family">Famille</resource>
<resource name="friend">Ami</resource>
<resource name="label_AfterUpload">Après téléversement</resource>
<resource name="label_AfterUploadLinkToClipBoard">Copier le lien dans le presse-papier</resource>
<resource name="label_HiddenFromSearch">Caché dans les recherches</resource>
<resource name="label_SafetyLevel">Niveau de sécurité</resource>
<resource name="label_upload_format">Format image</resource>
<resource name="public">Publique</resource>
<resource name="settings_title">Paramètres Flickr</resource>
<resource name="upload_failure">Une erreur s'est produite lors du téléversement vers Flickr :</resource>
<resource name="upload_menu_item">Téléverser vers Flickr</resource>
<resource name="upload_success">Image téléversée aves succès vers Flickr !</resource>
</resources>
</language>

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Italiano" ietf="it-IT" version="1.0.0">
<resources>
<resource name="label_HiddenFromSearch">
Visibilità
</resource>
<resource name="label_SafetyLevel">
Liv. sicurezza
</resource>
<resource name="label_AfterUploadLinkToClipBoard">
Collegamento agli appunti
</resource>
<resource name="label_AfterUpload">
Dopo il carico
</resource>
<resource name="Configure">
Configurazione Flickr
</resource>
<resource name="upload_menu_item">
Carica su Flickr
</resource>
<resource name="settings_title">
Impostazioni di Flickr
</resource>
<resource name="upload_success">
Immagine caricata correttamente su Flickr!
</resource>
<resource name="upload_failure">
Si è verificato un errore durante il caricamento su Flickr:
</resource>
<resource name="label_upload_format">
Formato immagine
</resource>
<resource name="communication_wait">
Comunicazione con Flickr. Attendere prego...
</resource>
<resource name="public">
Pubblica
</resource>
<resource name="family">
Famiglia
</resource>
<resource name="friend">
Amici
</resource>
</resources>
</language>

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Русский" ietf="ru-RU" version="1.0.0">
<resources>
<resource name="label_HiddenFromSearch">
Поиск скрытых форм </resource>
<resource name="label_SafetyLevel">
Уровень безопасности </resource>
<resource name="label_AfterUploadLinkToClipBoard">
Ссылка в буфер обмена </resource>
<resource name="label_AfterUpload">
После загрузки </resource>
<resource name="Configure">
Настройка Flickr
</resource>
<resource name="upload_menu_item">
Загрузить на Flickr
</resource>
<resource name="settings_title">
Параметры Flickr
</resource>
<resource name="upload_success">
Изображение успешно загружено на Flickr!
</resource>
<resource name="upload_failure">
Произошла ошибка при загрузке на Flickr:
</resource>
<resource name="label_upload_format">
Формат изображения </resource>
<resource name="communication_wait">
Общение с Flickr. Подождите...
</resource>
<resource name="public">
Общество </resource>
<resource name="family">
Семья </resource>
<resource name="friend">
Друг
</resource>
</resources>
</language>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Українська" ietf="uk-UA" version="1.0.0">
<resources>
<resource name="label_HiddenFromSearch">Приховати з пошуку</resource>
<resource name="label_SafetyLevel">Рівень безпеки</resource>
<resource name="label_AfterUploadLinkToClipBoard">Посилання в буфер обміну</resource>
<resource name="label_AfterUpload">Після вивантаження</resource>
<resource name="Configure">Налаштувати Flickr</resource>
<resource name="upload_menu_item">Вивантажити на Flickr</resource>
<resource name="settings_title">Параметри Flickr</resource>
<resource name="upload_success">Зображення вдало вивантажено на Flickr!</resource>
<resource name="upload_failure">Відбулась помилка при вивантаженні зображення на Flickr:</resource>
<resource name="label_upload_format">Формат зображення</resource>
<resource name="communication_wait">З’єднання з Flickr. Будь ласка, зачекайте...</resource>
<resource name="public">Загальне</resource>
<resource name="family">Родина</resource>
<resource name="friend">Друзі</resource>
</resources>
</language>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="简体中文" ietf="zh-CN" version="1.0.3" languagegroup="a">
<resources>
<resource name="communication_wait">正在连接到Flickr。请稍后...</resource>
<resource name="Configure">配置Flickr</resource>
<resource name="family">家庭</resource>
<resource name="friend">朋友</resource>
<resource name="label_AfterUpload">上传之后</resource>
<resource name="label_AfterUploadLinkToClipBoard">复制链接到剪贴板</resource>
<resource name="label_HiddenFromSearch">从搜索结果中隐藏</resource>
<resource name="label_SafetyLevel">安全级别</resource>
<resource name="label_upload_format">图片格式</resource>
<resource name="public">公开</resource>
<resource name="settings_title">Flickr设置</resource>
<resource name="upload_failure">上除到Flickr时发生错误</resource>
<resource name="upload_menu_item">上传到Flickr</resource>
<resource name="upload_success">图片已成功上传到了Flickr</resource>
</resources>
</language>

View file

@ -1,6 +1,6 @@
/*
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2011 Thomas Braun, Jens Klingen, Robin Krom
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
@ -30,15 +30,16 @@ using Greenshot.Plugin;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("GreenshotNetworkImportPlugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("Greenshot-Flickr-Plugin")]
[assembly: AssemblyDescription("A plugin to upload images to Flickr")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Greenshot")]
[assembly: AssemblyProduct("Network import Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2007-2011")]
[assembly: AssemblyCompany("Greenshot & F. Noel")]
[assembly: AssemblyProduct("Flickr Plugin")]
[assembly: AssemblyCopyright("Copyright (C) 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: PluginAttribute("GreenshotNetworkImportPlugin.NetworkImportPlugin", false)]
// The PluginAttribute describes the "entryType" and if the plugin is configurable
[assembly: PluginAttribute("GreenshotFlickrPlugin.FlickrPlugin", true)]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
@ -50,4 +51,4 @@ using Greenshot.Plugin;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

View file

@ -51,4 +51,4 @@ using Greenshot.Plugin;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.4.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

View file

@ -1,65 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System.Collections.Generic;
using System.Drawing;
using System.Net;
using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
namespace GreenshotImmioPlugin {
/// <summary>
/// Description of ImmioUtils.
/// </summary>
public class ImmioUtils {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImmioUtils));
private static ImmioConfiguration config = IniConfig.GetIniSection<ImmioConfiguration>();
private ImmioUtils() {
}
/// <summary>
/// Do the actual upload to Immio
/// </summary>
/// <param name="image">Image to upload</param>
/// <param name="outputSettings">OutputSettings for the image file format</param>
/// <param name="title">Title</param>
/// <param name="filename">Filename</param>
/// <returns>ImmioInfo with details</returns>
public static string UploadToImmio(Image image, OutputSettings outputSettings, string title, string filename) {
string responseString = null;
HttpWebRequest webRequest = (HttpWebRequest)NetworkHelper.CreateWebRequest("http://imm.io/store/");
webRequest.Method = "POST";
webRequest.ServicePoint.Expect100Continue = false;
IDictionary<string, object> uploadParameters = new Dictionary<string, object>();
uploadParameters.Add("name", filename);
uploadParameters.Add("image", new ImageContainer(image, outputSettings, null));
NetworkHelper.WriteMultipartFormData(webRequest, uploadParameters);
responseString = NetworkHelper.GetResponse(webRequest);
IDictionary<string, object> parsedResponse = JSONHelper.JsonDecode(responseString);
return (string)parsedResponse["uri"];
}
}
}

View file

@ -51,4 +51,4 @@ using Greenshot.Plugin;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.4.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

View file

@ -1,9 +0,0 @@
<html>
<head>
<script src='jquery-1.7.1.min.js' type='text/javascript'></script>
<script src='background.js' type='text/javascript'></script>
</head>
<body>
<canvas id="canvas"></canvas>
</body>
</html>

View file

@ -1,29 +0,0 @@
function sendCaptureToGreenshot(dataURL) {
window.console.info('Sending data...');
$.ajax({
cache: false,
type: "POST",
contentType: "image/png;base64",
dataType: "text",
processData: false,
data: dataURL,
url: 'http://localhost:11234',
success : function (text) {
window.console.info('Got: ' + text);
},
error : function () {
alert("Couldn't send capture, please check if Greenshot is running!");
}
});
}
function capture() {
window.console.info('Starting capture');
try {
chrome.tabs.captureVisibleTab(null, {format:'png'}, captureTaken);
} catch(exception) {
alert( exception.toString());
}
}
chrome.browserAction.onClicked.addListener(function(tab) {capture();});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

File diff suppressed because one or more lines are too long

View file

@ -1,17 +0,0 @@
{
"name": "Greenshot",
"version": "1.0",
"description": "Adds a Greenshot capture button",
"icons": { "128": "greenshot.png" },
"permissions": [
"tabs",
"clipboardRead",
"clipboardWrite",
"http://*/*"
],
"background_page": "background.html",
"browser_action": {
"default_icon": "greenshot.png",
"default_title": "Greenshot"
}
}

View file

@ -1,3 +0,0 @@
content greenshot content/
skin greenshot greenshotskin skin/
overlay chrome://browser/content/browser.xul chrome://greenshot/content/overlay.xul

File diff suppressed because one or more lines are too long

View file

@ -1,181 +0,0 @@
/// Javscript logic for the Greenshot extension
var greenshotPrefObserver = {
register: function() {
// First we'll need the preference services to look for preferences.
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
// For this._branch we ask that the preferences for extensions.myextension. and children
this._branch = prefService.getBranch("extensions.greenshot.");
// Now we queue the interface called nsIPrefBranch2. This interface is described as:
// "nsIPrefBranch2 allows clients to observe changes to pref values."
this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
// Finally add the observer.
this._branch.addObserver("", this, false);
},
unregister: function() {
if (!this._branch) return;
this._branch.removeObserver("", this);
},
readDestination: function() {
return "http://" + this._branch.getCharPref("host") + ":" + this._branch.getIntPref("port");
},
observe: function(aSubject, aTopic, aData) {
if(aTopic != "nsPref:changed") return;
// aSubject is the nsIPrefBranch we're observing (after appropriate QI)
// aData is the name of the pref that's been changed (relative to aSubject)
switch (aData) {
case "host":
this.readDestination();
break;
case "port":
this.readDestination();
break;
}
}
}
greenshotPrefObserver.register();
function doMenuClick() {
capture();
}
function doStatusbarClick() {
capture();
}
function sendImage(dataUrl, title) {
var destination = greenshotPrefObserver.readDestination();
try {
// Send the image via a HTTP Request to our localhost
$.ajax({
cache: false,
type: "POST",
contentType: "image/png;base64",
dataType: "text",
processData: false,
data: dataUrl,
url: destination + '?title=' + escape(encodeUTF8(title)),
success : function (text) {
document.getElementById("statusbar-display").label = "Greenshot: " + text;
},
error : function () {
alert("Couldn't send image to '" + destination + "' please check if Greenshot is running!");
}
});
} catch (exception) {
alert(exception.message);
}
}
///
/// Capture the current opened window
/// and send it to Greenshot
///
function capture() {
// Used variables
var width;
var height;
var xOffset;
var yOffset;
var context;
try {
// Get document width & height
width = $(window.content.document).width();
height = $(window.content.document).height();
// Create canvas
var canvas = window.content.document.createElement('canvas');
// change the canvas size to the document size
canvas.setAttribute('width', width);
canvas.setAttribute('height', height);
// Get the drawing context
context = canvas.getContext("2d");
// Set the scroll location to top-left, so we don't have problems with funny banners that move while scrolling
xOffset = window.content.window.scrollX;
yOffset = window.content.window.scrollY;
window.content.window.scrollTo(0,0);
} catch (exception) {
}
// continue after timeout, so the page is scrolled correctly and has time to move it's items, e.g. for Jira
setTimeout( function(){
try {
// Draw the window to the context
context.drawWindow(window.content.window, 0, 0, width, height, 'rgb(255,255,255)');
window.content.window.scrollTo(xOffset,yOffset);
// Send the canvas
sendImage(canvas.toDataURL("image/png"), window.content.document.title);
} catch (exception) {
alert(exception.message);
}
}, 300);
}
function captureImage(imageToCapture) {
try {
var canvas = window.content.document.createElement('canvas');
// change the canvas size to the document size
canvas.setAttribute('width', imageToCapture.width);
canvas.setAttribute('height', imageToCapture.height);
// Get the drawing context
context = canvas.getContext("2d");
context.drawImage(imageToCapture, 0, 0);
// Get filename from url
var title
if (imageToCapture.alt) {
title =imageToCapture.alt;
} else {
title = imageToCapture.src.replace(/\?.*/,'').replace(/^.*(\\|\/|\:)/, '').replace(/\.[^.]*/,'');
}
// Send the canvas
sendImage(canvas.toDataURL("image/png"), title);
} catch (exception) {
alert(exception.message);
}
}
// private method for UTF-8 encoding
function encodeUTF8(string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
} else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
} else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
}
function ShowHideGreenshotMenuItem(event) {
try {
gContextMenu.showItem("greenshot-menu-item", gContextMenu.onImage);
} catch (exception) {
alert(exception.message);
}
}
function InitializeGreenshotExtension() {
try {
var contextMenu = document.getElementById("contentAreaContextMenu");
if (contextMenu) {
contextMenu.addEventListener("popupshowing", ShowHideGreenshotMenuItem, false);
}
} catch (exception) {
alert(exception.message);
}
}
window.addEventListener("load", InitializeGreenshotExtension, false);

View file

@ -1,14 +0,0 @@
<?xml version="1.0"?>
<overlay id="greenshotOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml">
<script type="text/javascript" src="jquery-1.7.1.min.js"/>
<script type="text/javascript" src="overlay.js"/>
<menupopup id="menu_ToolsPopup">
<menuitem id="greenshotPopupMenuitem" label="Capture with Greenshot" insertbefore="sanitizeSeparator" oncommand="doMenuClick();"/>
</menupopup>
<statusbar id="status-bar">
<statusbarpanel class="statusbarpanel-iconic" id="greenshot_statusbar" onclick="doStatusbarClick();" src="chrome://greenshot/skin/greenshot16.png" />
</statusbar>
<popup id="contentAreaContextMenu">
<menuitem id="greenshot-menu-item" label="Send image to Greenshot" oncommand="captureImage(gContextMenu.target);"/>
</popup>
</overlay>

View file

@ -1,4 +0,0 @@
// Port number to post the screenshot to
pref("extensions.greenshot.port", 11234);
// hostname to post the screenshot to
pref("extensions.greenshot.host", "localhost");

View file

@ -1,28 +0,0 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<!-- Unique ID for extension. Can be in e-mail address format or GUID format -->
<em:id>greenshot@getgreenshot.org</em:id>
<!-- Indicates that this add-on is an extension -->
<em:type>2</em:type>
<!-- Extension name displayed in Add-on Manager -->
<em:name>Greenshot</em:name>
<!-- Extension version number. There is a version numbering scheme you must follow -->
<em:version>0.1</em:version>
<!-- Brief description displayed in Add-on Manager -->
<em:description>A simple capture to Greenshot extension.</em:description>
<!-- Name of extension's primary developer. Change to your name -->
<em:creator>Lakritzator</em:creator>
<!-- Web page address through which extension is distributed -->
<em:homepageURL>http://getgreenshot.org</em:homepageURL>
<!-- This section gives details of the target application for the extension (in this case: Firefox 2) -->
<em:iconURL>chrome://greenshot/skin/greenshot90.png</em:iconURL>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.5.*</em:minVersion>
<em:maxVersion>10.*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

View file

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<Import Project="..\CommonProject.properties" />
<PropertyGroup>
<ProjectGuid>{0D0B7F80-5B8E-4829-8523-E1AC0551E836}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>GreenshotNetworkImportPlugin</RootNamespace>
<AssemblyName>GreenshotNetworkImportPlugin</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkProfile/>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\Greenshot\Lib\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="HTTPReceiver.cs" />
<Compile Include="NetworkImportPlugin.cs" />
<Compile Include="NetworkImportPluginConfiguration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>GreenshotPlugin</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Properties\AssemblyInfo.cs.template" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<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)"
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"</PostBuildEvent>
</PropertyGroup>
</Project>

View file

@ -1,152 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Threading;
using System.IO;
using System.Drawing;
using System.Net;
using System.Text;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
namespace GreenshotNetworkImportPlugin {
public class HTTPReceiver {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(HTTPReceiver));
private string url;
private volatile bool keepGoing = true;
private HttpListener listener = null;
private IGreenshotHost host;
public HTTPReceiver(string url, IGreenshotHost host) {
this.url = url;
this.host = host;
}
public void StartListening() {
Thread serverThread = new Thread(Listen);
serverThread.Name = "HTTP Receiver";
serverThread.SetApartmentState(ApartmentState.STA);
serverThread.Start();
}
public void StopListening() {
keepGoing = false;
Close();
}
private void Listen() {
listener = new HttpListener();
//listener.AuthenticationSchemes = AuthenticationSchemes.Ntlm;
if (!listener.Prefixes.Contains(url)) {
listener.Prefixes.Add(url);
}
listener.Start();
while (true) {
IAsyncResult result = listener.BeginGetContext(new AsyncCallback(ListenerCallback), listener);
while (!result.AsyncWaitHandle.WaitOne(1000)) {
if (!keepGoing) {
Close();
return;
}
}
if (!keepGoing) {
Close();
return;
}
}
}
private void Close() {
if (listener != null) {
listener.Stop();
if (listener.Prefixes != null) {
listener.Prefixes.Remove(url);
}
listener.Close();
listener = null;
}
}
private void ListenerCallback(IAsyncResult result) {
if (listener == null) {
return;
}
try {
HttpListenerContext context = listener.EndGetContext(result);
Thread requestThread = new Thread(ProcessRequest);
requestThread.Name = "Process Request";
requestThread.Start(context);
} catch (HttpListenerException httpE) {
LOG.Error(httpE);
}
}
private void ProcessRequest(object data) {
const string basePrefix = "data:image/png;base64,";
HttpListenerContext context = data as HttpListenerContext;
HttpListenerRequest request = context.Request;
HttpListenerResponse response = context.Response;
LOG.DebugFormat("Content type: {0}", request.ContentType);
if (!request.HasEntityBody) {
LOG.DebugFormat("Empty request to {0}", request.Url);
return;
}
LOG.DebugFormat("Post request to {0}", request.Url);
string possibleImage = null;
using (Stream body = request.InputStream) {
using (StreamReader reader = new StreamReader(body, request.ContentEncoding)) {
possibleImage = reader.ReadToEnd();
}
}
string title = request.QueryString["title"];
LOG.DebugFormat("Title={0}", title);
LOG.DebugFormat("Image={0}", possibleImage.Substring(0,30));
if (possibleImage != null && possibleImage.StartsWith(basePrefix)) {
byte[] imageBytes = Convert.FromBase64String(possibleImage.Substring(basePrefix.Length));
using (MemoryStream memoryStream = new MemoryStream(imageBytes, 0, imageBytes.Length)) {
// Convert byte[] to Image
memoryStream.Write(imageBytes, 0, imageBytes.Length);
using (Image image = Bitmap.FromStream(memoryStream, true)) {
ICapture capture = host.GetCapture(ImageHelper.Clone(image));
capture.CaptureDetails.Title = title;
host.ImportCapture(capture);
}
response.StatusCode = (int)HttpStatusCode.OK;
byte[] content = Encoding.UTF8.GetBytes("Greenshot-OK");
response.ContentType = "text";
response.ContentLength64 = content.Length;
response.OutputStream.Write(content, 0, content.Length);
response.OutputStream.Close();
return;
}
}
response.StatusCode = (int)HttpStatusCode.InternalServerError;
byte[] b = Encoding.UTF8.GetBytes("Greenshot-NOTOK");
response.ContentLength64 = b.Length;
response.OutputStream.Write(b, 0, b.Length);
response.OutputStream.Close();
}
}
}

View file

@ -1,105 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.IO;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
namespace GreenshotNetworkImportPlugin {
/// <summary>
/// NetworkImportPlugin can receive images via the network
/// </summary>
public class NetworkImportPlugin : IGreenshotPlugin {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(NetworkImportPlugin));
private IGreenshotHost host;
private PluginAttribute myAttributes;
private HTTPReceiver httpReceiver = null;
private NetworkImportPluginConfiguration config;
public NetworkImportPlugin() {
}
public IEnumerable<IDestination> Destinations() {
yield break;
}
public IEnumerable<IProcessor> Processors() {
yield break;
}
/// <summary>
/// Implementation of the IGreenshotPlugin.Initialize
/// </summary>
/// <param name="host">Use the IGreenshotPluginHost interface to register events</param>
/// <param name="captureHost">Use the ICaptureHost interface to register in the MainContextMenu</param>
/// <param name="pluginAttribute">My own attributes</param>
public bool Initialize(IGreenshotHost host, PluginAttribute myAttributes) {
LOG.Debug("Initialize called of " + myAttributes.Name);
this.host = (IGreenshotHost)host;
this.myAttributes = myAttributes;
// Load configuration
config = IniConfig.GetIniSection<NetworkImportPluginConfiguration>();
// check validity
if (!config.ListenerURL.EndsWith("/")) {
config.ListenerURL = config.ListenerURL + "/";
config.IsDirty = true;
IniConfig.Save();
}
IniConfig.IniChanged += new FileSystemEventHandler(ReloadConfiguration);
ReloadConfiguration(null, null);
return true;
}
private void ReloadConfiguration(object source, FileSystemEventArgs e) {
if (httpReceiver != null) {
httpReceiver.StopListening();
httpReceiver = null;
}
if (config.RemoteEnabled) {
httpReceiver = new HTTPReceiver(config.ListenerURL, host);
httpReceiver.StartListening();
}
}
/// <summary>
/// Implementation of the IGreenshotPlugin.Shutdown
/// </summary>
public void Shutdown() {
LOG.Debug("Shutdown of " + myAttributes.Name);
if (httpReceiver != null) {
httpReceiver.StopListening();
httpReceiver = null;
}
IniConfig.IniChanged -= new FileSystemEventHandler(ReloadConfiguration);
}
/// <summary>
/// Implementation of the IPlugin.Configure
/// </summary>
public virtual void Configure() {
return;
}
}
}

View file

@ -1,37 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
namespace GreenshotNetworkImportPlugin {
/// <summary>
/// Description of NetworkImportPluginConfiguration.
/// </summary>
[IniSection("NetworkImport", Description="Greenshot Network Import Plugin configuration")]
public class NetworkImportPluginConfiguration : IniSection {
[IniProperty("RemoteEnabled", Description="Is remote access enabled", DefaultValue="False")]
public bool RemoteEnabled;
[IniProperty("ListenerURL", Description="The URL to listen on", DefaultValue="http://localhost:11234/")]
public string ListenerURL;
}
}

View file

@ -51,4 +51,4 @@ using Greenshot.Plugin;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.4.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

View file

@ -1,187 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using CommunicatorAPI;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using GreenshotPlugin.Core;
namespace GreenshotOfficeCommunicatorPlugin {
public class Communicator {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(Communicator));
private bool connected = false;
private CommunicatorAPI.Messenger communicator = null;
private Dictionary<long, CommunicatorConversation> communicatorConversations = new Dictionary<long, CommunicatorConversation>();
public Communicator() {
}
public bool isConnected {
get {
return connected;
}
}
public bool hasConversations {
get {
return communicatorConversations.Count > 0;
}
}
public IEnumerable<CommunicatorConversation> Conversations {
get {
foreach (CommunicatorConversation conversation in communicatorConversations.Values) {
yield return conversation;
}
}
}
// A simple implementation of signing in.
public void Signin(string account, string passwd) {
if (connected)
return;
if (communicator == null) {
// Create a Messenger object, if necessary
communicator = new CommunicatorAPI.Messenger();
// Register event handlers for OnSignin and Signout events
communicator.OnSignin += new DMessengerEvents_OnSigninEventHandler(communicator_OnSignin);
communicator.OnSignout += new DMessengerEvents_OnSignoutEventHandler(communicator_OnSignout);
communicator.OnIMWindowCreated += new DMessengerEvents_OnIMWindowCreatedEventHandler(communicator_OnIMWindowCreated);
communicator.OnIMWindowDestroyed += new DMessengerEvents_OnIMWindowDestroyedEventHandler(communicator_OnIMWindowDestroyed);
}
if (account == null) {
communicator.AutoSignin();
} else {
communicator.Signin(0, account, passwd);
}
}
// Event handler for OnSignin event.
void communicator_OnSignin(int hr) {
if (hr != 0) {
Console.WriteLine("Signin failed.");
return;
}
connected = true;
}
void communicator_OnSignout() {
connected = false;
// Release the unmanaged resource.
Marshal.ReleaseComObject(communicator);
communicator = null;
}
// Register for IMWindowCreated event to receive the
// conversation window object. Other window objects can
// received via this event handling as well.
void communicator_OnIMWindowCreated(object pIMWindow) {
try {
IMessengerConversationWndAdvanced imWindow = (IMessengerConversationWndAdvanced)pIMWindow;
CommunicatorConversation conversation = null;
if (communicatorConversations.ContainsKey(imWindow.HWND)) {
conversation = communicatorConversations[imWindow.HWND];
} else {
conversation = new CommunicatorConversation(imWindow.HWND);
communicatorConversations.Add(imWindow.HWND, conversation);
}
conversation.ImWindow = imWindow;
} catch (Exception exception) {
LOG.Error(exception);
}
}
void communicator_OnIMWindowDestroyed(object pIMWindow) {
try {
IMessengerConversationWndAdvanced imWindow = (IMessengerConversationWndAdvanced)pIMWindow;
CommunicatorConversation foundConversation = null;
long foundHwnd = 0;
foreach (long hwndKey in communicatorConversations.Keys) {
if (imWindow.Equals(communicatorConversations[hwndKey].ImWindow)) {
foundConversation = communicatorConversations[hwndKey];
foundConversation.ImWindow = null;
foundHwnd = hwndKey;
break;
}
}
if (foundConversation != null) {
communicatorConversations.Remove(foundHwnd);
}
Marshal.ReleaseComObject(pIMWindow);
} catch (Exception exception) {
LOG.Error(exception);
}
}
public CommunicatorConversation StartConversation(string account) {
object[] sipUris = { account };
CommunicatorAPI.IMessengerAdvanced msgrAdv = communicator as CommunicatorAPI.IMessengerAdvanced;
CommunicatorConversation communicatorConversation = null;
if (msgrAdv != null) {
try {
object obj = msgrAdv.StartConversation(
CONVERSATION_TYPE.CONVERSATION_TYPE_IM, // Type of conversation
sipUris, // object array of signin names for having multiple conversations
null,
"Testing",
"1",
null);
long hwnd = long.Parse(obj.ToString());
if (!communicatorConversations.ContainsKey(hwnd)) {
communicatorConversations.Add(hwnd, new CommunicatorConversation(hwnd));
}
communicatorConversation = communicatorConversations[hwnd];
} catch (Exception ex) {
LOG.Error(ex);
}
}
return communicatorConversation;
}
public void ShowContacts() {
// Display contacts to a console window(for illustration only).
foreach (IMessengerContact contact in communicator.MyContacts as IMessengerContacts) {
if (!contact.IsSelf) {
Console.WriteLine("{0} ({1})", contact.SigninName, contact.Status);
}
}
}
// A simple implementation of signing out.
public void Signout() {
if (!connected) {
return;
}
if (communicator == null) {
return;
}
communicator.Signout();
}
}
}

View file

@ -1,84 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.Text;
using CommunicatorAPI;
using System.Runtime.InteropServices;
using GreenshotPlugin.Core;
namespace GreenshotOfficeCommunicatorPlugin {
public class CommunicatorConversation {
private IMessengerConversationWndAdvanced imWindow = null;
private long hwnd = 0;
private Queue<string> queuedText = new Queue<string>();
public CommunicatorConversation(long hwnd) {
this.hwnd = hwnd;
}
public bool isActive {
get {
return imWindow != null;
}
}
public IMessengerConversationWndAdvanced ImWindow {
get {
return imWindow;
}
set {
imWindow = value;
if (imWindow != null) {
while (queuedText.Count > 0 && imWindow != null) {
SendTextMessage(queuedText.Dequeue());
}
} else {
hwnd = 0;
}
}
}
// Send text only if the window object matches the desired window handle
public void SendTextMessage(string msg) {
if (imWindow != null) {
imWindow.SendText(msg);
} else {
queuedText.Enqueue(msg);
}
}
public string History {
get {
return imWindow.History;
}
}
public string Title {
get {
if (imWindow != null) {
return new WindowDetails(new IntPtr(hwnd)).Text;
}
return null;
}
}
}
}

View file

@ -1,96 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace GreenshotOfficeCommunicatorPlugin {
partial class SettingsForm {
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.buttonOK = new GreenshotPlugin.Controls.GreenshotButton();
this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.LanguageKey = "officecommunicator.OK";
this.buttonOK.Location = new System.Drawing.Point(222, 11);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 2;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOKClick);
//
// buttonCancel
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.LanguageKey = "officecommunicator.CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(303, 11);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 3;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(387, 46);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.LanguageKey = "officecommunicator.settings_title";
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.Text = "Office Communicator settings";
this.ResumeLayout(false);
}
private GreenshotPlugin.Controls.GreenshotButton buttonCancel;
private GreenshotPlugin.Controls.GreenshotButton buttonOK;
}
}

View file

@ -1,92 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\CommonProject.properties" />
<PropertyGroup>
<ProjectGuid>{C1050323-F237-43E2-90F9-1D620F29252F}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>GreenshotOfficeCommunicatorPlugin</RootNamespace>
<AssemblyName>GreenshotOfficeCommunicatorPlugin</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="CommunicatorAPI, Version=2.0.6362.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>DLL\CommunicatorAPI.dll</HintPath>
</Reference>
<Reference Include="CommunicatorPrivate, Version=2.0.6362.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>DLL\CommunicatorPrivate.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\Greenshot\Lib\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Communicator.cs" />
<Compile Include="CommunicatorConversation.cs" />
<Compile Include="Forms\OfficeCommunicatorForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
<Compile Include="OfficeCommunicatorDestination.cs" />
<Compile Include="OfficeCommunicatorPlugin.cs" />
<Compile Include="OfficeCommunicatorConfiguration.cs" />
<Compile Include="LanguageKeys.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="Languages\language_officecommunicatorplugin-en-US.xml">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Include="Properties\AssemblyInfo.cs.template" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj">
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
<Name>GreenshotPlugin</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Forms\SettingsForm.resx">
<DependentUpon>SettingsForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="DLL\CommunicatorPrivate.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="DLL\CommunicatorAPI.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</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)"
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"
copy "$(ProjectDir)\DLL\*.dll" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)
mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)"
copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\"</PostBuildEvent>
</PropertyGroup>
</Project>

View file

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="English" ietf="en-US" version="1.0.0">
<resources>
<resource name="upload_menu_item">
Upload to Office Communicator
</resource>
<resource name="settings_title">
Office Communicator settings
</resource>
<resource name="OK">
OK
</resource>
<resource name="CANCEL">
Cancel
</resource>
<resource name="upload_success">
Successfully uploaded image to Office Communicator!
</resource>
<resource name="upload_failure">
An error occured while uploading to Office Communicator:
</resource>
<resource name="label_upload_format">
Image format
</resource>
<resource name="communication_wait">
Communicating with Office Communicator. Please wait...
</resource>
<resource name="configure">
Configure
</resource>
</resources>
</language>

View file

@ -1,125 +0,0 @@
/*
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
*
* For more information see: http://getgreenshot.org/
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
using Greenshot.IniFile;
namespace GreenshotOfficeCommunicatorPlugin {
/// <summary>
/// Description of OfficeCommunicatorDestination.
/// </summary>
public class OfficeCommunicatorDestination : AbstractDestination {
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OfficeCommunicatorDestination));
private static OfficeCommunicatorConfiguration config = IniConfig.GetIniSection<OfficeCommunicatorConfiguration>();
private OfficeCommunicatorPlugin plugin = null;
private static string exePath = null;
private static Image applicationIcon = null;
private CommunicatorConversation conversation = null;
static OfficeCommunicatorDestination() {
exePath = PluginUtils.GetExePath("communicator.exe");
if (exePath != null && File.Exists(exePath)) {
applicationIcon = PluginUtils.GetExeIcon(exePath, 0);
} else {
exePath = null;
}
}
public OfficeCommunicatorDestination(OfficeCommunicatorPlugin plugin) {
this.plugin = plugin;
}
public OfficeCommunicatorDestination(OfficeCommunicatorPlugin plugin, CommunicatorConversation conversation) : this(plugin) {
this.conversation = conversation;
}
public override string Designation {
get {
return "OfficeCommunicator";
}
}
public override string Description {
get {
if (conversation == null) {
return Language.GetString("officecommunicator", LangKey.upload_menu_item);
} else {
return Language.GetString("officecommunicator", LangKey.upload_menu_item) + " - " + conversation.Title;
}
}
}
public override Image DisplayIcon {
get {
return applicationIcon;
}
}
public override bool isActive {
get {
return base.isActive && exePath != null && ((conversation == null && plugin.Communicator.hasConversations) || (conversation != null && conversation.isActive));
}
}
public override IEnumerable<IDestination> DynamicDestinations() {
foreach (CommunicatorConversation conversation in plugin.Communicator.Conversations) {
if (conversation.isActive) {
yield return new OfficeCommunicatorDestination(plugin, conversation);
}
}
}
public override bool isDynamic {
get {
return true;
}
}
public override bool useDynamicsOnly {
get {
return true;
}
}
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
if (conversation != null) {
ExportInformation internalExportInformation = plugin.Host.ExportCapture(false, config.DestinationDesignation, surface, captureDetails);
if (internalExportInformation != null && internalExportInformation.ExportMade) {
exportInformation.ExportMade = true;
if (!string.IsNullOrEmpty(internalExportInformation.Uri)) {
conversation.SendTextMessage("Greenshot sends you: " + internalExportInformation.Uri);
} else if (!string.IsNullOrEmpty(internalExportInformation.Filepath)) {
conversation.SendTextMessage(@"Greenshot sends you: file://" + internalExportInformation.Filepath);
}
}
}
return exportInformation;
}
}
}

View file

@ -51,4 +51,4 @@ using Greenshot.Plugin;
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.4.$WCREV$")]
[assembly: AssemblyVersion("1.0.5.$WCREV$")]

View file

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Deutsch" ietf="de-DE" version="1.0.0">
<resources>
<resource name="upload_menu_item">
Zu Photobucket hochladen
</resource>
<resource name="settings_title">
Photobucket Einstellungen
</resource>
<resource name="label_url">
Url
</resource>
<resource name="OK">
OK
</resource>
<resource name="CANCEL">
Cancel
</resource>
<resource name="upload_success">
Das Hochladen zu Photobucket war erfolgreich.
</resource>
<resource name="upload_failure">
Es gab einen Fehler beim Hochladen zu Photobucket:
</resource>
<resource name="label_upload_format">
Bildformat
</resource>
<resource name="communication_wait">
Übermittle Daten zu Photobucket. Bitte warten...
</resource>
<resource name="delete_question">
Sind Sie sicher das sie das Bild {0} von Photobucket löschen möchte?
</resource>
<resource name="clear_question">
Sind Sie sicher das sie den lokalen Photobucket Verlauf löschen möchte?
</resource>
<resource name="delete_title">
Photobucket {0} löschen
</resource>
<resource name="use_page_link">
Benutze der Seite-URL statt Bild-URL im Zwischenablage
</resource>
<resource name="history">
Verlauf
</resource>
<resource name="configure">
Einstellungen
</resource>
</resources>
</language>

View file

@ -1,53 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="English" ietf="en-US" version="1.0.0">
<resources>
<resource name="upload_menu_item">
Upload to Photobucket
</resource>
<resource name="settings_title">
Photobucket settings
</resource>
<resource name="label_url">
Url
</resource>
<resource name="OK">
OK
</resource>
<resource name="CANCEL">
Cancel
</resource>
<resource name="upload_success">
Successfully uploaded image to Photobucket!
</resource>
<resource name="upload_failure">
An error occured while uploading to Photobucket:
</resource>
<resource name="label_upload_format">
Image format
</resource>
<resource name="communication_wait">
Communicating with Photobucket. Please wait...
</resource>
<resource name="delete_question">
Are you sure you want to delete the image {0} from Photobucket?
</resource>
<resource name="clear_question">
Are you sure you want to delete the local Photobucket history?
</resource>
<resource name="delete_title">
Delete Photobucket {0}
</resource>
<resource name="anonymous_access">
Use anonymous access
</resource>
<resource name="use_page_link">
Use page link instead of image link on clipboard
</resource>
<resource name="history">
History
</resource>
<resource name="configure">
Configure
</resource>
</resources>
</language>

View file

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Français" ietf="fr-FR" version="0.8.0">
<resources>
<resource name="upload_menu_item">
Téléverser vers Photobucket
</resource>
<resource name="settings_title">
Paramètres Photobucket
</resource>
<resource name="label_url">
URL
</resource>
<resource name="label_use_proxy">
Utiliser proxy
</resource>
<resource name="OK">
OK
</resource>
<resource name="CANCEL">
Annuler
</resource>
<resource name="upload_success">
L'image a été téléversée vers Photobucket avec succès !
</resource>
<resource name="upload_failure">
Une erreur est survenue lors du téléversement vers Photobucket:
</resource>
<resource name="label_upload_format">
Format d'image
</resource>
<resource name="upload_wait">
Téléversement vers Photobucket, veuillez patienter...
</resource>
<resource name="history">
Histoire
</resource>
<resource name="configure">
Configurer
</resource>
</resources>
</language>

View file

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Italiano" ietf="it-IT" version="1.0.0">
<resources>
<resource name="upload_menu_item">
Carica su Imgur
</resource>
<resource name="settings_title">
Impostazioni Imgur
</resource>
<resource name="label_url">
Url
</resource>
<resource name="OK">
OK
</resource>
<resource name="CANCEL">
Annulla
</resource>
<resource name="upload_success">
Immagine caricata correttamente su Imgur!
</resource>
<resource name="upload_failure">
Si è verificato un problema durante il collegamento:
</resource>
<resource name="label_upload_format">
Formato immagine
</resource>
<resource name="communication_wait">
Comunicazione con Imgur. Attendere prego...
</resource>
<resource name="delete_question">
Sei sicuro si voler eliminare l'immagine {0} da Imgur?
</resource>
<resource name="clear_question">
Sei sicuro si voler eliminare la cronologia locale di Imgur?
</resource>
<resource name="delete_title">
Elimina Imgur {0}
</resource>
<resource name="use_page_link">
Usa il collegamento alla pagina invece di quello all'immagine su appunti
</resource>
<resource name="history">
Cronologia
</resource>
<resource name="configure">
Configurazione
</resource>
</resources>
</language>

View file

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Nederlands" ietf="nl-NL" version="1.0.0">
<resources>
<resource name="upload_menu_item">
Naar Photobucket uploaden
</resource>
<resource name="settings_title">
Photobucket instellingen
</resource>
<resource name="label_url">
Url
</resource>
<resource name="OK">
OK
</resource>
<resource name="CANCEL">
Afbreken
</resource>
<resource name="upload_success">
Het uploaden naar Photobucket is geslaagt!
</resource>
<resource name="upload_failure">
Tijdens het uploaden naar Photobucket is een fout opgetreden:
</resource>
<resource name="label_upload_format">
Beeld formaat
</resource>
<resource name="communication_wait">
Data overdraging naar Photobucket, wachten AUB...
</resource>
<resource name="delete_question">
Weet U zeker dat U het beeld {0} van Photobucket verwijderen wilt?
</resource>
<resource name="clear_question">
Weet U zeker dat U de locale Photobucket historie verwijderen wilt?
</resource>
<resource name="delete_title">
Photobucket {0} verwijderen
</resource>
<resource name="use_page_link">
Kopieer de pagina link in plaats van de beeld link in het klembord
</resource>
<resource name="history">
Verloop
</resource>
<resource name="configure">
Instellingen
</resource>
</resources>
</language>

View file

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<language description="Русский" ietf="ru-RU" version="1.0.0">
<resources>
<resource name="upload_menu_item">
Загрузить на Imgur
</resource>
<resource name="settings_title">
Imgur параметры
</resource>
<resource name="label_url">
Url
</resource>
<resource name="OK">
OK
</resource>
<resource name="CANCEL">
Отмена
</resource>
<resource name="upload_success">
Изображение успешно загружено на Imgur!
</resource>
<resource name="upload_failure">
Произошла ошибка при загрузке на Imgur:
</resource>
<resource name="label_upload_format">
Формат изображения
</resource>
<resource name="communication_wait">
Общение с Imgur. Подождите...
</resource>
<resource name="delete_question">
Вы действительно хотите удалить изображение {0} из Imgur?
</resource>
<resource name="clear_question">
Вы действительно хотите удалить местную историю Imgur?
</resource>
<resource name="delete_title">
Удалить Imgur {0}
</resource>
<resource name="use_page_link">
Использовать ссылку страницы, вместо ссылки изображения в буфере обмена
</resource>
<resource name="history">
История
</resource>
<resource name="configure">
Настройка
</resource>
</resources>
</language>

Some files were not shown because too many files have changed in this diff Show more