Skip to content

Commit

Permalink
All - Made Group Description Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Dec 31, 2022
1 parent f45900f commit 945b47a
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 22 deletions.
2 changes: 1 addition & 1 deletion NickvisionMoney.GNOME/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private void OnActivate(Gio.Application sedner, EventArgs e)
mainWindowController.AppInfo.ShortName = "Money";
mainWindowController.AppInfo.Description = mainWindowController.Localizer["Description"];
mainWindowController.AppInfo.Version = "2023.1.0-beta1";
mainWindowController.AppInfo.Changelog = "<ul><li>Money has been completely rewritten in C#. Money should now be a lot more stable and responsive. With the C# rewrite, there is now a new version of Money available on Windows!</li><li>Added an \"Ungrouped\" row to the groups section to allow filtering transactions that don't belong to a group</li><li>Added the ability to attach a jpg/pdf of a receipt to a transaction</li></ul>";
mainWindowController.AppInfo.Changelog = "<ul><li>Money has been completely rewritten in C#. Money should now be a lot more stable and responsive. With the C# rewrite, there is now a new version of Money available on Windows!</li><li>Added an \"Ungrouped\" row to the groups section to allow filtering transactions that don't belong to a group</li><li>Added the ability to attach a jpg/pdf of a receipt to a transaction</li><li>Made a group's description an optional field</li></ul>";
mainWindowController.AppInfo.GitHubRepo = new Uri("https://github.com/nlogozzo/NickvisionMoney");
mainWindowController.AppInfo.IssueTracker = new Uri("https://github.com/nlogozzo/NickvisionMoney/issues/new");
mainWindowController.AppInfo.SupportUrl = new Uri("https://github.com/nlogozzo/NickvisionMoney/discussions");
Expand Down
7 changes: 0 additions & 7 deletions NickvisionMoney.GNOME/Views/GroupDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,12 @@ public bool Run()
{
_rowName.RemoveCssClass("error");
_rowName.SetTitle(_controller.Localizer["Name", "Field"]);
_rowDescription.RemoveCssClass("error");
_rowDescription.SetTitle(_controller.Localizer["Description", "Field"]);
//Mark Error
if (status == GroupCheckStatus.EmptyName)
{
_rowName.AddCssClass("error");
_rowName.SetTitle(_controller.Localizer["Name", "Empty"]);
}
else if(status == GroupCheckStatus.EmptyDescription)
{
_rowDescription.AddCssClass("error");
_rowDescription.SetTitle(_controller.Localizer["Description", "Empty"]);
}
else if(status == GroupCheckStatus.NameExists)
{
_rowName.AddCssClass("error");
Expand Down
1 change: 1 addition & 0 deletions NickvisionMoney.GNOME/org.nickvision.money.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<p>- Money has been completely rewritten in C#. Money should now be a lot more stable and responsive. With the C# rewrite, there is now a new version of Money available on Windows!</p>
<p>- Added an "Ungrouped" row to the groups section to allow filtering transactions that don't belong to a group</p>
<p>- Added the ability to attach a jpg/pdf of a receipt to a transaction</p>
<p>- Made a group's description an optional field</p>
</description>
</release>
</releases>
Expand Down
7 changes: 1 addition & 6 deletions NickvisionMoney.Shared/Controllers/GroupDialogController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ public enum GroupCheckStatus
{
Valid = 0,
EmptyName,
NameExists,
EmptyDescription
NameExists
}

/// <summary>
Expand Down Expand Up @@ -61,10 +60,6 @@ public GroupCheckStatus UpdateGroup(string name, string description)
{
return GroupCheckStatus.EmptyName;
}
if(string.IsNullOrEmpty(description))
{
return GroupCheckStatus.EmptyDescription;
}
if(name != Group.Name && _existingNames.Contains(name))
{
return GroupCheckStatus.NameExists;
Expand Down
2 changes: 1 addition & 1 deletion NickvisionMoney.WinUI/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public App()
_mainWindowController.AppInfo.ShortName = "Money";
_mainWindowController.AppInfo.Description = _mainWindowController.Localizer["Description"];
_mainWindowController.AppInfo.Version = "2023.1.0-beta1";
_mainWindowController.AppInfo.Changelog = "- Money has been completely rewritten in C#. Money should now be a lot more stable and responsive. With the C# rewrite, there is now a new version of Money available on Windows!\n- Added an \"Ungrouped\" row to the groups section to allow filtering transactions that don't belong to a group\n- Added the ability to attach a jpg/pdf of a receipt to a transaction";
_mainWindowController.AppInfo.Changelog = "- Money has been completely rewritten in C#. Money should now be a lot more stable and responsive. With the C# rewrite, there is now a new version of Money available on Windows!\n- Added an \"Ungrouped\" row to the groups section to allow filtering transactions that don't belong to a group\n- Added the ability to attach a jpg/pdf of a receipt to a transaction\n- Made a group's description an optional field";
_mainWindowController.AppInfo.GitHubRepo = new Uri("https://github.com/nlogozzo/NickvisionMoney");
_mainWindowController.AppInfo.IssueTracker = new Uri("https://github.com/nlogozzo/NickvisionMoney/issues/new");
_mainWindowController.AppInfo.SupportUrl = new Uri("https://github.com/nlogozzo/NickvisionMoney/discussions");
Expand Down
4 changes: 2 additions & 2 deletions NickvisionMoney.WinUI/Controls/GroupRow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
<CheckBox x:Name="ChkFilter" wct:DockPanel.Dock="Left" Checked="ChkFilterChanged" Unchecked="ChkFilterChanged">
<CheckBox.Content>
<StackPanel Margin="6,0,0,0" Orientation="Vertical">
<TextBlock x:Name="LblName" TextWrapping="WrapWholeWords"/>
<TextBlock x:Name="LblName" VerticalAlignment="Center" TextWrapping="WrapWholeWords"/>

<TextBlock x:Name="LblDescription" Style="{ThemeResource CaptionTextBlockStyle}" Foreground="Gray" TextWrapping="WrapWholeWords"/>
<TextBlock x:Name="LblDescription" VerticalAlignment="Center" Style="{ThemeResource CaptionTextBlockStyle}" Foreground="Gray" TextWrapping="WrapWholeWords"/>
</StackPanel>
</CheckBox.Content>
</CheckBox>
Expand Down
1 change: 1 addition & 0 deletions NickvisionMoney.WinUI/Controls/GroupRow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public GroupRow(Group group, Localizer localizer, bool filterActive)
//Load Group
ChkFilter.IsChecked = filterActive;
LblName.Text = _group.Name;
LblDescription.Visibility = string.IsNullOrEmpty(_group.Description) ? Visibility.Collapsed : Visibility.Visible;
LblDescription.Text = _group.Description;
LblAmount.Text = _group.Balance.ToString("C");
LblAmount.Foreground = _group.Balance >= 0 ? new SolidColorBrush(ActualTheme == ElementTheme.Light ? Color.FromArgb(255, 38, 162, 105) : Color.FromArgb(255, 143, 240, 164)) : new SolidColorBrush(ActualTheme == ElementTheme.Light ? Color.FromArgb(255, 192, 28, 40) : Color.FromArgb(255, 255, 123, 99));
Expand Down
5 changes: 0 additions & 5 deletions NickvisionMoney.WinUI/Views/GroupDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,10 @@ public new async Task<bool> ShowAsync()
{
//Reset UI
TxtName.Header = _controller.Localizer["Name", "Field"];
TxtDescription.Header = _controller.Localizer["Description", "Field"];
if (checkStatus == GroupCheckStatus.EmptyName)
{
TxtName.Header = _controller.Localizer["Name", "Empty"];
}
else if (checkStatus == GroupCheckStatus.EmptyDescription)
{
TxtDescription.Header = _controller.Localizer["Description", "Empty"];
}
else if (checkStatus == GroupCheckStatus.NameExists)
{
TxtName.Header = _controller.Localizer["Name", "Exists"];
Expand Down

0 comments on commit 945b47a

Please sign in to comment.