-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Added "run" settings to properties window for shortcut files #16672
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -5,6 +5,7 @@ | |||||||
using Files.Shared.Helpers; | ||||||||
using System.Windows.Input; | ||||||||
using TagLib; | ||||||||
using Windows.Win32.UI.WindowsAndMessaging; | ||||||||
|
||||||||
namespace Files.App.Data.Models | ||||||||
{ | ||||||||
|
@@ -526,7 +527,6 @@ public bool IsItemSelected | |||||||
|
||||||||
public SelectedItemsPropertiesViewModel() | ||||||||
{ | ||||||||
|
||||||||
} | ||||||||
|
||||||||
private bool isSelectedItemImage = false; | ||||||||
|
@@ -782,6 +782,42 @@ public bool RunAsAdminEnabled | |||||||
set => SetProperty(ref runAsAdminEnabled, value); | ||||||||
} | ||||||||
|
||||||||
private static readonly IReadOnlyDictionary<SHOW_WINDOW_CMD, string> showWindowCommandTypes = new Dictionary<SHOW_WINDOW_CMD, string> | ||||||||
{ | ||||||||
{ SHOW_WINDOW_CMD.SW_NORMAL, Strings.NormalWindow.GetLocalizedResource() }, | ||||||||
{ SHOW_WINDOW_CMD.SW_SHOWMINNOACTIVE, Strings.Minimized.GetLocalizedResource() }, | ||||||||
{ SHOW_WINDOW_CMD.SW_MAXIMIZE, Strings.Maximized.GetLocalizedResource() } | ||||||||
}.AsReadOnly(); | ||||||||
public IReadOnlyDictionary<SHOW_WINDOW_CMD, string> ShowWindowCommandTypes { get => showWindowCommandTypes; } | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
public string SelectedShowWindowCommand | ||||||||
{ | ||||||||
get => ShowWindowCommandTypes.GetValueOrDefault(ShowWindowCommandEditedValue)!; | ||||||||
set => ShowWindowCommandEditedValue = ShowWindowCommandTypes.First(e => e.Value == value).Key; | ||||||||
} | ||||||||
|
||||||||
private SHOW_WINDOW_CMD showWindowCommand; | ||||||||
public SHOW_WINDOW_CMD ShowWindowCommand | ||||||||
{ | ||||||||
get => showWindowCommand; | ||||||||
set | ||||||||
{ | ||||||||
if (SetProperty(ref showWindowCommand, value)) | ||||||||
ShowWindowCommandEditedValue = value; | ||||||||
} | ||||||||
} | ||||||||
|
||||||||
private SHOW_WINDOW_CMD showWindowCommandEditedValue; | ||||||||
public SHOW_WINDOW_CMD ShowWindowCommandEditedValue | ||||||||
{ | ||||||||
get => showWindowCommandEditedValue; | ||||||||
set | ||||||||
{ | ||||||||
if (SetProperty(ref showWindowCommandEditedValue, value)) | ||||||||
OnPropertyChanged(nameof(SelectedShowWindowCommand)); | ||||||||
} | ||||||||
} | ||||||||
|
||||||||
private bool isPropertiesLoaded; | ||||||||
public bool IsPropertiesLoaded | ||||||||
{ | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1838,6 +1838,18 @@ | |
<data name="CompatibilityRegisterThisProgramForRestart" xml:space="preserve"> | ||
<value>Register this program for restart</value> | ||
</data> | ||
<data name="Run" xml:space="preserve"> | ||
<value>Run</value> | ||
</data> | ||
Comment on lines
+1841
to
+1843
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be more user friendly to title the option as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's go with |
||
<data name="NormalWindow" xml:space="preserve"> | ||
<value>Normal window</value> | ||
</data> | ||
<data name="Minimized" xml:space="preserve"> | ||
<value>Minimized</value> | ||
</data> | ||
<data name="Maximized" xml:space="preserve"> | ||
<value>Maximized</value> | ||
</data> | ||
<data name="RunAsAdministrator" xml:space="preserve"> | ||
<value>Run as administrator</value> | ||
</data> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments for the new properties