mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Added upload format to settings form
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@889 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
19038c7c2b
commit
397702c959
7 changed files with 49 additions and 33 deletions
23
GreenshotJiraPlugin/Forms/SettingsForm.Designer.cs
generated
23
GreenshotJiraPlugin/Forms/SettingsForm.Designer.cs
generated
|
@ -50,6 +50,8 @@ namespace GreenshotJiraPlugin {
|
|||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.label_url = new System.Windows.Forms.Label();
|
||||
this.textBoxUrl = new System.Windows.Forms.TextBox();
|
||||
this.combobox_uploadimageformat = new System.Windows.Forms.ComboBox();
|
||||
this.label_upload_format = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonOK
|
||||
|
@ -90,11 +92,30 @@ namespace GreenshotJiraPlugin {
|
|||
this.textBoxUrl.Size = new System.Drawing.Size(276, 20);
|
||||
this.textBoxUrl.TabIndex = 6;
|
||||
//
|
||||
// combobox_uploadimageformat
|
||||
//
|
||||
this.combobox_uploadimageformat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.combobox_uploadimageformat.FormattingEnabled = true;
|
||||
this.combobox_uploadimageformat.Location = new System.Drawing.Point(102, 47);
|
||||
this.combobox_uploadimageformat.Name = "combobox_uploadimageformat";
|
||||
this.combobox_uploadimageformat.Size = new System.Drawing.Size(276, 21);
|
||||
this.combobox_uploadimageformat.TabIndex = 8;
|
||||
//
|
||||
// label_upload_format
|
||||
//
|
||||
this.label_upload_format.Location = new System.Drawing.Point(12, 50);
|
||||
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 = "Upload format";
|
||||
//
|
||||
// SettingsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(387, 174);
|
||||
this.Controls.Add(this.label_upload_format);
|
||||
this.Controls.Add(this.combobox_uploadimageformat);
|
||||
this.Controls.Add(this.label_url);
|
||||
this.Controls.Add(this.textBoxUrl);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
|
@ -104,6 +125,8 @@ namespace GreenshotJiraPlugin {
|
|||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
}
|
||||
private System.Windows.Forms.ComboBox combobox_uploadimageformat;
|
||||
private System.Windows.Forms.Label label_upload_format;
|
||||
private System.Windows.Forms.TextBox textBoxUrl;
|
||||
private System.Windows.Forms.Label label_url;
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
|
|
|
@ -31,12 +31,17 @@ namespace GreenshotJiraPlugin {
|
|||
public partial class SettingsForm : Form {
|
||||
private ILanguage lang = Language.GetInstance();
|
||||
|
||||
public SettingsForm() {
|
||||
public SettingsForm(JiraConfiguration config) {
|
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent();
|
||||
InitializeTexts();
|
||||
|
||||
combobox_uploadimageformat.Items.Clear();
|
||||
foreach(OutputFormat format in Enum.GetValues(typeof(OutputFormat))) {
|
||||
combobox_uploadimageformat.Items.Add(format.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeTexts() {
|
||||
|
@ -44,6 +49,7 @@ namespace GreenshotJiraPlugin {
|
|||
this.buttonOK.Text = lang.GetString(LangKey.OK);
|
||||
this.buttonCancel.Text = lang.GetString(LangKey.CANCEL);
|
||||
this.Text = lang.GetString(LangKey.login_title);
|
||||
this.label_upload_format.Text = lang.GetString(LangKey.label_upload_format);
|
||||
}
|
||||
|
||||
public string Url {
|
||||
|
@ -51,6 +57,11 @@ namespace GreenshotJiraPlugin {
|
|||
set {textBoxUrl.Text = value;}
|
||||
}
|
||||
|
||||
public string UploadFormat {
|
||||
get {return combobox_uploadimageformat.Text;}
|
||||
set {combobox_uploadimageformat.Text = value;}
|
||||
}
|
||||
|
||||
void ButtonOKClick(object sender, EventArgs e) {
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
|
|
@ -49,12 +49,14 @@ namespace GreenshotJiraPlugin {
|
|||
/// </summary>
|
||||
/// <returns>bool true if OK was pressed, false if cancel</returns>
|
||||
public bool ShowConfigDialog() {
|
||||
SettingsForm pwForm = new SettingsForm();
|
||||
pwForm.Url = Url;
|
||||
DialogResult result = pwForm.ShowDialog();
|
||||
SettingsForm settingsForm = new SettingsForm(this);
|
||||
settingsForm.Url = Url;
|
||||
settingsForm.UploadFormat = UploadFormat.ToString();
|
||||
DialogResult result = settingsForm.ShowDialog();
|
||||
if (result == DialogResult.OK) {
|
||||
if (!pwForm.Url.Equals(Url)) {
|
||||
Url = pwForm.Url;
|
||||
if (!settingsForm.Url.Equals(Url) || !settingsForm.UploadFormat.Equals(UploadFormat.ToString())) {
|
||||
Url = settingsForm.Url;
|
||||
UploadFormat = (OutputFormat)Enum.Parse(typeof(OutputFormat), settingsForm.UploadFormat);
|
||||
}
|
||||
IniConfig.Save();
|
||||
return true;
|
||||
|
|
|
@ -34,9 +34,7 @@ namespace GreenshotJiraPlugin {
|
|||
login_error,
|
||||
login_title,
|
||||
label_url,
|
||||
label_user,
|
||||
label_password,
|
||||
label_no_password_store,
|
||||
label_upload_format,
|
||||
OK,
|
||||
CANCEL,
|
||||
upload_success,
|
||||
|
|
|
@ -37,14 +37,8 @@
|
|||
<resource name="label_url">
|
||||
Url
|
||||
</resource>
|
||||
<resource name="label_user">
|
||||
Benutzer
|
||||
</resource>
|
||||
<resource name="label_password">
|
||||
Password
|
||||
</resource>
|
||||
<resource name="label_no_password_store">
|
||||
Kennwort nicht speichern
|
||||
<resource name="label_upload_format">
|
||||
Bildformat
|
||||
</resource>
|
||||
<resource name="OK">
|
||||
OK
|
||||
|
|
|
@ -34,14 +34,8 @@
|
|||
<resource name="label_url">
|
||||
Url
|
||||
</resource>
|
||||
<resource name="label_user">
|
||||
User
|
||||
</resource>
|
||||
<resource name="label_password">
|
||||
Password
|
||||
</resource>
|
||||
<resource name="label_no_password_store">
|
||||
Do not store the password
|
||||
<resource name="label_upload_format">
|
||||
Upload format
|
||||
</resource>
|
||||
<resource name="login_title">
|
||||
Please enter your Jira login data
|
||||
|
|
|
@ -34,14 +34,8 @@
|
|||
<resource name="label_url">
|
||||
Url
|
||||
</resource>
|
||||
<resource name="label_user">
|
||||
Gebruiker
|
||||
</resource>
|
||||
<resource name="label_password">
|
||||
Wachtwoord
|
||||
</resource>
|
||||
<resource name="label_no_password_store">
|
||||
Het wachtwoord niet opslaan
|
||||
<resource name="label_upload_format">
|
||||
Beeld formaat
|
||||
</resource>
|
||||
<resource name="login_title">
|
||||
Geef uw Jira login data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue