BUG-1653: Accessibility improvements, adding accept/cancel buttons to some of the forms. This way one can e.g. ESC out of a form.

This commit is contained in:
RKrom 2014-07-18 13:56:55 +02:00
parent 5cd6afad74
commit 036aec55f5
25 changed files with 119 additions and 180 deletions

View file

@ -57,24 +57,24 @@ namespace GreenshotBoxPlugin {
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
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 = 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.DialogResult = System.Windows.Forms.DialogResult.Cancel;
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 = 13;
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// combobox_uploadimageformat
//
@ -111,11 +111,11 @@ namespace GreenshotBoxPlugin {
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.Location = new System.Drawing.Point(208, 45);
this.checkboxAfterUploadLinkToClipBoard.Name = "checkboxAfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.PropertyName = "AfterUploadLinkToClipBoard";
this.checkboxAfterUploadLinkToClipBoard.SectionName = "Box";
this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(15, 14);
this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(104, 17);
this.checkboxAfterUploadLinkToClipBoard.TabIndex = 10;
this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true;
//
@ -137,6 +137,7 @@ namespace GreenshotBoxPlugin {
this.Name = "SettingsForm";
this.ResumeLayout(false);
this.PerformLayout();
}
private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat;
private GreenshotPlugin.Controls.GreenshotLabel label_upload_format;

View file

@ -37,16 +37,10 @@ namespace GreenshotBoxPlugin {
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
AcceptButton = buttonOK;
CancelButton = buttonCancel;
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
void ButtonOKClick(object sender, EventArgs e) {
this.DialogResult = DialogResult.OK;
}
void ButtonCancelClick(object sender, System.EventArgs e) {
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -56,25 +56,24 @@ namespace GreenshotDropboxPlugin {
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
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 = 10;
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.DialogResult = System.Windows.Forms.DialogResult.Cancel;
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 = 11;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// combobox_uploadimageformat
//
@ -96,7 +95,6 @@ namespace GreenshotDropboxPlugin {
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";
//
// label_AfterUpload
//
@ -105,7 +103,6 @@ namespace GreenshotDropboxPlugin {
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
//
@ -117,7 +114,6 @@ namespace GreenshotDropboxPlugin {
this.checkboxAfterUploadLinkToClipBoard.SectionName = "Dropbox";
this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(104, 17);
this.checkboxAfterUploadLinkToClipBoard.TabIndex = 2;
this.checkboxAfterUploadLinkToClipBoard.Text = "Link to clipboard";
this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true;
//
// SettingsForm
@ -136,7 +132,6 @@ namespace GreenshotDropboxPlugin {
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.Text = "Dropbox settings";
this.ResumeLayout(false);
this.PerformLayout();

View file

@ -37,15 +37,10 @@ namespace GreenshotDropboxPlugin {
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
AcceptButton = buttonOK;
CancelButton = buttonCancel;
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
void ButtonOKClick(object sender, EventArgs e) {
this.DialogResult = DialogResult.OK;
}
void ButtonCancelClick(object sender, System.EventArgs e) {
this.DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -18,13 +18,14 @@
* 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 Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Forms;
using Greenshot.IniFile;
using Greenshot.Plugin;
using GreenshotPlugin.Core;
namespace ExternalCommand {
/// <summary>

View file

@ -63,10 +63,10 @@ namespace ExternalCommand {
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 11;
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// buttonOk
//
this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOk.LanguageKey = "OK";
this.buttonOk.Location = new System.Drawing.Point(275, 173);
this.buttonOk.Name = "buttonOk";
@ -144,6 +144,7 @@ namespace ExternalCommand {
this.LanguageKey = "externalcommand.settings_title";
this.Name = "SettingsForm";
this.ResumeLayout(false);
}
private GreenshotPlugin.Controls.GreenshotButton button_edit;
private GreenshotPlugin.Controls.GreenshotButton button_delete;

View file

@ -18,12 +18,12 @@
* 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 Greenshot.IniFile;
using System;
using System.Drawing;
using System.Windows.Forms;
using Greenshot.IniFile;
namespace ExternalCommand {
/// <summary>
/// Description of SettingsForm.
@ -38,16 +38,13 @@ namespace ExternalCommand {
//
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
AcceptButton = buttonOk;
CancelButton = buttonCancel;
UpdateView();
}
void ButtonOkClick(object sender, EventArgs e) {
IniConfig.Save();
DialogResult = DialogResult.OK;
}
void ButtonCancelClick(object sender, EventArgs e) {
DialogResult = DialogResult.Cancel;
}
void ButtonAddClick(object sender, EventArgs e) {
@ -58,7 +55,7 @@ namespace ExternalCommand {
}
void ButtonDeleteClick(object sender, EventArgs e) {
foreach ( ListViewItem item in listView1.SelectedItems ) {
foreach(ListViewItem item in listView1.SelectedItems) {
string commando = item.Tag as string;
config.commands.Remove(commando);
config.commandlines.Remove(commando);
@ -69,15 +66,15 @@ namespace ExternalCommand {
void UpdateView() {
listView1.Items.Clear();
if (config.commands != null) {
if(config.commands != null) {
listView1.ListViewItemSorter = new ListviewComparer();
ImageList imageList = new ImageList();
listView1.SmallImageList = imageList;
int imageNr = 0;
foreach (string commando in config.commands) {
foreach(string commando in config.commands) {
ListViewItem item = null;
Image iconForExe = IconCache.IconForCommand(commando);
if (iconForExe != null) {
if(iconForExe != null) {
imageList.Images.Add(iconForExe);
item = new ListViewItem(commando, imageNr++);
} else {
@ -102,7 +99,7 @@ namespace ExternalCommand {
void ListView1DoubleClick(object sender, EventArgs e) {
// Safety check for bug #1484
bool selectionActive = listView1.SelectedItems.Count > 0;
if (!selectionActive) {
if(!selectionActive) {
button_edit.Enabled = false;
return;
}
@ -117,16 +114,16 @@ namespace ExternalCommand {
public class ListviewComparer : System.Collections.IComparer {
public int Compare(object x, object y) {
if (!(x is ListViewItem)) {
if(!(x is ListViewItem)) {
return (0);
}
if (!(y is ListViewItem)) {
if(!(y is ListViewItem)) {
return (0);
}
ListViewItem l1 = (ListViewItem)x;
ListViewItem l2 = (ListViewItem)y;
if (l2 == null) {
if(l2 == null) {
return 1;
}
return l1.Text.CompareTo(l2.Text);

View file

@ -62,6 +62,7 @@ namespace ExternalCommand {
//
// buttonOk
//
this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOk.Enabled = false;
this.buttonOk.LanguageKey = "OK";
this.buttonOk.Location = new System.Drawing.Point(273, 140);
@ -80,7 +81,6 @@ namespace ExternalCommand {
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 11;
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// groupBox1
//
@ -178,7 +178,6 @@ namespace ExternalCommand {
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.LanguageKey = "externalcommand.settings_detail_title";
this.Name = "SettingsFormDetail";
this.Text = "Configure command";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);

View file

@ -1,18 +1,30 @@
/*
* Created by SharpDevelop.
* User: 05018038
* Date: 04.04.2012
* Time: 10:50
* Greenshot - a free and open source screenshot tool
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
* 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 Greenshot.IniFile;
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using Greenshot.IniFile;
namespace ExternalCommand {
/// <summary>
/// Description of SettingsFormDetail.
@ -24,13 +36,14 @@ namespace ExternalCommand {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SettingsFormDetail));
private static ExternalCommandConfiguration config = IniConfig.GetIniSection<ExternalCommandConfiguration>();
public SettingsFormDetail(string commando)
{
public SettingsFormDetail(string commando) {
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
AcceptButton = buttonOk;
CancelButton = buttonCancel;
this.commando = commando;
if (commando != null) {
if(commando != null) {
textBox_name.Text = commando;
textBox_commandline.Text = config.commandlines[commando];
textBox_arguments.Text = config.arguments[commando];
@ -41,12 +54,11 @@ namespace ExternalCommand {
OKButtonState();
}
void ButtonOkClick(object sender, EventArgs e)
{
void ButtonOkClick(object sender, EventArgs e) {
string commandName = textBox_name.Text;
string commandLine = textBox_commandline.Text;
string arguments = textBox_arguments.Text;
if (commando != null) {
if(commando != null) {
config.commands[commandIndex] = commandName;
config.commandlines.Remove(commando);
config.commandlines.Add(commandName, commandLine);
@ -57,17 +69,9 @@ namespace ExternalCommand {
config.commandlines.Add(commandName, commandLine);
config.arguments.Add(commandName, arguments);
}
Close();
}
void ButtonCancelClick(object sender, EventArgs e)
{
Close();
}
void Button3Click(object sender, EventArgs e)
{
void Button3Click(object sender, EventArgs e) {
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "Executables (*.exe, *.bat, *.com)|*.exe; *.bat; *.com|All files (*)|*";
openFileDialog.FilterIndex = 1;
@ -76,15 +80,15 @@ namespace ExternalCommand {
string initialPath = null;
try {
initialPath = Path.GetDirectoryName(textBox_commandline.Text);
} catch {}
if (initialPath != null && Directory.Exists(initialPath)) {
} catch { }
if(initialPath != null && Directory.Exists(initialPath)) {
openFileDialog.InitialDirectory = initialPath;
} else {
initialPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
openFileDialog.InitialDirectory = initialPath;
}
LOG.DebugFormat("Starting OpenFileDialog at {0}", initialPath);
if (openFileDialog.ShowDialog() == DialogResult.OK) {
if(openFileDialog.ShowDialog() == DialogResult.OK) {
textBox_commandline.Text = openFileDialog.FileName;
}
}
@ -95,20 +99,20 @@ namespace ExternalCommand {
textBox_name.BackColor = Color.White;
textBox_commandline.BackColor = Color.White;
// Is there a text in the name field
if (string.IsNullOrEmpty(textBox_name.Text)) {
if(string.IsNullOrEmpty(textBox_name.Text)) {
buttonOk.Enabled = false;
}
// Check if commandname is unique
if (commando == null && !string.IsNullOrEmpty(textBox_name.Text) && config.commands.Contains(textBox_name.Text)) {
if(commando == null && !string.IsNullOrEmpty(textBox_name.Text) && config.commands.Contains(textBox_name.Text)) {
buttonOk.Enabled = false;
textBox_name.BackColor = Color.Red;
}
// Is there a text in the commandline field
if (string.IsNullOrEmpty(textBox_commandline.Text)) {
if(string.IsNullOrEmpty(textBox_commandline.Text)) {
buttonOk.Enabled = false;
}
// Is the command available?
if (!string.IsNullOrEmpty(textBox_commandline.Text) && !File.Exists(textBox_commandline.Text)) {
if(!string.IsNullOrEmpty(textBox_commandline.Text) && !File.Exists(textBox_commandline.Text)) {
buttonOk.Enabled = false;
textBox_commandline.BackColor = Color.Red;
}

View file

@ -63,25 +63,24 @@ namespace GreenshotFlickrPlugin {
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
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 = 10;
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.DialogResult = System.Windows.Forms.DialogResult.Cancel;
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 = 11;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// combobox_uploadimageformat
//
@ -103,7 +102,6 @@ namespace GreenshotFlickrPlugin {
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
//
@ -115,7 +113,6 @@ namespace GreenshotFlickrPlugin {
this.checkBoxPublic.SectionName = "Flickr";
this.checkBoxPublic.Size = new System.Drawing.Size(55, 17);
this.checkBoxPublic.TabIndex = 4;
this.checkBoxPublic.Text = "Public";
this.checkBoxPublic.UseVisualStyleBackColor = true;
//
// checkBoxFamily
@ -128,7 +125,6 @@ namespace GreenshotFlickrPlugin {
this.checkBoxFamily.SectionName = "Flickr";
this.checkBoxFamily.Size = new System.Drawing.Size(55, 17);
this.checkBoxFamily.TabIndex = 5;
this.checkBoxFamily.Text = "Family";
this.checkBoxFamily.UseVisualStyleBackColor = true;
//
// checkBoxFriend
@ -150,7 +146,6 @@ namespace GreenshotFlickrPlugin {
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
//
@ -172,7 +167,6 @@ namespace GreenshotFlickrPlugin {
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
//
@ -184,7 +178,6 @@ namespace GreenshotFlickrPlugin {
this.checkboxAfterUploadLinkToClipBoard.SectionName = "Flickr";
this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(104, 17);
this.checkboxAfterUploadLinkToClipBoard.TabIndex = 7;
this.checkboxAfterUploadLinkToClipBoard.Text = "Link to clipboard";
this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true;
//
// checkBox_hiddenfromsearch
@ -221,9 +214,9 @@ namespace GreenshotFlickrPlugin {
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;

View file

@ -38,14 +38,9 @@ namespace GreenshotFlickrPlugin {
//
InitializeComponent();
Icon = GreenshotResources.getGreenshotIcon();
CancelButton = buttonCancel;
AcceptButton = buttonOK;
}
void ButtonOKClick(object sender, EventArgs e) {
DialogResult = DialogResult.OK;
}
void ButtonCancelClick(object sender, EventArgs e) {
DialogResult = DialogResult.Cancel;
}
}
}

View file

@ -117,7 +117,6 @@ namespace GreenshotImgurPlugin
this.finishedButton.TabIndex = 11;
this.finishedButton.Text = "Finished";
this.finishedButton.UseVisualStyleBackColor = true;
this.finishedButton.Click += new System.EventHandler(this.FinishedButtonClick);
//
// clipboardButton
//

View file

@ -54,7 +54,8 @@ namespace GreenshotImgurPlugin {
//
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
AcceptButton = finishedButton;
CancelButton = finishedButton;
// Init sorting
columnSorter = new GreenshotColumnSorter();
this.listview_imgur_uploads.ListViewItemSorter = columnSorter;
@ -157,10 +158,6 @@ namespace GreenshotImgurPlugin {
ClipboardHelper.SetClipboardData(links.ToString());
}
private void FinishedButtonClick(object sender, EventArgs e) {
this.Close();
}
private void ClearHistoryButtonClick(object sender, EventArgs e) {
DialogResult result = MessageBox.Show(Language.GetString("imgur", LangKey.clear_question), "Imgur", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes) {

View file

@ -58,24 +58,24 @@ namespace GreenshotImgurPlugin {
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.LanguageKey = "imgur.OK";
this.buttonOK.Location = new System.Drawing.Point(222, 88);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 10;
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.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.LanguageKey = "imgur.CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(303, 88);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 11;
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// combobox_uploadimageformat
//
@ -150,6 +150,7 @@ namespace GreenshotImgurPlugin {
this.Name = "SettingsForm";
this.ResumeLayout(false);
this.PerformLayout();
}
private GreenshotPlugin.Controls.GreenshotButton historyButton;
private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat;

View file

@ -33,6 +33,8 @@ namespace GreenshotImgurPlugin {
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
CancelButton = buttonCancel;
AcceptButton = buttonOK;
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
ImgurUtils.LoadHistory();
@ -44,14 +46,6 @@ namespace GreenshotImgurPlugin {
}
}
void ButtonOKClick(object sender, EventArgs e) {
this.DialogResult = DialogResult.OK;
}
void ButtonCancelClick(object sender, System.EventArgs e) {
this.DialogResult = DialogResult.Cancel;
}
void ButtonHistoryClick(object sender, EventArgs e) {
ImgurHistory.ShowHistory();
}

View file

@ -90,6 +90,7 @@ namespace GreenshotJiraPlugin {
// uploadButton
//
this.uploadButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.uploadButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.uploadButton.Enabled = false;
this.uploadButton.Location = new System.Drawing.Point(550, 281);
this.uploadButton.Name = "uploadButton";
@ -97,7 +98,6 @@ namespace GreenshotJiraPlugin {
this.uploadButton.TabIndex = 10;
this.uploadButton.Text = "Upload";
this.uploadButton.UseVisualStyleBackColor = true;
this.uploadButton.Click += new System.EventHandler(this.uploadButton_Click);
//
// jiraListView
//
@ -156,13 +156,13 @@ namespace GreenshotJiraPlugin {
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(631, 281);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 11;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// label1
//
@ -206,6 +206,7 @@ namespace GreenshotJiraPlugin {
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.TextBox jiraKey;
private System.Windows.Forms.Label label1;

View file

@ -37,6 +37,9 @@ namespace GreenshotJiraPlugin {
public JiraForm(JiraConnector jiraConnector) {
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
AcceptButton = uploadButton;
CancelButton = cancelButton;
initializeComponentText();
this.columnSorter = new GreenshotColumnSorter();
@ -169,14 +172,6 @@ namespace GreenshotJiraPlugin {
}
}
private void uploadButton_Click(object sender, EventArgs e) {
this.DialogResult = DialogResult.OK;
}
private void cancelButton_Click(object sender, EventArgs e) {
this.DialogResult = DialogResult.Cancel;
}
private void jiraListView_ColumnClick(object sender, ColumnClickEventArgs e) {
// Determine if clicked column is already the column that is being sorted.
if (e.Column == columnSorter.SortColumn) {

View file

@ -57,17 +57,18 @@ namespace GreenshotJiraPlugin {
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(222, 84);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 10;
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.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.LanguageKey = "CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(303, 84);
this.buttonCancel.Name = "buttonCancel";
@ -75,7 +76,6 @@ namespace GreenshotJiraPlugin {
this.buttonCancel.TabIndex = 11;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// label_url
//
@ -134,6 +134,7 @@ namespace GreenshotJiraPlugin {
this.Name = "SettingsForm";
this.ResumeLayout(false);
this.PerformLayout();
}
private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat;
private GreenshotPlugin.Controls.GreenshotLabel label_upload_format;

View file

@ -32,15 +32,9 @@ namespace GreenshotJiraPlugin {
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
void ButtonOKClick(object sender, EventArgs e) {
this.DialogResult = DialogResult.OK;
}
void ButtonCancelClick(object sender, System.EventArgs e) {
this.DialogResult = DialogResult.Cancel;
AcceptButton = buttonOK;
CancelButton = buttonCancel;
Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
}
}

View file

@ -100,6 +100,7 @@ namespace GreenshotOCR
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(12, 98);
this.buttonOK.Name = "buttonOK";
@ -111,13 +112,13 @@ namespace GreenshotOCR
// buttonCancel
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.LanguageKey = "CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(128, 98);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(104, 23);
this.buttonCancel.TabIndex = 5;
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// SettingsForm
//
@ -133,6 +134,7 @@ namespace GreenshotOCR
this.LanguageKey = "settings_title";
this.Name = "SettingsForm";
this.ResumeLayout(false);
}
private GreenshotPlugin.Controls.GreenshotLabel label_language;
private GreenshotPlugin.Controls.GreenshotButton buttonCancel;

View file

@ -35,6 +35,8 @@ namespace GreenshotOCR {
//
this.config = config;
InitializeComponent();
AcceptButton = buttonOK;
CancelButton = buttonCancel;
this.Icon = GreenshotResources.getGreenshotIcon();
comboBox_languages.Items.Clear();
@ -55,17 +57,11 @@ namespace GreenshotOCR {
}
}
void ButtonCancelClick(object sender, EventArgs e) {
DialogResult = DialogResult.Cancel;
}
void ButtonOKClick(object sender, EventArgs e) {
string selectedString = (string) comboBox_languages.SelectedItem;
if (selectedString != null) {
config.Language = selectedString.ToUpper();
}
DialogResult = DialogResult.OK;
}
}
}

View file

@ -56,24 +56,24 @@ namespace GreenshotPhotobucketPlugin {
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(222, 70);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 3;
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.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.LanguageKey = "CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(303, 70);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 4;
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// combobox_uploadimageformat
//

View file

@ -33,15 +33,9 @@ namespace GreenshotPhotobucketPlugin {
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
void ButtonOKClick(object sender, EventArgs e) {
this.DialogResult = DialogResult.OK;
}
void ButtonCancelClick(object sender, System.EventArgs e) {
this.DialogResult = DialogResult.Cancel;
AcceptButton = buttonOK;
CancelButton = buttonCancel;
Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
}
}

View file

@ -56,25 +56,24 @@ namespace GreenshotPicasaPlugin {
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(267, 78);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 10;
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.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.LanguageKey = "CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(348, 78);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 11;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// combobox_uploadimageformat
//
@ -96,7 +95,6 @@ namespace GreenshotPicasaPlugin {
this.label_upload_format.Name = "label_upload_format";
this.label_upload_format.Size = new System.Drawing.Size(181, 33);
this.label_upload_format.TabIndex = 4;
this.label_upload_format.Text = "Image format";
//
// label_AfterUpload
//
@ -106,7 +104,6 @@ namespace GreenshotPicasaPlugin {
this.label_AfterUpload.Name = "label_AfterUpload";
this.label_AfterUpload.Size = new System.Drawing.Size(181, 29);
this.label_AfterUpload.TabIndex = 8;
this.label_AfterUpload.Text = "After upload";
//
// checkboxAfterUploadLinkToClipBoard
//
@ -119,7 +116,6 @@ namespace GreenshotPicasaPlugin {
this.checkboxAfterUploadLinkToClipBoard.SectionName = "Picasa";
this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(104, 17);
this.checkboxAfterUploadLinkToClipBoard.TabIndex = 2;
this.checkboxAfterUploadLinkToClipBoard.Text = "Link to clipboard";
this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true;
//
// SettingsForm
@ -138,9 +134,9 @@ namespace GreenshotPicasaPlugin {
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.Text = "Picasa settings";
this.ResumeLayout(false);
this.PerformLayout();
}
private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat;
private GreenshotPlugin.Controls.GreenshotLabel label_upload_format;

View file

@ -30,22 +30,16 @@ namespace GreenshotPicasaPlugin {
/// Description of PasswordRequestForm.
/// </summary>
public partial class SettingsForm : PicasaForm {
private string PicasaFrob = string.Empty;
public SettingsForm(PicasaConfiguration config) : base() {
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
CancelButton = buttonCancel;
AcceptButton = buttonOK;
Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
void ButtonOKClick(object sender, EventArgs e) {
this.DialogResult = DialogResult.OK;
}
void ButtonCancelClick(object sender, System.EventArgs e) {
this.DialogResult = DialogResult.Cancel;
}
}
}