From d6c608bf65681e2a449471bf4c5f2307f3b82064 Mon Sep 17 00:00:00 2001 From: RKrom Date: Tue, 17 Apr 2012 14:11:22 +0000 Subject: [PATCH] Preparations for the language changes git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1782 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- .../Greenshot-OCR-Plugin.csproj | 8 ++-- Greenshot-OCR-Plugin/Language.cs | 40 ------------------- Greenshot-OCR-Plugin/OCRDestination.cs | 1 - Greenshot-OCR-Plugin/SettingsForm.cs | 9 ++--- 4 files changed, 8 insertions(+), 50 deletions(-) delete mode 100644 Greenshot-OCR-Plugin/Language.cs diff --git a/Greenshot-OCR-Plugin/Greenshot-OCR-Plugin.csproj b/Greenshot-OCR-Plugin/Greenshot-OCR-Plugin.csproj index eaee24e10..a79afe556 100644 --- a/Greenshot-OCR-Plugin/Greenshot-OCR-Plugin.csproj +++ b/Greenshot-OCR-Plugin/Greenshot-OCR-Plugin.csproj @@ -1,5 +1,5 @@  - + {C6988EE8-2FEE-4349-9F09-F9628A0D8965} Debug @@ -51,14 +51,15 @@ - - + + Form + SettingsForm.cs @@ -82,7 +83,6 @@ {5B924697-4DCD-4F98-85F1-105CB84B7341} GreenshotPlugin - "$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs" diff --git a/Greenshot-OCR-Plugin/Language.cs b/Greenshot-OCR-Plugin/Language.cs deleted file mode 100644 index d7b168cd1..000000000 --- a/Greenshot-OCR-Plugin/Language.cs +++ /dev/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 . - */ -using System; -using System.Threading; -using GreenshotPlugin.Core; - -namespace GreenshotOCR { - /// - /// Wrapper for the language container for the Jira plugin. - /// - public class Language : LanguageContainer, ILanguage { - private static ILanguage uniqueInstance; - private const string LANGUAGE_FILENAME_PATTERN = @"language_ocrplugin-*.xml"; - - public static ILanguage GetInstance() { - if (uniqueInstance == null) { - uniqueInstance = new LanguageContainer(LANGUAGE_FILENAME_PATTERN); - } - return uniqueInstance; - } - } -} diff --git a/Greenshot-OCR-Plugin/OCRDestination.cs b/Greenshot-OCR-Plugin/OCRDestination.cs index 44547b79e..32d05c60e 100644 --- a/Greenshot-OCR-Plugin/OCRDestination.cs +++ b/Greenshot-OCR-Plugin/OCRDestination.cs @@ -37,7 +37,6 @@ namespace GreenshotOCR { private static OCRConfiguration config = IniConfig.GetIniSection(); private const int MIN_WIDTH = 130; private const int MIN_HEIGHT = 130; - private ILanguage lang = Language.GetInstance(); public override string Designation { get { diff --git a/Greenshot-OCR-Plugin/SettingsForm.cs b/Greenshot-OCR-Plugin/SettingsForm.cs index 0f79e0cba..cd4e9df99 100644 --- a/Greenshot-OCR-Plugin/SettingsForm.cs +++ b/Greenshot-OCR-Plugin/SettingsForm.cs @@ -27,16 +27,15 @@ namespace GreenshotOCR { /// Description of SettingsForm. /// public partial class SettingsForm : Form { - private ILanguage language = Language.GetInstance(); private OCRConfiguration config; - + public SettingsForm(string [] languages, OCRConfiguration config) { // // The InitializeComponent() call is required for Windows Forms designer support. // this.config = config; InitializeComponent(); - this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon(); + this.Icon = GreenshotResources.getGreenshotIcon(); initializeComponentText(); comboBox_languages.Items.Clear(); @@ -61,8 +60,8 @@ namespace GreenshotOCR { } private void initializeComponentText() { - this.label_language.Text = language.GetString(LangKey.language); - this.checkBox_orientImage.Text = language.GetString(LangKey.orient_image); + this.label_language.Text = Language.GetString("ocr", LangKey.language); + this.checkBox_orientImage.Text = Language.GetString("ocr", LangKey.orient_image); } void ButtonCancelClick(object sender, EventArgs e) {