mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 21:43:24 -07:00
Fixed Bug #3527838 by simplifying the quick settings.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1881 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
6fc15cddd3
commit
71db9bc438
1 changed files with 19 additions and 18 deletions
|
@ -1030,31 +1030,32 @@ namespace Greenshot {
|
||||||
void QuickSettingDestinationChanged(object sender, EventArgs e) {
|
void QuickSettingDestinationChanged(object sender, EventArgs e) {
|
||||||
ToolStripMenuSelectListItem item = ((ItemCheckedChangedEventArgs)e).Item;
|
ToolStripMenuSelectListItem item = ((ItemCheckedChangedEventArgs)e).Item;
|
||||||
IDestination selectedDestination = (IDestination)item.Data;
|
IDestination selectedDestination = (IDestination)item.Data;
|
||||||
if (item.Checked && selectedDestination.Designation.Equals(PickerDestination.DESIGNATION)) {
|
if (item.Checked) {
|
||||||
foreach(ToolStripMenuSelectList ddi in contextmenu_quicksettings.DropDownItems) {
|
if (selectedDestination.Designation.Equals(PickerDestination.DESIGNATION)) {
|
||||||
if (ddi.Identifier.Equals("destinations")) {
|
// If the item is the destination picker, remove all others
|
||||||
foreach(ToolStripMenuSelectListItem dropDownItem in ddi.DropDownItems) {
|
conf.OutputDestinations.Clear();
|
||||||
IDestination destination = dropDownItem.Data as IDestination;
|
} else {
|
||||||
if (!destination.Designation.Equals(PickerDestination.DESIGNATION)) {
|
// If the item is not the destination picker, remove the picker
|
||||||
if (dropDownItem.CheckState == CheckState.Checked) {
|
conf.OutputDestinations.Remove(PickerDestination.DESIGNATION);
|
||||||
dropDownItem.CheckState = CheckState.Unchecked;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
conf.OutputDestinations.Clear();
|
// Checked an item, add if the destination is not yet selected
|
||||||
conf.OutputDestinations.Add(selectedDestination.Designation);
|
if (!conf.OutputDestinations.Contains(selectedDestination.Designation)) {
|
||||||
} else {
|
|
||||||
if (item.Checked && !conf.OutputDestinations.Contains(selectedDestination.Designation)) {
|
|
||||||
conf.OutputDestinations.Add(selectedDestination.Designation);
|
conf.OutputDestinations.Add(selectedDestination.Designation);
|
||||||
}
|
}
|
||||||
if (!item.Checked && conf.OutputDestinations.Contains(selectedDestination.Designation)) {
|
} else {
|
||||||
|
// deselected a destination, only remove if it was selected
|
||||||
|
if (conf.OutputDestinations.Contains(selectedDestination.Designation)) {
|
||||||
conf.OutputDestinations.Remove(selectedDestination.Designation);
|
conf.OutputDestinations.Remove(selectedDestination.Designation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Check if something was selected, if not make the picker the default
|
||||||
|
if (conf.OutputDestinations == null || conf.OutputDestinations.Count == 0) {
|
||||||
|
conf.OutputDestinations.Add(PickerDestination.DESIGNATION);
|
||||||
|
}
|
||||||
IniConfig.Save();
|
IniConfig.Save();
|
||||||
|
|
||||||
|
// Rebuild the quick settings menu with the new settings.
|
||||||
|
InitializeQuickSettingsMenu();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue