Added language binding support to ToolStripItem, also changed the behavior to use the name of the component if no language key is set.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1807 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-04-19 12:17:16 +00:00
parent e687450dfc
commit 83a033ebd0
7 changed files with 281 additions and 184 deletions

View file

@ -45,31 +45,29 @@ namespace Greenshot {
/// </summary> /// </summary>
private void InitializeComponent() { private void InitializeComponent() {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.contextmenu_capturearea = new System.Windows.Forms.ToolStripMenuItem(); this.contextmenu_capturearea = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.contextmenu_capturelastregion = new System.Windows.Forms.ToolStripMenuItem(); this.contextmenu_capturelastregion = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.contextmenu_capturewindow = new System.Windows.Forms.ToolStripMenuItem(); this.contextmenu_capturewindow = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.contextmenu_capturefullscreen = new System.Windows.Forms.ToolStripMenuItem(); this.contextmenu_capturefullscreen = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.contextmenu_captureie = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.contextmenu_captureclipboard = new System.Windows.Forms.ToolStripMenuItem(); this.contextmenu_captureclipboard = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.contextmenu_openfile = new System.Windows.Forms.ToolStripMenuItem(); this.contextmenu_openfile = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.contextmenu_quicksettings = new System.Windows.Forms.ToolStripMenuItem(); this.contextmenu_openrecentcapture = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.contextmenu_settings = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.contextmenu_help = new System.Windows.Forms.ToolStripMenuItem();
this.contextmenu_about = new System.Windows.Forms.ToolStripMenuItem();
this.contextmenu_donate = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.contextmenu_exit = new System.Windows.Forms.ToolStripMenuItem();
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.contextmenu_captureie = new System.Windows.Forms.ToolStripMenuItem();
this.backgroundWorkerTimer = new System.Windows.Forms.Timer(this.components);
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.contextmenu_openrecentcapture = new System.Windows.Forms.ToolStripMenuItem(); this.contextmenu_quicksettings = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.contextmenu_settings = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.contextmenu_help = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.contextmenu_donate = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.contextmenu_about = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.contextmenu_exit = new GreenshotPlugin.Controls.GreenshotToolStripMenuItem();
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.backgroundWorkerTimer = new System.Windows.Forms.Timer(this.components);
this.contextMenu.SuspendLayout(); this.contextMenu.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -96,16 +94,15 @@ namespace Greenshot {
this.toolStripSeparator1, this.toolStripSeparator1,
this.contextmenu_exit}); this.contextmenu_exit});
this.contextMenu.Name = "contextMenu"; this.contextMenu.Name = "contextMenu";
this.contextMenu.Size = new System.Drawing.Size(243, 314); this.contextMenu.Size = new System.Drawing.Size(309, 342);
this.contextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuOpening);
this.contextMenu.Closing += new System.Windows.Forms.ToolStripDropDownClosingEventHandler(this.ContextMenuClosing); this.contextMenu.Closing += new System.Windows.Forms.ToolStripDropDownClosingEventHandler(this.ContextMenuClosing);
this.contextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuOpening);
// //
// contextmenu_capturearea // contextmenu_capturearea
// //
this.contextmenu_capturearea.Name = "contextmenu_capturearea"; this.contextmenu_capturearea.Name = "contextmenu_capturearea";
this.contextmenu_capturearea.ShortcutKeyDisplayString = "Print"; this.contextmenu_capturearea.ShortcutKeyDisplayString = "Print";
this.contextmenu_capturearea.Size = new System.Drawing.Size(242, 22); this.contextmenu_capturearea.Size = new System.Drawing.Size(308, 22);
this.contextmenu_capturearea.Text = "Capture region";
this.contextmenu_capturearea.Click += new System.EventHandler(this.CaptureAreaToolStripMenuItemClick); this.contextmenu_capturearea.Click += new System.EventHandler(this.CaptureAreaToolStripMenuItemClick);
// //
// contextmenu_capturelastregion // contextmenu_capturelastregion
@ -113,173 +110,162 @@ namespace Greenshot {
this.contextmenu_capturelastregion.Enabled = false; this.contextmenu_capturelastregion.Enabled = false;
this.contextmenu_capturelastregion.Name = "contextmenu_capturelastregion"; this.contextmenu_capturelastregion.Name = "contextmenu_capturelastregion";
this.contextmenu_capturelastregion.ShortcutKeyDisplayString = "Shift + Print"; this.contextmenu_capturelastregion.ShortcutKeyDisplayString = "Shift + Print";
this.contextmenu_capturelastregion.Size = new System.Drawing.Size(242, 22); this.contextmenu_capturelastregion.Size = new System.Drawing.Size(308, 22);
this.contextmenu_capturelastregion.Text = "Capture last region";
this.contextmenu_capturelastregion.Click += new System.EventHandler(this.Contextmenu_capturelastregionClick); this.contextmenu_capturelastregion.Click += new System.EventHandler(this.Contextmenu_capturelastregionClick);
// //
// contextmenu_capturewindow // contextmenu_capturewindow
// //
this.contextmenu_capturewindow.Name = "contextmenu_capturewindow"; this.contextmenu_capturewindow.Name = "contextmenu_capturewindow";
this.contextmenu_capturewindow.ShortcutKeyDisplayString = "Alt + Print"; this.contextmenu_capturewindow.ShortcutKeyDisplayString = "Alt + Print";
this.contextmenu_capturewindow.Size = new System.Drawing.Size(242, 22); this.contextmenu_capturewindow.Size = new System.Drawing.Size(308, 22);
this.contextmenu_capturewindow.Text = "Capture window"; this.contextmenu_capturewindow.DropDownClosed += new System.EventHandler(this.CaptureWindowMenuDropDownClosed);
this.contextmenu_capturewindow.DropDownOpening += new System.EventHandler(CaptureWindowMenuDropDownOpening); this.contextmenu_capturewindow.DropDownOpening += new System.EventHandler(this.CaptureWindowMenuDropDownOpening);
this.contextmenu_capturewindow.DropDownClosed += new System.EventHandler(CaptureWindowMenuDropDownClosed);
// //
// contextmenu_capturefullscreen // contextmenu_capturefullscreen
// //
this.contextmenu_capturefullscreen.Name = "contextmenu_capturefullscreen"; this.contextmenu_capturefullscreen.Name = "contextmenu_capturefullscreen";
this.contextmenu_capturefullscreen.ShortcutKeyDisplayString = "Ctrl + Print"; this.contextmenu_capturefullscreen.ShortcutKeyDisplayString = "Ctrl + Print";
this.contextmenu_capturefullscreen.Size = new System.Drawing.Size(242, 22); this.contextmenu_capturefullscreen.Size = new System.Drawing.Size(308, 22);
this.contextmenu_capturefullscreen.Text = "Capture full screen"; //
// contextmenu_captureie
//
this.contextmenu_captureie.Name = "contextmenu_captureie";
this.contextmenu_captureie.ShortcutKeyDisplayString = "Ctrl + Shift + Print";
this.contextmenu_captureie.Size = new System.Drawing.Size(308, 22);
this.contextmenu_captureie.DropDownOpening += new System.EventHandler(this.CaptureIEMenuDropDownOpening);
// //
// toolStripSeparator4 // toolStripSeparator4
// //
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(239, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(305, 6);
// //
// contextmenu_captureclipboard // contextmenu_captureclipboard
// //
this.contextmenu_captureclipboard.Name = "contextmenu_captureclipboard"; this.contextmenu_captureclipboard.Name = "contextmenu_captureclipboard";
this.contextmenu_captureclipboard.Size = new System.Drawing.Size(242, 22); this.contextmenu_captureclipboard.Size = new System.Drawing.Size(308, 22);
this.contextmenu_captureclipboard.Text = "Capture clipboard";
this.contextmenu_captureclipboard.Click += new System.EventHandler(this.CaptureClipboardToolStripMenuItemClick); this.contextmenu_captureclipboard.Click += new System.EventHandler(this.CaptureClipboardToolStripMenuItemClick);
// //
// contextmenu_openfile // contextmenu_openfile
// //
this.contextmenu_openfile.Name = "contextmenu_openfile"; this.contextmenu_openfile.Name = "contextmenu_openfile";
this.contextmenu_openfile.Size = new System.Drawing.Size(242, 22); this.contextmenu_openfile.Size = new System.Drawing.Size(308, 22);
this.contextmenu_openfile.Text = "Open File";
this.contextmenu_openfile.Click += new System.EventHandler(this.OpenFileToolStripMenuItemClick); this.contextmenu_openfile.Click += new System.EventHandler(this.OpenFileToolStripMenuItemClick);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(239, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(305, 6);
//
// contextmenu_openrecentcapture
//
this.contextmenu_openrecentcapture.Name = "contextmenu_openrecentcapture";
this.contextmenu_openrecentcapture.Size = new System.Drawing.Size(308, 22);
this.contextmenu_openrecentcapture.Click += new System.EventHandler(this.Contextmenu_OpenRecent);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(305, 6);
// //
// contextmenu_quicksettings // contextmenu_quicksettings
// //
this.contextmenu_quicksettings.Name = "contextmenu_quicksettings"; this.contextmenu_quicksettings.Name = "contextmenu_quicksettings";
this.contextmenu_quicksettings.Size = new System.Drawing.Size(242, 22); this.contextmenu_quicksettings.Size = new System.Drawing.Size(308, 22);
this.contextmenu_quicksettings.Text = "Quick settings";
// //
// contextmenu_settings // contextmenu_settings
// //
this.contextmenu_settings.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_settings.Image"))); this.contextmenu_settings.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_settings.Image")));
this.contextmenu_settings.Name = "contextmenu_settings"; this.contextmenu_settings.Name = "contextmenu_settings";
this.contextmenu_settings.Size = new System.Drawing.Size(242, 22); this.contextmenu_settings.Size = new System.Drawing.Size(308, 22);
this.contextmenu_settings.Text = "Settings";
this.contextmenu_settings.Click += new System.EventHandler(this.Contextmenu_settingsClick); this.contextmenu_settings.Click += new System.EventHandler(this.Contextmenu_settingsClick);
// //
// toolStripSeparator3 // toolStripSeparator3
// //
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(239, 6); this.toolStripSeparator3.Size = new System.Drawing.Size(305, 6);
// //
// contextmenu_help // contextmenu_help
// //
this.contextmenu_help.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_help.Image"))); this.contextmenu_help.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_help.Image")));
this.contextmenu_help.Name = "contextmenu_help"; this.contextmenu_help.Name = "contextmenu_help";
this.contextmenu_help.Size = new System.Drawing.Size(242, 22); this.contextmenu_help.Size = new System.Drawing.Size(308, 22);
this.contextmenu_help.Text = "Help";
this.contextmenu_help.Click += new System.EventHandler(this.Contextmenu_helpClick); this.contextmenu_help.Click += new System.EventHandler(this.Contextmenu_helpClick);
// //
// contextmenu_about
//
this.contextmenu_about.Name = "contextmenu_about";
this.contextmenu_about.Size = new System.Drawing.Size(242, 22);
this.contextmenu_about.Text = "About";
this.contextmenu_about.Click += new System.EventHandler(this.Contextmenu_aboutClick);
//
// contextmenu_donate // contextmenu_donate
// //
this.contextmenu_donate.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_donate.Image"))); this.contextmenu_donate.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_donate.Image")));
this.contextmenu_donate.Name = "contextmenu_donate"; this.contextmenu_donate.Name = "contextmenu_donate";
this.contextmenu_donate.Size = new System.Drawing.Size(242, 22); this.contextmenu_donate.Size = new System.Drawing.Size(308, 22);
this.contextmenu_donate.Text = "Support Greenshot";
this.contextmenu_donate.Click += new System.EventHandler(this.Contextmenu_donateClick); this.contextmenu_donate.Click += new System.EventHandler(this.Contextmenu_donateClick);
// //
// contextmenu_about
//
this.contextmenu_about.Name = "contextmenu_about";
this.contextmenu_about.Size = new System.Drawing.Size(308, 22);
this.contextmenu_about.Click += new System.EventHandler(this.Contextmenu_aboutClick);
//
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(239, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(305, 6);
// //
// contextmenu_exit // contextmenu_exit
// //
this.contextmenu_exit.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_exit.Image"))); this.contextmenu_exit.Image = ((System.Drawing.Image)(resources.GetObject("contextmenu_exit.Image")));
this.contextmenu_exit.Name = "contextmenu_exit"; this.contextmenu_exit.Name = "contextmenu_exit";
this.contextmenu_exit.Size = new System.Drawing.Size(242, 22); this.contextmenu_exit.Size = new System.Drawing.Size(308, 22);
this.contextmenu_exit.Text = "Exit";
this.contextmenu_exit.Click += new System.EventHandler(this.Contextmenu_exitClick); this.contextmenu_exit.Click += new System.EventHandler(this.Contextmenu_exitClick);
// //
// notifyIcon // notifyIcon
// //
this.notifyIcon.ContextMenuStrip = this.contextMenu; this.notifyIcon.ContextMenuStrip = this.contextMenu;
this.notifyIcon.Text = "Greenshot"; this.notifyIcon.Text = "Greenshot";
this.notifyIcon.Visible = false;
this.notifyIcon.Click += new System.EventHandler(this.NotifyIconClick); this.notifyIcon.Click += new System.EventHandler(this.NotifyIconClick);
// //
// contextmenu_captureie
//
this.contextmenu_captureie.Name = "contextmenu_captureie";
this.contextmenu_captureie.Size = new System.Drawing.Size(231, 22);
this.contextmenu_captureie.Text = "Capture IE Tab";
this.contextmenu_captureie.ShortcutKeyDisplayString = "Ctrl + Shift + Print";
this.contextmenu_captureie.DropDownOpening += new System.EventHandler(CaptureIEMenuDropDownOpening);
//
// backgroundWorkerTimer // backgroundWorkerTimer
// //
this.backgroundWorkerTimer.Enabled = true; this.backgroundWorkerTimer.Enabled = true;
this.backgroundWorkerTimer.Interval = 300000; this.backgroundWorkerTimer.Interval = 300000;
this.backgroundWorkerTimer.Tick += new System.EventHandler(this.BackgroundWorkerTimerTick); this.backgroundWorkerTimer.Tick += new System.EventHandler(this.BackgroundWorkerTimerTick);
// //
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(240, 6);
//
// contextmenu_openrecentcapture
//
this.contextmenu_openrecentcapture.Name = "contextmenu_openrecentcapture";
this.contextmenu_openrecentcapture.Size = new System.Drawing.Size(243, 22);
this.contextmenu_openrecentcapture.Text = "Open recent capture location";
this.contextmenu_openrecentcapture.Click += new System.EventHandler(this.Contextmenu_OpenRecent);
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(0, 0); this.ClientSize = new System.Drawing.Size(0, 0);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.LanguageKey = "application_title";
this.Name = "MainForm"; this.Name = "MainForm";
this.Text = "Greenshot";
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.WindowState = System.Windows.Forms.FormWindowState.Minimized; this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFormFormClosing);
this.Activated += new System.EventHandler(this.MainFormActivated); this.Activated += new System.EventHandler(this.MainFormActivated);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFormFormClosing);
this.contextMenu.ResumeLayout(false); this.contextMenu.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripMenuItem contextmenu_openrecentcapture; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_openrecentcapture;
private System.Windows.Forms.Timer backgroundWorkerTimer; private System.Windows.Forms.Timer backgroundWorkerTimer;
private System.Windows.Forms.ToolStripMenuItem contextmenu_captureie; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_captureie;
private System.Windows.Forms.ToolStripMenuItem contextmenu_donate; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_donate;
private System.Windows.Forms.ToolStripMenuItem contextmenu_openfile; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_openfile;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem contextmenu_captureclipboard; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_captureclipboard;
private System.Windows.Forms.ToolStripMenuItem contextmenu_quicksettings; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_quicksettings;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem contextmenu_help; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_help;
private System.Windows.Forms.ToolStripMenuItem contextmenu_capturewindow; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_capturewindow;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem contextmenu_about; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_about;
private System.Windows.Forms.ToolStripMenuItem contextmenu_capturefullscreen; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_capturefullscreen;
private System.Windows.Forms.ToolStripMenuItem contextmenu_capturelastregion; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_capturelastregion;
private System.Windows.Forms.ToolStripMenuItem contextmenu_capturearea; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_capturearea;
public System.Windows.Forms.NotifyIcon notifyIcon; public System.Windows.Forms.NotifyIcon notifyIcon;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem contextmenu_exit; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_exit;
private System.Windows.Forms.ContextMenuStrip contextMenu; private System.Windows.Forms.ContextMenuStrip contextMenu;
private System.Windows.Forms.ToolStripMenuItem contextmenu_settings; private GreenshotPlugin.Controls.GreenshotToolStripMenuItem contextmenu_settings;
} }
} }

