mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Preparations for the language changes
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1781 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
6f438b2a6c
commit
0ace8c2ccf
9 changed files with 28 additions and 75 deletions
|
@ -72,14 +72,14 @@ namespace GreenshotImgurPlugin {
|
|||
ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem("Imgur");
|
||||
itemPlugInRoot.Image = (Image)resources.GetObject("Imgur");
|
||||
|
||||
historyMenuItem = new ToolStripMenuItem(Language.GetString("imgur", LangKey.imgur_history));
|
||||
historyMenuItem = new ToolStripMenuItem(Language.GetString("imgur", LangKey.history));
|
||||
historyMenuItem.Tag = host;
|
||||
historyMenuItem.Click += delegate {
|
||||
ImgurHistory.ShowHistory();
|
||||
};
|
||||
itemPlugInRoot.DropDownItems.Add(historyMenuItem);
|
||||
|
||||
ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(Language.GetString("imgur", LangKey.imgur_configure));
|
||||
ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(Language.GetString("imgur", LangKey.configure));
|
||||
itemPlugInConfig.Tag = host;
|
||||
itemPlugInConfig.Click += delegate {
|
||||
config.ShowConfigDialog();
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace GreenshotImgurPlugin {
|
|||
clear_question,
|
||||
delete_title,
|
||||
use_page_link,
|
||||
imgur_history,
|
||||
imgur_configure
|
||||
history,
|
||||
configure
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ namespace GreenshotJiraPlugin {
|
|||
private JiraConnector jiraConnector;
|
||||
private JiraIssue selectedIssue;
|
||||
private ListViewColumnSorter columnSorter;
|
||||
private ILanguage language = Language.GetInstance();
|
||||
private JiraConfiguration config = IniConfig.GetIniSection<JiraConfiguration>();
|
||||
|
||||
public JiraForm(JiraConnector jiraConnector) {
|
||||
|
@ -51,16 +50,16 @@ namespace GreenshotJiraPlugin {
|
|||
jiraConnector.login();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
MessageBox.Show(language.GetFormattedString(LangKey.login_error, e.Message));
|
||||
MessageBox.Show(Language.GetFormattedString("jira", LangKey.login_error, e.Message));
|
||||
}
|
||||
uploadButton.Enabled = false;
|
||||
updateForm();
|
||||
}
|
||||
|
||||
private void initializeComponentText() {
|
||||
this.label_jirafilter.Text = language.GetString(LangKey.label_jirafilter);
|
||||
this.label_comment.Text = language.GetString(LangKey.label_comment);
|
||||
this.label_filename.Text = language.GetString(LangKey.label_filename);
|
||||
this.label_jirafilter.Text = Language.GetString("jira", LangKey.label_jirafilter);
|
||||
this.label_comment.Text = Language.GetString("jira", LangKey.label_comment);
|
||||
this.label_filename.Text = Language.GetString("jira", LangKey.label_filename);
|
||||
}
|
||||
|
||||
private void updateForm() {
|
||||
|
@ -127,7 +126,7 @@ namespace GreenshotJiraPlugin {
|
|||
|
||||
private void jiraFilterBox_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (jiraConnector.isLoggedIn) {
|
||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, language.GetString(LangKey.communication_wait));
|
||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, Language.GetString("jira", LangKey.communication_wait));
|
||||
try {
|
||||
uploadButton.Enabled = false;
|
||||
JiraFilter filter = (JiraFilter)jiraFilterBox.SelectedItem;
|
||||
|
@ -141,7 +140,7 @@ namespace GreenshotJiraPlugin {
|
|||
jiraListView.Columns.Clear();
|
||||
LangKey[] columns = { LangKey.column_id, LangKey.column_created, LangKey.column_assignee, LangKey.column_reporter, LangKey.column_summary };
|
||||
foreach (LangKey column in columns) {
|
||||
jiraListView.Columns.Add(language.GetString(column));
|
||||
jiraListView.Columns.Add(Language.GetString("jira", column));
|
||||
}
|
||||
foreach (JiraIssue issue in issues) {
|
||||
ListViewItem item = new ListViewItem(issue.Key);
|
||||
|
@ -161,8 +160,6 @@ namespace GreenshotJiraPlugin {
|
|||
} finally {
|
||||
backgroundForm.CloseDialog();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ namespace GreenshotJiraPlugin {
|
|||
/// </summary>
|
||||
public partial class SettingsForm : GreenshotPlugin.Controls.GreenshotForm {
|
||||
public SettingsForm(JiraConfiguration config) {
|
||||
language = Language.GetInstance();
|
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{19FEEF09-313F-43C7-819D-F1BCA782B08B}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -53,12 +53,16 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Forms\JiraForm.cs" />
|
||||
<Compile Include="Forms\JiraForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\JiraForm.Designer.cs">
|
||||
<DependentUpon>JiraForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ListViewColumnSorter.cs" />
|
||||
<Compile Include="Forms\SettingsForm.cs" />
|
||||
<Compile Include="Forms\SettingsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\SettingsForm.Designer.cs">
|
||||
<DependentUpon>SettingsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -67,7 +71,6 @@
|
|||
<Compile Include="JiraDestination.cs" />
|
||||
<Compile Include="JiraPlugin.cs" />
|
||||
<Compile Include="JiraUtils.cs" />
|
||||
<Compile Include="Language.cs" />
|
||||
<Compile Include="LanguageKeys.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Web References\JiraSoap\Reference.cs">
|
||||
|
@ -99,8 +102,6 @@
|
|||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Forms" />
|
||||
<Folder Include="Languages" />
|
||||
<WebReferences Include="Web References\" />
|
||||
<WebReferenceUrl Include="http://jira/rpc/soap/jirasoapservice-v2%3fwsdl">
|
||||
<UrlBehavior>Static</UrlBehavior>
|
||||
|
|
|
@ -102,7 +102,6 @@ namespace Jira {
|
|||
private const string AUTH_FAILED_EXCEPTION_NAME = "com.atlassian.jira.rpc.exception.RemoteAuthenticationException";
|
||||
private static JiraConfiguration config = IniConfig.GetIniSection<JiraConfiguration>();
|
||||
public const string DEFAULT_POSTFIX = "/rpc/soap/jirasoapservice-v2?wsdl";
|
||||
private ILanguage lang = Language.GetInstance();
|
||||
private string credentials;
|
||||
private DateTime loggedInTime = DateTime.Now;
|
||||
private bool loggedIn;
|
||||
|
@ -119,7 +118,7 @@ namespace Jira {
|
|||
this.url = config.Url;
|
||||
this.timeout = config.Timeout;
|
||||
if (!suppressBackgroundForm) {
|
||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, lang.GetString(LangKey.communication_wait));
|
||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, Language.GetString("jira", LangKey.communication_wait));
|
||||
try {
|
||||
jira = new JiraSoapServiceService();
|
||||
} finally {
|
||||
|
@ -143,7 +142,7 @@ namespace Jira {
|
|||
private bool doLogin(string user, string password, bool suppressBackgroundForm) {
|
||||
BackgroundForm backgroundForm = null;
|
||||
if (!suppressBackgroundForm) {
|
||||
backgroundForm = BackgroundForm.ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, lang.GetString(LangKey.communication_wait));
|
||||
backgroundForm = BackgroundForm.ShowAndWait(JiraPlugin.Instance.JiraPluginAttributes.Name, Language.GetString("jira", LangKey.communication_wait));
|
||||
}
|
||||
try {
|
||||
LOG.DebugFormat("Loggin in");
|
||||
|
|
|
@ -39,7 +39,6 @@ namespace GreenshotJiraPlugin {
|
|||
public class JiraDestination : AbstractDestination {
|
||||
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(JiraDestination));
|
||||
private static JiraConfiguration config = IniConfig.GetIniSection<JiraConfiguration>();
|
||||
private ILanguage lang = Language.GetInstance();
|
||||
private JiraPlugin jiraPlugin = null;
|
||||
private JiraIssue jira = null;
|
||||
|
||||
|
@ -61,9 +60,9 @@ namespace GreenshotJiraPlugin {
|
|||
public override string Description {
|
||||
get {
|
||||
if (jira == null) {
|
||||
return lang.GetString(LangKey.upload_menu_item);
|
||||
return Language.GetString("jira", LangKey.upload_menu_item);
|
||||
} else {
|
||||
return lang.GetString(LangKey.upload_menu_item) + " - " + jira.Key + ": " + jira.Summary.Substring(0, Math.Min(20, jira.Summary.Length));
|
||||
return Language.GetString("jira", LangKey.upload_menu_item) + " - " + jira.Key + ": " + jira.Summary.Substring(0, Math.Min(20, jira.Summary.Length));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -110,18 +109,18 @@ namespace GreenshotJiraPlugin {
|
|||
// COPY stream to buffer
|
||||
buffer = stream.ToArray();
|
||||
}
|
||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(Description, lang.GetString(LangKey.communication_wait));
|
||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(Description, Language.GetString("jira", LangKey.communication_wait));
|
||||
try {
|
||||
jiraPlugin.JiraConnector.addAttachment(jira.Key, filename, buffer);
|
||||
LOG.Debug("Uploaded to Jira.");
|
||||
backgroundForm.CloseDialog();
|
||||
MessageBox.Show(lang.GetString(LangKey.upload_success));
|
||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, jiraPlugin.Host.CoreLanguage.GetFormattedString("exported_to", Description));
|
||||
MessageBox.Show(Language.GetString("jira", LangKey.upload_success));
|
||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, Language.GetFormattedString("exported_to", Description));
|
||||
surface.Modified = false;
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
backgroundForm.CloseDialog();
|
||||
MessageBox.Show(lang.GetString(LangKey.upload_failure) + " " + e.Message);
|
||||
MessageBox.Show(Language.GetString("jira", LangKey.upload_failure) + " " + e.Message);
|
||||
}
|
||||
} else {
|
||||
JiraForm jiraForm = new JiraForm(jiraPlugin.JiraConnector);
|
||||
|
@ -137,22 +136,21 @@ namespace GreenshotJiraPlugin {
|
|||
// COPY stream to buffer
|
||||
buffer = stream.ToArray();
|
||||
}
|
||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(Description, lang.GetString(LangKey.communication_wait));
|
||||
BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(Description, Language.GetString("jira", LangKey.communication_wait));
|
||||
try {
|
||||
jiraForm.upload(buffer);
|
||||
LOG.Debug("Uploaded to Jira.");
|
||||
backgroundForm.CloseDialog();
|
||||
MessageBox.Show(lang.GetString(LangKey.upload_success));
|
||||
MessageBox.Show(Language.GetString("jira", LangKey.upload_success));
|
||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, "Exported to Jira " + jiraForm.getJiraIssue().Key);
|
||||
surface.Modified = false;
|
||||
return true;
|
||||
} catch(Exception e) {
|
||||
backgroundForm.CloseDialog();
|
||||
MessageBox.Show(lang.GetString(LangKey.upload_failure) + " " + e.Message);
|
||||
MessageBox.Show(Language.GetString("jira", LangKey.upload_failure) + " " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ namespace GreenshotJiraPlugin {
|
|||
public class JiraPlugin : IGreenshotPlugin {
|
||||
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(JiraPlugin));
|
||||
private PluginAttribute jiraPluginAttributes;
|
||||
private ILanguage lang = Language.GetInstance();
|
||||
private IGreenshotHost host;
|
||||
private JiraConnector jiraConnector = null;
|
||||
private JiraConfiguration config = null;
|
||||
|
|
|
@ -1,40 +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 GreenshotPlugin.Core;
|
||||
|
||||
namespace GreenshotJiraPlugin {
|
||||
/// <summary>
|
||||
/// Wrapper for the language container for the Jira plugin.
|
||||
/// </summary>
|
||||
public class Language : LanguageContainer, ILanguage {
|
||||
private static ILanguage uniqueInstance;
|
||||
private const string LANGUAGE_FILENAME_PATTERN = @"language_jiraplugin-*.xml";
|
||||
|
||||
public static ILanguage GetInstance() {
|
||||
if(uniqueInstance == null) {
|
||||
uniqueInstance = new LanguageContainer(LANGUAGE_FILENAME_PATTERN);
|
||||
}
|
||||
return uniqueInstance;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue