-
Notifications
You must be signed in to change notification settings - Fork 654
[DYN-3657] Save changes label #11671
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
Merged
QilongTang
merged 65 commits into
DynamoDS:master
from
Astul-Betizagasti:Save-changes-label
May 11, 2021
Merged
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
1319780
Merge pull request #1 from DynamoDS/master
Astul-Betizagasti c78dfe9
Removal of unused code
Astul-Betizagasti e446a29
Merge pull request #2 from DynamoDS/master
Astul-Betizagasti a361a67
Merge branch 'master' into Graph-Workspaces-Coverage
Astul-Betizagasti f4d5c44
Revert "Removal of unused code"
Astul-Betizagasti 1b91432
Added Obsolete Tag
Astul-Betizagasti 4944efb
Message change
Astul-Betizagasti edf927d
Tests1
Astul-Betizagasti efee990
Merge pull request #3 from DynamoDS/master
Astul-Betizagasti 948b39f
Merge pull request #4 from Astul-Betizagasti/master
Astul-Betizagasti ea4dce4
Merge pull request #5 from DynamoDS/master
Astul-Betizagasti a8b38cc
Tests changes
Astul-Betizagasti ec787fa
Merge pull request #7 from DynamoDS/master
Astul-Betizagasti 7f1c3a5
WorkspaceModel Tests
Astul-Betizagasti a0461d6
Merge pull request #9 from DynamoDS/master
Astul-Betizagasti d2ebf09
Merge branch 'Graph-Workspaces-Coverage' into master
Astul-Betizagasti d96a729
Merge branch 'pr/11'
Astul-Betizagasti b0f8162
Fix merge issue
Astul-Betizagasti 714fe11
Merge pull request #17 from DynamoDS/master
Astul-Betizagasti 3a126b5
Merge pull request #22 from DynamoDS/master
Astul-Betizagasti 02eda71
Merge pull request #23 from DynamoDS/master
Astul-Betizagasti 391876c
Merge pull request #25 from DynamoDS/master
Astul-Betizagasti a5efddc
Merge pull request #26 from DynamoDS/master
Astul-Betizagasti 074953f
GitHub Action For Issue Content
Astul-Betizagasti de03f79
Refactor
Astul-Betizagasti b6e27c2
Update checkIssueInfo.yaml
Astul-Betizagasti fb440d5
Merge pull request #27 from DynamoDS/master
Astul-Betizagasti 053995d
Add github action
Astul-Betizagasti 052efea
Template/Issue parser and comparator improvements
Astul-Betizagasti 8b71a46
Merge pull request #28 from DynamoDS/master
Astul-Betizagasti b58c205
Merge pull request #29 from DynamoDS/master
Astul-Betizagasti 631462e
Update infromation analyzer
Astul-Betizagasti 90b5e82
Merge branch 'CheckIssueContent' into master
Astul-Betizagasti ff0d9c9
Merge pull request #31 from DynamoDS/master
Astul-Betizagasti ae28659
Delete checkIssueInfo.yaml
Astul-Betizagasti 66233a8
Merge pull request #33 from DynamoDS/master
Astul-Betizagasti c1e51ec
Merge pull request #35 from DynamoDS/master
Astul-Betizagasti 3f5e4a6
Merge pull request #36 from DynamoDS/master
Astul-Betizagasti 21457f9
Merge pull request #37 from DynamoDS/master
Astul-Betizagasti 3588f40
Merge pull request #38 from DynamoDS/master
Astul-Betizagasti d6a4d8b
Merge pull request #40 from DynamoDS/master
Astul-Betizagasti 2daeaa7
Merge pull request #42 from DynamoDS/master
Astul-Betizagasti cbced46
Merge pull request #44 from DynamoDS/master
Astul-Betizagasti 81233d5
Merge pull request #46 from DynamoDS/master
Astul-Betizagasti d65f6ef
Merge pull request #47 from DynamoDS/master
Astul-Betizagasti 83f39a8
ux changes
Astul-Betizagasti 045adb8
Disable preferences in debug mode
Astul-Betizagasti d735ddf
fix
Astul-Betizagasti 7f0c885
visibility change
Astul-Betizagasti db8aa60
UX fixes
Astul-Betizagasti 9f0292a
Merge pull request #50 from DynamoDS/master
Astul-Betizagasti bbe512b
Merge branch 'master' into menu-ux-update
Astul-Betizagasti d86e2f3
Merge pull request #51 from Astul-Betizagasti/menu-ux-update
Astul-Betizagasti 195eb7f
Update DynamoView.xaml
Astul-Betizagasti b7a405e
Merge pull request #52 from DynamoDS/master
Astul-Betizagasti 45a7285
Merge pull request #53 from DynamoDS/master
Astul-Betizagasti 7c384f8
Merge pull request #54 from DynamoDS/master
Astul-Betizagasti bf6226b
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Astul-Betizagasti 1add301
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Astul-Betizagasti 5a96392
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Astul-Betizagasti 1dd370f
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Astul-Betizagasti d136cd0
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Astul-Betizagasti d9cca05
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Astul-Betizagasti 19be817
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Astul-Betizagasti 9fc169c
Change save button into a label that will show when changes where saved
Astul-Betizagasti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Drawing; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Reflection; | ||
using Res = Dynamo.Wpf.Properties.Resources; | ||
|
@@ -25,6 +26,8 @@ public enum GeometryScaleSize | |
public class PreferencesViewModel : ViewModelBase | ||
{ | ||
#region Private Properties | ||
private string savedChangesLabel; | ||
private string savedChangesTooltip; | ||
private ObservableCollection<string> languagesList; | ||
private ObservableCollection<string> fontSizeList; | ||
private ObservableCollection<string> numberFormatList; | ||
|
@@ -72,6 +75,38 @@ public Tuple<string, string, string> ScaleRange | |
{GeometryScaleSize.ExtraLarge, new Tuple<string, string, string>("extra large", "1", "100,000,000")} | ||
}; | ||
|
||
/// <summary> | ||
/// Controls what the SavedChanges label will display | ||
/// </summary> | ||
public string SavedChangesLabel | ||
{ | ||
get | ||
{ | ||
return savedChangesLabel; | ||
} | ||
set | ||
{ | ||
savedChangesLabel = value; | ||
RaisePropertyChanged(nameof(SavedChangesLabel)); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Controls what SavedChanges label's tooltip will display | ||
/// </summary> | ||
public string SavedChangesTooltip | ||
{ | ||
get | ||
{ | ||
return savedChangesTooltip; | ||
} | ||
set | ||
{ | ||
savedChangesTooltip = value; | ||
RaisePropertyChanged(nameof(SavedChangesTooltip)); | ||
|
||
} | ||
} | ||
//This includes all the properties that can be set on the General tab | ||
#region General Properties | ||
/// <summary> | ||
|
@@ -87,6 +122,7 @@ public string SelectedLanguage | |
{ | ||
selectedLanguage = value; | ||
RaisePropertyChanged(nameof(SelectedLanguage)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -103,6 +139,7 @@ public string SelectedFontSize | |
{ | ||
selectedFontSize = value; | ||
RaisePropertyChanged(nameof(SelectedFontSize)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -120,6 +157,7 @@ public string SelectedNumberFormat | |
selectedNumberFormat = value; | ||
preferenceSettings.NumberFormat = value; | ||
RaisePropertyChanged(nameof(SelectedNumberFormat)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -145,17 +183,7 @@ public bool RunSettingsIsChecked | |
runSettingsIsChecked = RunType.Automatic; | ||
} | ||
RaisePropertyChanged(nameof(RunSettingsIsChecked)); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Controls the IsChecked property in the Show Run Preview toogle button | ||
/// </summary> | ||
public bool RunPreviewEnabled | ||
{ | ||
get | ||
{ | ||
return runPreviewEnabled; | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -172,6 +200,7 @@ public bool RunPreviewIsChecked | |
{ | ||
dynamoViewModel.ShowRunPreview = value; | ||
RaisePropertyChanged(nameof(RunPreviewIsChecked)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -224,6 +253,7 @@ public ObservableCollection<string> NumberFormatList | |
} | ||
#endregion | ||
|
||
//This includes all the properties that can be set on the Visual Settings tab | ||
#region VisualSettings Properties | ||
/// <summary> | ||
/// This will contain a list of all the Styles created by the user in the Styles list ( Visual Settings -> Group Styles section) | ||
|
@@ -238,6 +268,17 @@ public ObservableCollection<StyleItem> StyleItemsList | |
} | ||
} | ||
|
||
/// <summary> | ||
/// Used to add styles to the StyleItemsListe while also update the saved changes label | ||
/// </summary> | ||
/// <param name="style"></param> | ||
public void AddStyle(StyleItem style) | ||
{ | ||
StyleItemsList.Add(style); | ||
RaisePropertyChanged(nameof(StyleItemsList)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
|
||
/// <summary> | ||
/// This flag will be in true when the Style that user is trying to add already exists (otherwise will be false - Default) | ||
/// </summary> | ||
|
@@ -284,6 +325,7 @@ public GeometryScalingOptions OptionsGeometryScal | |
{ | ||
optionsGeometryScal = value; | ||
RaisePropertyChanged(nameof(OptionsGeometryScal)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -300,6 +342,7 @@ public bool ShowEdges | |
{ | ||
showEdges = value; | ||
RaisePropertyChanged(nameof(ShowEdges)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -316,6 +359,7 @@ public bool IsolateSelectedGeometry | |
{ | ||
isolateSelectedGeometry = value; | ||
RaisePropertyChanged(nameof(IsolateSelectedGeometry)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -332,6 +376,7 @@ public int TessellationDivisions | |
{ | ||
dynamoViewModel.RenderPackageFactoryViewModel.MaxTessellationDivisions = value; | ||
RaisePropertyChanged(nameof(TessellationDivisions)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
#endregion | ||
|
@@ -370,6 +415,7 @@ public string SelectedPythonEngine | |
selectedPythonEngine = value; | ||
preferenceSettings.DefaultPythonEngine = value; | ||
RaisePropertyChanged(nameof(SelectedPythonEngine)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
} | ||
|
@@ -388,6 +434,7 @@ public bool HideIronPythonAlertsIsChecked | |
hideIronPAlerts = value; | ||
preferenceSettings.IsIronPythonDialogDisabled = value; | ||
RaisePropertyChanged(nameof(HideIronPythonAlertsIsChecked)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -406,6 +453,7 @@ public bool ShowWhitespaceIsChecked | |
preferenceSettings.ShowTabsAndSpacesInScriptEditor = value; | ||
showWhitespace = value; | ||
RaisePropertyChanged(nameof(ShowWhitespaceIsChecked)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -423,6 +471,7 @@ public bool NodeAutocompleteIsChecked | |
preferenceSettings.EnableNodeAutoComplete = value; | ||
nodeAutocomplete = value; | ||
RaisePropertyChanged(nameof(NodeAutocompleteIsChecked)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -441,6 +490,7 @@ public bool EnableTSplineIsChecked | |
enableTSpline = value; | ||
HideUnhideNamespace(!value, "ProtoGeometry.dll", "Autodesk.DesignScript.Geometry.TSpline"); | ||
RaisePropertyChanged(nameof(EnableTSplineIsChecked)); | ||
UpdateSavedChangesLabel(); | ||
} | ||
} | ||
|
||
|
@@ -580,6 +630,16 @@ public PreferencesViewModel(DynamoViewModel dynamoViewModel) | |
scaleRanges[GeometryScaleSize.Large].Item3)); | ||
optionsGeometryScal.DescriptionScaleRange.Add(string.Format(Res.ChangeScaleFactorPromptDescriptionContent, scaleRanges[GeometryScaleSize.ExtraLarge].Item2, | ||
scaleRanges[GeometryScaleSize.ExtraLarge].Item3)); | ||
|
||
SavedChangesLabel = string.Empty; | ||
SavedChangesTooltip = string.Empty; | ||
} | ||
|
||
internal void UpdateSavedChangesLabel() | ||
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 add some comments to this function |
||
{ | ||
SavedChangesLabel = Res.PreferencesViewSavedChangesLabel; | ||
//Sets the last saved time in the en-US format | ||
SavedChangesTooltip = Res.PreferencesViewSavedChangesTooltip + DateTime.Now.ToString(@"hh:mm tt", new CultureInfo("en-US")); | ||
} | ||
|
||
/// <summary> | ||
|
@@ -590,6 +650,7 @@ internal void RemoveStyleEntry(string groupName) | |
{ | ||
StyleItem itemToRemove = (from item in StyleItemsList where item.GroupName.Equals(groupName) select item).FirstOrDefault(); | ||
StyleItemsList.Remove(itemToRemove); | ||
UpdateSavedChangesLabel(); | ||
} | ||
|
||
/// <summary> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This call is repeated too many times. We can add a property change listener so we can listen to changes and call this automatically. That way we can get rid of all these single calls.
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.
Something like here: https://github.com/DynamoDS/Dynamo/blob/master/src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs#L636. Single handler can handle all property change I think, then we can filter out properties we need and call
UpdateSavedChangesLabel()
there