Fixed a regression with menus not set to radio buttons and then not unsetting other menu buttons
This commit is contained in:
parent
dc1deb2938
commit
cba9437ffa
3 changed files with 28 additions and 11 deletions
|
|
@ -28,6 +28,7 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Localizations;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
|
@ -88,7 +89,20 @@ namespace MatterHackers.MatterControl.Library
|
|||
{
|
||||
get
|
||||
{
|
||||
return Path.GetFileName(this.FilePath);
|
||||
var finalDirectory = Path.GetFileName(this.FilePath);
|
||||
if (string.IsNullOrEmpty(finalDirectory))
|
||||
{
|
||||
if (FilePath.Length > 0)
|
||||
{
|
||||
return $"{FilePath[0]} " + "Drive".Localize();
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Unknown".Localize();
|
||||
}
|
||||
}
|
||||
|
||||
return finalDirectory;
|
||||
}
|
||||
|
||||
set
|
||||
|
|
|
|||
|
|
@ -249,21 +249,21 @@ namespace MatterHackers.MatterControl.Library.Widgets
|
|||
"Date Created".Localize(),
|
||||
() => libraryView.ActiveSort.HasFlag(SortKey.CreatedDate),
|
||||
(v) => libraryView.SetUserSort(SortKey.CreatedDate),
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
|
||||
popupMenu.CreateBoolMenuItem(
|
||||
"Date Modified".Localize(),
|
||||
() => libraryView.ActiveSort.HasFlag(SortKey.ModifiedDate),
|
||||
(v) => libraryView.SetUserSort(SortKey.ModifiedDate),
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
|
||||
popupMenu.CreateBoolMenuItem(
|
||||
"Name".Localize(),
|
||||
() => libraryView.ActiveSort.HasFlag(SortKey.Name),
|
||||
(v) => libraryView.SetUserSort(SortKey.Name),
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
|
||||
popupMenu.CreateSeparator();
|
||||
|
|
@ -274,14 +274,14 @@ namespace MatterHackers.MatterControl.Library.Widgets
|
|||
"Ascending".Localize(),
|
||||
() => libraryView.Ascending,
|
||||
(v) => libraryView.SetUserSort(ascending: true),
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
|
||||
popupMenu.CreateBoolMenuItem(
|
||||
"Descending".Localize(),
|
||||
() => !libraryView.Ascending,
|
||||
(v) => libraryView.SetUserSort(ascending: false),
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
|
||||
return popupMenu;
|
||||
|
|
@ -328,7 +328,7 @@ namespace MatterHackers.MatterControl.Library.Widgets
|
|||
(isChecked) => {
|
||||
listView.SetContentView(ListViewModes.RowListView);
|
||||
},
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
#if DEBUG
|
||||
popupMenu.CreateBoolMenuItem(
|
||||
|
|
@ -338,7 +338,7 @@ namespace MatterHackers.MatterControl.Library.Widgets
|
|||
{
|
||||
listView.SetContentView(ListViewModes.IconListView18);
|
||||
},
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
|
||||
popupMenu.CreateBoolMenuItem(
|
||||
|
|
@ -348,7 +348,7 @@ namespace MatterHackers.MatterControl.Library.Widgets
|
|||
{
|
||||
listView.SetContentView(ListViewModes.IconListView70);
|
||||
},
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
#endif
|
||||
popupMenu.CreateBoolMenuItem(
|
||||
|
|
@ -358,7 +358,7 @@ namespace MatterHackers.MatterControl.Library.Widgets
|
|||
{
|
||||
listView.SetContentView(ListViewModes.IconListView);
|
||||
},
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
|
||||
popupMenu.CreateBoolMenuItem(
|
||||
|
|
@ -368,7 +368,7 @@ namespace MatterHackers.MatterControl.Library.Widgets
|
|||
{
|
||||
listView.SetContentView(ListViewModes.IconListView256);
|
||||
},
|
||||
useRadioStyle: false,
|
||||
useRadioStyle: true,
|
||||
siblingRadioButtonList: siblingList);
|
||||
|
||||
return popupMenu;
|
||||
|
|
|
|||
|
|
@ -1405,6 +1405,9 @@ Translated:Downloading updates...
|
|||
English:Downloads
|
||||
Translated:Downloads
|
||||
|
||||
English:Drive
|
||||
Translated:Drive
|
||||
|
||||
English:Dual Contouring
|
||||
Translated:Dual Contouring
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue