Changed destinations to have the picker as a separate check box.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1729 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-03-31 20:39:16 +00:00
commit 55f3f3b342
4 changed files with 59 additions and 36 deletions

View file

@ -1475,7 +1475,6 @@ namespace Greenshot {
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(785, 485);
this.Controls.Add(this.toolStripContainer1);
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
this.KeyPreview = true;
this.Name = "ImageEditorForm";
this.Activated += new System.EventHandler(this.ImageEditorFormActivated);

View file

@ -93,6 +93,8 @@ namespace Greenshot {
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ImageEditorForm));
Image backgroundForTransparency = (Image)resources.GetObject("checkerboard.Image");
surface.TransparencyBackgroundBrush = new TextureBrush(backgroundForTransparency, WrapMode.Tile);

View file

@ -104,6 +104,7 @@ namespace Greenshot {
this.numericUpDownWaitTime = new System.Windows.Forms.NumericUpDown();
this.label_waittime = new System.Windows.Forms.Label();
this.tab_output = new System.Windows.Forms.TabPage();
this.tab_destinations = new System.Windows.Forms.TabPage();
this.tab_printer = new System.Windows.Forms.TabPage();
this.groupbox_printoptions = new System.Windows.Forms.GroupBox();
this.checkboxPrintInverted = new System.Windows.Forms.CheckBox();
@ -117,7 +118,7 @@ namespace Greenshot {
this.groupbox_plugins = new System.Windows.Forms.GroupBox();
this.listview_plugins = new System.Windows.Forms.ListView();
this.button_pluginconfigure = new System.Windows.Forms.Button();
this.tab_destinations = new System.Windows.Forms.TabPage();
this.checkbox_picker = new System.Windows.Forms.CheckBox();
this.groupbox_preferredfilesettings.SuspendLayout();
this.groupbox_applicationsettings.SuspendLayout();
this.groupbox_jpegsettings.SuspendLayout();
@ -135,6 +136,7 @@ namespace Greenshot {
this.groupbox_capture.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWaitTime)).BeginInit();
this.tab_output.SuspendLayout();
this.tab_destinations.SuspendLayout();
this.tab_printer.SuspendLayout();
this.groupbox_printoptions.SuspendLayout();
this.tab_plugins.SuspendLayout();
@ -346,6 +348,7 @@ namespace Greenshot {
//
// groupbox_destination
//
this.groupbox_destination.Controls.Add(this.checkbox_picker);
this.groupbox_destination.Controls.Add(this.checkedDestinationsListBox);
this.groupbox_destination.Location = new System.Drawing.Point(2, 6);
this.groupbox_destination.Name = "groupbox_destination";
@ -357,10 +360,10 @@ namespace Greenshot {
// checkedDestinationsListBox
//
this.checkedDestinationsListBox.FormattingEnabled = true;
this.checkedDestinationsListBox.Location = new System.Drawing.Point(5, 20);
this.checkedDestinationsListBox.Location = new System.Drawing.Point(5, 50);
this.checkedDestinationsListBox.Name = "checkedDestinationsListBox";
this.checkedDestinationsListBox.ScrollAlwaysVisible = true;
this.checkedDestinationsListBox.Size = new System.Drawing.Size(401, 284);
this.checkedDestinationsListBox.Size = new System.Drawing.Size(401, 244);
this.checkedDestinationsListBox.TabIndex = 0;
this.checkedDestinationsListBox.SelectedValueChanged += new System.EventHandler(this.DestinationsCheckStateChanged);
//
@ -710,6 +713,16 @@ namespace Greenshot {
this.tab_output.Text = "Output";
this.tab_output.UseVisualStyleBackColor = true;
//
// tab_destinations
//
this.tab_destinations.Controls.Add(this.groupbox_destination);
this.tab_destinations.Location = new System.Drawing.Point(4, 22);
this.tab_destinations.Name = "tab_destinations";
this.tab_destinations.Size = new System.Drawing.Size(423, 320);
this.tab_destinations.TabIndex = 4;
this.tab_destinations.Text = "Destinations";
this.tab_destinations.UseVisualStyleBackColor = true;
//
// tab_printer
//
this.tab_printer.Controls.Add(this.groupbox_printoptions);
@ -721,16 +734,6 @@ namespace Greenshot {
this.tab_printer.Text = "Printer";
this.tab_printer.UseVisualStyleBackColor = true;
//
// tab_destinations
//
this.tab_destinations.Location = new System.Drawing.Point(4, 22);
this.tab_destinations.Controls.Add(this.groupbox_destination);
this.tab_destinations.Name = "tab_destinations";
this.tab_destinations.Size = new System.Drawing.Size(423, 320);
this.tab_destinations.TabIndex = 4;
this.tab_destinations.Text = "Destinations";
this.tab_destinations.UseVisualStyleBackColor = true;
//
// groupbox_printoptions
//
this.groupbox_printoptions.Controls.Add(this.checkboxPrintInverted);
@ -879,6 +882,16 @@ namespace Greenshot {
this.button_pluginconfigure.UseVisualStyleBackColor = true;
this.button_pluginconfigure.Click += new System.EventHandler(this.Button_pluginconfigureClick);
//
// checkbox_picker
//
this.checkbox_picker.Location = new System.Drawing.Point(6, 19);
this.checkbox_picker.Name = "checkbox_picker";
this.checkbox_picker.Size = new System.Drawing.Size(394, 24);
this.checkbox_picker.TabIndex = 19;
this.checkbox_picker.Text = "Destination picker";
this.checkbox_picker.UseVisualStyleBackColor = true;
this.checkbox_picker.CheckStateChanged += new System.EventHandler(this.DestinationsCheckStateChanged);
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@ -888,11 +901,9 @@ namespace Greenshot {
this.Controls.Add(this.settings_okay);
this.Controls.Add(this.settings_cancel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.Text = "SettingsForm";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SettingsFormFormClosing);
this.Shown += new System.EventHandler(this.SettingsFormShown);
this.groupbox_preferredfilesettings.ResumeLayout(false);
@ -916,14 +927,15 @@ namespace Greenshot {
this.groupbox_capture.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWaitTime)).EndInit();
this.tab_output.ResumeLayout(false);
this.tab_destinations.ResumeLayout(false);
this.tab_printer.ResumeLayout(false);
this.groupbox_printoptions.ResumeLayout(false);
this.tab_plugins.ResumeLayout(false);
this.groupbox_plugins.ResumeLayout(false);
this.groupbox_plugins.PerformLayout();
this.ResumeLayout(false);
}
private System.Windows.Forms.CheckBox checkbox_picker;
private System.Windows.Forms.CheckedListBox checkedDestinationsListBox;
private System.Windows.Forms.GroupBox groupbox_editor;
private System.Windows.Forms.CheckBox checkbox_editor_match_capture_size;

View file

@ -47,6 +47,9 @@ namespace Greenshot {
public SettingsForm() {
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
// Fix for Vista/XP differences
if(Environment.OSVersion.Version.Major >= 6) {
this.trackBarJpegQuality.BackColor = System.Drawing.SystemColors.Window;
@ -275,10 +278,16 @@ namespace Greenshot {
checkbox_alwaysshowjpegqualitydialog.Checked = coreConfiguration.OutputFilePromptQuality;
checkbox_playsound.Checked = coreConfiguration.PlayCameraSound;
checkbox_picker.Checked = false;
checkedDestinationsListBox.Items.Clear();
foreach(IDestination destination in DestinationHelper.GetAllDestinations()) {
if (PickerDestination.DESIGNATION.Equals(destination.Designation)) {
checkbox_picker.Checked = true;
checkbox_picker.Text = destination.Description;
} else {
checkedDestinationsListBox.Items.Add(destination, coreConfiguration.OutputDestinations.Contains(destination.Designation));
}
}
// checkbox_clipboard.Checked = coreConfiguration.OutputDestinations.Contains("Clipboard");
// checkbox_file.Checked = coreConfiguration.OutputDestinations.Contains("File");
// checkbox_fileas.Checked = coreConfiguration.OutputDestinations.Contains("FileWithDialog");
@ -340,6 +349,9 @@ namespace Greenshot {
coreConfiguration.PlayCameraSound = checkbox_playsound.Checked;
List<string> destinations = new List<string>();
if (checkbox_picker.Checked) {
destinations.Add(PickerDestination.DESIGNATION);
}
foreach(int index in checkedDestinationsListBox.CheckedIndices) {
IDestination destination = (IDestination)checkedDestinationsListBox.Items[index];
if (checkedDestinationsListBox.GetItemCheckState(index) == CheckState.Checked) {
@ -486,22 +498,20 @@ namespace Greenshot {
/// </summary>
void CheckDestinationSettings() {
bool clipboardDestinationChecked = false;
bool pickerSelected = false;
bool pickerSelected = checkbox_picker.Checked;
foreach(IDestination destination in checkedDestinationsListBox.CheckedItems) {
if (destination.Designation.Equals(ClipboardDestination.DESIGNATION)) {
clipboardDestinationChecked = true;
}
if (destination.Designation.Equals(PickerDestination.DESIGNATION)) {
pickerSelected = true;
break;
}
}
if (pickerSelected) {
foreach(int index in checkedDestinationsListBox.CheckedIndices) {
IDestination destination = (IDestination)checkedDestinationsListBox.Items[index];
if (!destination.Designation.Equals(PickerDestination.DESIGNATION)) {
checkedDestinationsListBox.SetItemCheckState(index, CheckState.Indeterminate);
}
}
} else {
foreach(int index in checkedDestinationsListBox.CheckedIndices) {
if (checkedDestinationsListBox.GetItemCheckState(index) == CheckState.Indeterminate) {