Skip to content

Commit fdee27b

Browse files
committed
Feature: Profile & group description
1 parent 7fc9d49 commit fdee27b

File tree

9 files changed

+265
-200
lines changed

9 files changed

+265
-200
lines changed

Source/NETworkManager.Localization/Resources/Strings.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/NETworkManager.Localization/Resources/Strings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3854,4 +3854,7 @@ Right-click for more options.</value>
38543854
<data name="ExampleProfileDescription" xml:space="preserve">
38553855
<value>Ubuntu Server running Docker with Nextcloud and Traefik...</value>
38563856
</data>
3857+
<data name="ExampleGroupDescription" xml:space="preserve">
3858+
<value>Linux servers running in AWS...</value>
3859+
</data>
38573860
</root>

Source/NETworkManager.Profiles/GroupInfo.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class GroupInfo
1919
/// </summary>
2020
public GroupInfo()
2121
{
22-
Profiles = new List<ProfileInfo>();
22+
Profiles = [];
2323
}
2424

2525
/// <summary>
@@ -35,6 +35,10 @@ public GroupInfo(string name) : this()
3535
/// </summary>
3636
public GroupInfo(GroupInfo group) : this(group.Name)
3737
{
38+
// General
39+
Description = group.Description;
40+
41+
// Profiles
3842
Profiles = group.Profiles;
3943

4044
// Remote Desktop
@@ -164,6 +168,11 @@ public GroupInfo(GroupInfo group) : this(group.Name)
164168
/// Name of the group.
165169
/// </summary>
166170
public string Name { get; set; }
171+
172+
/// <summary>
173+
/// Description of the group.
174+
/// </summary>
175+
public string Description { get; set; }
167176

168177
[XmlIgnore] public bool IsDynamic { get; set; }
169178

Source/NETworkManager/ProfileDialogManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ private static GroupInfo ParseGroupInfo(GroupViewModel instance)
305305
return new GroupInfo
306306
{
307307
Name = name,
308-
308+
Description = instance.Description?.Trim(),
309+
309310
Profiles = profiles,
310311

311312
// Remote Desktop

Source/NETworkManager/ViewModels/GroupViewModel.cs

Lines changed: 221 additions & 197 deletions
Large diffs are not rendered by default.

Source/NETworkManager/ViewModels/ProfileViewModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace NETworkManager.ViewModels;
2222

2323
public class ProfileViewModel : ViewModelBase
2424
{
25+
#region Constructor
2526
public ProfileViewModel(Action<ProfileViewModel> saveCommand, Action<ProfileViewModel> cancelHandler,
2627
IReadOnlyCollection<string> groups, string group = null, ProfileEditMode editMode = ProfileEditMode.Add,
2728
ProfileInfo profile = null, ApplicationName applicationName = ApplicationName.None)
@@ -333,6 +334,8 @@ public ProfileViewModel(Action<ProfileViewModel> saveCommand, Action<ProfileView
333334
_isLoading = false;
334335
}
335336

337+
#endregion
338+
336339
#region Methods
337340

338341
private void ChangeNetworkConnectionTypeSettings(NetworkConnectionType connectionSpeed)

Source/NETworkManager/Views/GroupDialog.xaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,8 @@
616616
</Grid.Resources>
617617
<Grid.RowDefinitions>
618618
<RowDefinition Height="Auto" />
619+
<RowDefinition Height="10" />
620+
<RowDefinition Height="Auto" />
619621
</Grid.RowDefinitions>
620622
<Grid.ColumnDefinitions>
621623
<ColumnDefinition Width="1*" />
@@ -645,6 +647,18 @@
645647
<Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource ErrorToolTip}" />
646648
</Rectangle.Resources>
647649
</Rectangle>
650+
<TextBlock Grid.Column="0" Grid.Row="2"
651+
Text="{x:Static Member=localization:Strings.Description}"
652+
Margin="0,5,0,0"
653+
VerticalAlignment="Top" />
654+
<TextBox Grid.Column="2" Grid.Row="2"
655+
AcceptsReturn="True"
656+
TextWrapping="Wrap"
657+
VerticalScrollBarVisibility="Auto"
658+
VerticalContentAlignment="Top"
659+
Height="150"
660+
Text="{Binding Path=Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
661+
mah:TextBoxHelper.Watermark="{x:Static Member=localization:Strings.ExampleGroupDescription}" />
648662
</Grid>
649663
</StackPanel>
650664
</ScrollViewer>

Source/NETworkManager/Views/ProfileDialog.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@
13771377
VerticalContentAlignment="Top"
13781378
Height="150"
13791379
Text="{Binding Path=Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
1380-
mah:TextBoxHelper.Watermark="{x:Static Member=localization:Strings.ExampleDescription}" />
1380+
mah:TextBoxHelper.Watermark="{x:Static Member=localization:Strings.ExampleProfileDescription}" />
13811381
<TextBlock Grid.Column="0" Grid.Row="6" Text="{x:Static localization:Strings.Group}" />
13821382
<ComboBox x:Name="ComboBoxGroup" Grid.Column="2" Grid.Row="6"
13831383
Style="{StaticResource EditableComboBox}" ItemsSource="{Binding Groups}"

Website/docs/changelog/next-release.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Release date: **xx.xx.2024**
2020
## What's new?
2121

2222
- Applications can now be sorted via drag & drop in the application sidebar or in the settings under `Settings > General > Applications`. [#2781](https://github.com/BornToBeRoot/NETworkManager/pull/2781)
23+
- Profiles now have a field for a description, which is displayed together with the host name/IP address in a tooltip in the profile sidebar. [#2877](https://github.com/BornToBeRoot/NETworkManager/pull/2877)
2324

2425
## Improvements
2526

@@ -31,6 +32,7 @@ Release date: **xx.xx.2024**
3132
## Bugfixes
3233

3334
- **Ping Monitor**
35+
3436
- A problem has been fixed where the ping does not start if the DNS server is not configured. This can occur if the network interface via which the Windows DNS server was configured is deactivated/disconnected. [#2876](https://github.com/BornToBeRoot/NETworkManager/pull/2876)
3537

3638
- TextBox content not centered because of ScrollViewer issue. [#2763](https://github.com/BornToBeRoot/NETworkManager/pull/2763)

0 commit comments

Comments
 (0)