View file

@ -46,7 +46,7 @@ namespace Greenshot {
/// <summary> /// <summary>
/// Description of MainForm. /// Description of MainForm.
/// </summary> /// </summary>
public partial class MainForm : Form { public partial class MainForm : BaseForm {
private static log4net.ILog LOG = null; private static log4net.ILog LOG = null;
private static Mutex applicationMutex = null; private static Mutex applicationMutex = null;
private static CoreConfiguration conf; private static CoreConfiguration conf;
@ -520,21 +520,8 @@ namespace Greenshot {
#endregion #endregion
public void UpdateUI() { public void UpdateUI() {
this.Text = Language.GetString(LangKey.application_title); // As the form is never loaded, call ApplyLanguage ourselves
this.contextmenu_settings.Text = Language.GetString(LangKey.contextmenu_settings); ApplyLanguage();
this.contextmenu_capturearea.Text = Language.GetString(LangKey.contextmenu_capturearea);
this.contextmenu_capturelastregion.Text = Language.GetString(LangKey.contextmenu_capturelastregion);
this.contextmenu_capturewindow.Text = Language.GetString(LangKey.contextmenu_capturewindow);
this.contextmenu_capturefullscreen.Text = Language.GetString(LangKey.contextmenu_capturefullscreen);
this.contextmenu_captureclipboard.Text = Language.GetString(LangKey.contextmenu_captureclipboard);
this.contextmenu_openfile.Text = Language.GetString(LangKey.contextmenu_openfile);
this.contextmenu_quicksettings.Text = Language.GetString(LangKey.contextmenu_quicksettings);
this.contextmenu_help.Text = Language.GetString(LangKey.contextmenu_help);
this.contextmenu_about.Text = Language.GetString(LangKey.contextmenu_about);
this.contextmenu_donate.Text = Language.GetString(LangKey.contextmenu_donate);
this.contextmenu_exit.Text = Language.GetString(LangKey.contextmenu_exit);
this.contextmenu_captureie.Text = Language.GetString(LangKey.contextmenu_captureie);
this.contextmenu_openrecentcapture.Text = Language.GetString(LangKey.contextmenu_openrecentcapture);
// Show hotkeys in Contextmenu // Show hotkeys in Contextmenu
this.contextmenu_capturearea.ShortcutKeyDisplayString = HotkeyControl.GetLocalizedHotkeyStringFromString(conf.RegionHotkey); this.contextmenu_capturearea.ShortcutKeyDisplayString = HotkeyControl.GetLocalizedHotkeyStringFromString(conf.RegionHotkey);

View file

@ -117,70 +117,70 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="contextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>293, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="contextmenu_settings.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="contextmenu_settings.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgpJREFUOE+lkMtr YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgdJREFUOE+lk71r
GmEUxT9xIfgA3bhplRKUUDQljFCcdCEEgsRx4esfcBVC6aogtKRdBEoodNESs8omgST7BFcxD0hlAo6g WmEYxV9xEPwAXVxapQRFiqaEKwRvMgiBIPU6+PUPOJVSOgWElrZDoIRCh5bYqUsDafYEp5hEMHIFr6Dx
cSQm1KZWxiS4l4Kb2+8McZjQrBrhcC/n/s6ZGS1ExB71Q0EikWDJZJKl02mWyWT0mcvlRK6FO4nmG1hk Sm2oSa1c0+AuBZen77nEi5JsGQ7vwzm/c1BBRkTsP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DA3jnAQWa1WnVZLBaJ68ONpKkP5tbAff7O/wFfbRPfU/HxPQAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="contextmenu_help.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="contextmenu_help.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAmRJREFUOE9j/P// YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAmNJREFUOE9j+P//
PwNFAGQAs85mBmbdrQzM+juAeKcEs8GuFCCeBcTboBjETgHLgdSA1AL1gC1HM8CD12LvZseMm7fSu99+ PwMlGKyZWWczA7PuVgZm/R1AvFOC2WBXChDPAuJtUAxip4DlQGpAaoF6QHrRDfDgtdi72THj5q307rcf
LJ725U/R1C9/0jrffrRPu3ELJAc0wAOXAR6idgcOpXe9/Zza/vp/QNENFJza/up/UturzyK2+w8BDfBA i6d9+VM09cuftM63H+3TbtwCyQEN8MBlgIeo3YFD6V1vP6e2v/4fUHQDBae2v/qf1Pbqs4jt/kNAAzzQ
c8EmSV7THVtS2l5+jqx+8N8r5xLQYaigpO/Wf5BcVN3jzzwm27cw62ySRHhBa32qTeLF22EVd/77FVz7 XLBJktd0x5aUtpefI6sf/PfKuQR0HSoo6bv1HyQXVff4M4/J9i3MOpskEV7QWp9qk3jxdljFnf9+Bdf+
75l98f/ERVfBeNuhZ2CT5qx9AJYLLr313yj85G1moB64AUzqq+eGVd795J55/j8MO6Wc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ErkJggg== AOypQZHMHzM4AAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="contextmenu_donate.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="contextmenu_donate.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAihJREFUOE+lk11I YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAipJREFUOE+llF1I
k2EYhp+FedxRgVEEQogGIYpBHVhKBrZBsDKWaLBGOmypC3FbMVcLlUUHYqzEcD9asr8y54GtlnP4s7VW k2EYhp+FedxRgVEEQoQGIYpBHVhKBbZBsDKWaLBGOmypC9GtmKuFyqIDMVZiuB8t2V+Z88BWyzn82Vqr
uVKoscSmkP1ARZEEcrdnxdjAE/OFi++D577u7+WDRwCANnTaThSIEtT9JyK6JM6Xr/74iN/fl9YFO+yS XCnUWGJTyH6gokgCuduz4mMDT8wXLr4Pnvu6v5cX3o8A0Hqg1hP5kiQ1/4mELknzlCs/PuL398U1wQ67
+lhew8rXOOw9neuCHXapRbRb8fPzPJ49siM240sR8NiShaODRkSfezNmnGWHXWquzG36thxFcHQQn+KR pDm2q275awKO7o41wQ671CTZqfr5eQ7PHjkQn/YLBL32VOHIgAmx576MGWfZYZcay3Mbvi3FEBoZwKdE
FJ2qOty5oYf/gRnG9paMGWfZYZcUFbsufFmcw+RIP2ZDHli7LiefBrUcE25rEn5Pn3GWHXZJXr6jdXkh VKCjpQZ3bhgQeGCBqa0pY8ZZdtgl1eEdF74szGJiuA8zYS9snZdTT6NGiXGPLQW/p884yw67pCzb1rw0
At/9Prx/G0xxXauAx3YLt69poD1fkzHjLDvskqw0R7MUC8Pr7EV4fChF6IkL7i4xxq3VmHIoMO1SYtom H4X/fi/evw0JXNep4LXfwu1rWujOV2XMOMsOu6QoydEuxiPwuXoQGRsUCD9xw9MpxZitEpNOFabcakzZ
Q9hehYfGk2CHXTp9YJt24U0QvQY17uoPY8wswWOLFMPGajj1JVj9MIBfsR7M+5qwOFaLlVdS2HXFYIdd FYg4KvDQdBLssEun92/Rzb8JoceowV3DIYxaZHhslWPIVAmXoRgrH/rxK96NOX8DFkarsfxKDoe+COyw
EhduaY9Hn+Ld3CT85poM4fU9CV66GxF0yuHuFsJzU4iw4xRCzkawwy4Vbd/cXJab3c2cO5TlDw5pMOVS S9KCTW2J2FO8m51AwFKVIby+J8NLTz1CLiU8XWJ4b4oRcZ5C2FUPdtilwq0bG0tzs7uYcwezAqFBLSbd
wdN3FjPDrWveoKMq6wXn2eU1yE6wNUFOQ6nAkX5lv0mC9EKv6QwCtnpcFG5q++ew+/cU7ySS7SO5WXdk LfD2nsX0UPOqO2ivyHrBeXYpubKTbE6SU1cicqZvOWCWIb3QZz6DoL0WF8UbWv857P5dRduJFHtJadEf
tv9qZWBAd3BEWS6wrPUPlGUC6/FCQeYOcoG0hOhKbT51yPaSQVaQVng0WWjRFHlNqj0R/lD9fiKGeJ03 mem7Wh7s1x8YVpeJrKudgbpUZDteIBJcoUBeTHSlOo/aFXvIqMhPKzyaKrRqC33mlt1R/lDtPiJmXVeZ
wh+7ImBS7QvLFAAAAABJRU5ErkJggg== fwN/AOaMjSQNpEbMAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="contextmenu_exit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="contextmenu_exit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.b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nliFhXIcLcMp9K8YBd+xFXCDwyn0rzG26SYF7zCCsGEoWeW6NTMoEkxLyhgyJYZWmJYp+a0
IOYFBf/9oFJ9ibr0B4f94vVG3bWDAAAAAElFTkSuQmCC IOYFBf/9IzP/jT+zZw/Woa9yPwAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<metadata name="contextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>293, 17</value>
</metadata>
<metadata name="notifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="notifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>193, 17</value> <value>193, 17</value>
</metadata> </metadata>

View file

@ -19,6 +19,7 @@ Features added:
* Added a preview when using the window capture from the context menu (Windows Vista and later) * Added a preview when using the window capture from the context menu (Windows Vista and later)
* Added color reduction as an option and auto detection for image with less than 256 color. When using reduction this results in smaller files. * Added color reduction as an option and auto detection for image with less than 256 color. When using reduction this results in smaller files.
* Added direct printing to a selected printer * Added direct printing to a selected printer
* Changed multi-screen capture behaviour, assuming that capturing all screens is not a normal use-case. Now default behaviour is to capture the one with the mouse-cursor. Also the user can select which screen to capture from the context-menu.
Bugs resolved: Bugs resolved:
* Fixed a problem with temp-files being removed before they were used, now using a delay of ~10 hours * Fixed a problem with temp-files being removed before they were used, now using a delay of ~10 hours

View file

@ -15,6 +15,7 @@ namespace GreenshotPlugin.Controls {
private IComponentChangeService m_changeService; private IComponentChangeService m_changeService;
private bool isLanguageSet = false; private bool isLanguageSet = false;
private IDictionary<string, Control> designTimeControls; private IDictionary<string, Control> designTimeControls;
private IDictionary<string, ToolStripItem> designTimeToolStripItems;
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")] [Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey { public string LanguageKey {
get; get;
@ -27,6 +28,7 @@ namespace GreenshotPlugin.Controls {
protected void InitializeForDesigner() { protected void InitializeForDesigner() {
if (this.DesignMode) { if (this.DesignMode) {
designTimeControls = new Dictionary<string, Control>(); designTimeControls = new Dictionary<string, Control>();
designTimeToolStripItems = new Dictionary<string, ToolStripItem>();
try { try {
ITypeResolutionService typeResService = GetService(typeof(ITypeResolutionService)) as ITypeResolutionService; ITypeResolutionService typeResService = GetService(typeof(ITypeResolutionService)) as ITypeResolutionService;
Assembly currentAssembly = this.GetType().Assembly; Assembly currentAssembly = this.GetType().Assembly;
@ -138,7 +140,19 @@ namespace GreenshotPlugin.Controls {
private void OnComponentChanged(object sender, ComponentChangedEventArgs ce) { private void OnComponentChanged(object sender, ComponentChangedEventArgs ce) {
if (ce.Component != null && ((IComponent)ce.Component).Site != null && ce.Member != null) { if (ce.Component != null && ((IComponent)ce.Component).Site != null && ce.Member != null) {
if ("LanguageKey".Equals(ce.Member.Name)) { if ("LanguageKey".Equals(ce.Member.Name)) {
ApplyLanguage(ce.Component as Control, (string)ce.NewValue); Control control = ce.Component as Control;
if (control != null) {
LOG.InfoFormat("Changing LanguageKey for {0} to {1}", control.Name, ce.NewValue);
ApplyLanguage(control, (string)ce.NewValue);
} else {
ToolStripItem item = ce.Component as ToolStripItem;
if (item != null) {
LOG.InfoFormat("Changing LanguageKey for {0} to {1}", item.Name, ce.NewValue);
ApplyLanguage(item, (string)ce.NewValue);
} else {
LOG.InfoFormat("Not possible to changing LanguageKey for {0} to {1}", ce.Component.GetType(), ce.NewValue);
}
}
} }
} }
} }
@ -152,6 +166,13 @@ namespace GreenshotPlugin.Controls {
} else { } else {
designTimeControls[control.Name] = control; designTimeControls[control.Name] = control;
} }
} else if (ce.Component is ToolStripItem) {
ToolStripItem item = ce.Component as ToolStripItem;
if (!designTimeControls.ContainsKey(item.Name)) {
designTimeToolStripItems.Add(item.Name, item);
} else {
designTimeToolStripItems[item.Name] = item;
}
} }
} }
} }
@ -164,9 +185,47 @@ namespace GreenshotPlugin.Controls {
base.Dispose(disposing); base.Dispose(disposing);
} }
protected void ApplyLanguage(ToolStripItem applyTo, string languageKey) {
if (!string.IsNullOrEmpty(languageKey)) {
if (!Language.hasKey(languageKey)) {
LOG.WarnFormat("Wrong language key '{0}' configured for control '{1}'", languageKey, applyTo.Name);
if (DesignMode) {
MessageBox.Show(string.Format("Wrong language key '{0}' configured for control '{1}'", languageKey, applyTo.Name));
}
return;
}
applyTo.Text = Language.GetString(languageKey);
} else {
// Fallback to control name!
if (Language.hasKey(applyTo.Name)) {
applyTo.Text = Language.GetString(applyTo.Name);
return;
}
if (this.DesignMode) {
MessageBox.Show(string.Format("Greenshot control without language key: {0}", applyTo.Name));
} else {
LOG.DebugFormat("Greenshot control without language key: {0}", applyTo.Name);
}
}
}
protected void ApplyLanguage(ToolStripItem applyTo) {
IGreenshotLanguageBindable languageBindable = applyTo as IGreenshotLanguageBindable;
if (languageBindable != null) {
ApplyLanguage(applyTo, languageBindable.LanguageKey);
}
}
protected void ApplyLanguage(Control applyTo) { protected void ApplyLanguage(Control applyTo) {
IGreenshotLanguageBindable languageBindable = applyTo as IGreenshotLanguageBindable; IGreenshotLanguageBindable languageBindable = applyTo as IGreenshotLanguageBindable;
if (languageBindable == null) { if (languageBindable == null) {
// check if it's a menu!
if (applyTo is ToolStrip) {
ToolStrip toolStrip = applyTo as ToolStrip;
foreach (ToolStripItem item in toolStrip.Items) {
ApplyLanguage(item);
}
}
return; return;
} }
@ -222,6 +281,9 @@ namespace GreenshotPlugin.Controls {
foreach (Control designControl in designTimeControls.Values) { foreach (Control designControl in designTimeControls.Values) {
ApplyLanguage(designControl); ApplyLanguage(designControl);
} }
foreach (ToolStripItem designToolStripItem in designTimeToolStripItems.Values) {
ApplyLanguage(designToolStripItem);
}
} }
} }
@ -237,6 +299,11 @@ namespace GreenshotPlugin.Controls {
} }
applyTo.Text = Language.GetString(languageKey); applyTo.Text = Language.GetString(languageKey);
} else { } else {
// Fallback to control name!
if (Language.hasKey(applyTo.Name)) {
applyTo.Text = Language.GetString(applyTo.Name);
return;
}
if (this.DesignMode) { if (this.DesignMode) {
MessageBox.Show(string.Format("Greenshot control without language key: {0}", applyTo.Name)); MessageBox.Show(string.Format("Greenshot control without language key: {0}", applyTo.Name));
} else { } else {

View file

@ -0,0 +1,33 @@
/*
* 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.ComponentModel;
using System.Windows.Forms;
namespace GreenshotPlugin.Controls {
public class GreenshotToolStripMenuItem : ToolStripMenuItem, IGreenshotLanguageBindable {
[Category("Greenshot"), DefaultValue(null), Description("Specifies key of the language file to use when displaying the text.")]
public string LanguageKey {
get;
set;
}
}
}

View file

@ -175,17 +175,40 @@
<Compile Include="..\GreenshotInterop\OfficeInterop\WordInterop.cs"> <Compile Include="..\GreenshotInterop\OfficeInterop\WordInterop.cs">
<Link>Interop\WordInterop.cs</Link> <Link>Interop\WordInterop.cs</Link>
</Compile> </Compile>
<Compile Include="Controls\GreenshotButton.cs" /> <Compile Include="Controls\GreenshotButton.cs">
<Compile Include="Controls\GreenshotCheckBox.cs" /> <SubType>Component</SubType>
</Compile>
<Compile Include="Controls\GreenshotCheckBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\GreenshotColumnSorter.cs" /> <Compile Include="Controls\GreenshotColumnSorter.cs" />
<Compile Include="Controls\GreenshotComboBox.cs" /> <Compile Include="Controls\GreenshotComboBox.cs">
<Compile Include="Controls\GreenshotForm.cs" /> <SubType>Component</SubType>
<Compile Include="Controls\GreenshotGroupBox.cs" /> </Compile>
<Compile Include="Controls\GreenshotLabel.cs" /> <Compile Include="Controls\GreenshotForm.cs">
<Compile Include="Controls\GreenshotTabPage.cs" /> <SubType>Form</SubType>
<Compile Include="Controls\GreenshotTextBox.cs" /> </Compile>
<Compile Include="Controls\HotkeyControl.cs" /> <Compile Include="Controls\GreenshotGroupBox.cs">
<Compile Include="Controls\BackgroundForm.cs" /> <SubType>Component</SubType>
</Compile>
<Compile Include="Controls\GreenshotLabel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\GreenshotTabPage.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\GreenshotTextBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\GreenshotToolStripMenuItem.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\HotkeyControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\BackgroundForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Controls\BackgroundForm.Designer.cs"> <Compile Include="Controls\BackgroundForm.Designer.cs">
<DependentUpon>BackgroundForm.cs</DependentUpon> <DependentUpon>BackgroundForm.cs</DependentUpon>
</Compile> </Compile>