Skip to content

Commit 4a52c6a

Browse files
authored
Feature: Profile description and tooltip (#2877)
* Feature: Profile description and tooltip * Feature: Profile & group description * Feature: Add group description * Feature: Profile & group description
1 parent 9b8b2ce commit 4a52c6a

29 files changed

+681
-253
lines changed

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

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/NETworkManager.Localization/Resources/StaticStrings.resx

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
<data name="ExamplePortScanRange" xml:space="preserve">
228228
<value>22; 80; 443; 500 - 999; 8080</value>
229229
</data>
230-
<data name="ExampleRemoteDesktopProfileName" xml:space="preserve">
230+
<data name="ExampleProfileName" xml:space="preserve">
231231
<value>Webserver</value>
232232
</data>
233233
<data name="ExampleSerialLine" xml:space="preserve">

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

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/NETworkManager.Localization/Resources/Strings.resx

+6
Original file line numberDiff line numberDiff line change
@@ -3851,4 +3851,10 @@ Right-click for more options.</value>
38513851
<data name="SetDefault" xml:space="preserve">
38523852
<value>Set default</value>
38533853
</data>
3854+
<data name="ExampleProfileDescription" xml:space="preserve">
3855+
<value>Ubuntu Server running Docker with Nextcloud and Traefik...</value>
3856+
</data>
3857+
<data name="ExampleGroupDescription" xml:space="preserve">
3858+
<value>Linux servers running in AWS...</value>
3859+
</data>
38543860
</root>

Source/NETworkManager.Profiles/GroupInfo.cs

+10-1
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.Profiles/ProfileInfo.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public ProfileInfo(ProfileInfo profile)
3131
{
3232
Name = profile.Name;
3333
Host = profile.Host;
34+
Description = profile.Description;
3435
Group = profile.Group;
3536
Tags = profile.Tags;
3637

@@ -248,11 +249,16 @@ public ProfileInfo(ProfileInfo profile)
248249
/// </summary>
249250
public string Host { get; set; }
250251

252+
/// <summary>
253+
/// Description of the profile.
254+
/// </summary>
255+
public string Description { get; set; }
256+
251257
/// <summary>
252258
/// Name of the group. Profiles are grouped based on the name.
253259
/// </summary>
254260
public string Group { get; set; }
255-
261+
256262
/// <summary>
257263
/// Tags to classify the profiles and to filter by it.
258264
/// </summary>

Source/NETworkManager/ProfileDialogManager.cs

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Security;
4-
using System.Threading.Tasks;
5-
using System.Windows;
6-
using MahApps.Metro.Controls.Dialogs;
1+
using MahApps.Metro.Controls.Dialogs;
72
using NETworkManager.Localization.Resources;
83
using NETworkManager.Models;
94
using NETworkManager.Models.Network;
@@ -12,6 +7,11 @@
127
using NETworkManager.Profiles;
138
using NETworkManager.ViewModels;
149
using NETworkManager.Views;
10+
using System;
11+
using System.Collections.Generic;
12+
using System.Security;
13+
using System.Threading.Tasks;
14+
using System.Windows;
1515

1616
namespace NETworkManager;
1717

@@ -31,6 +31,7 @@ private static ProfileInfo ParseProfileInfo(ProfileViewModel instance)
3131
{
3232
Name = instance.Name.Trim(),
3333
Host = instance.Host.Trim(),
34+
Description = instance.Description?.Trim(),
3435
Group = instance.Group.Trim(),
3536
Tags = instance.Tags?.Trim(),
3637

@@ -304,7 +305,8 @@ private static GroupInfo ParseGroupInfo(GroupViewModel instance)
304305
return new GroupInfo
305306
{
306307
Name = name,
307-
308+
Description = instance.Description?.Trim(),
309+
308310
Profiles = profiles,
309311

310312
// Remote Desktop

0 commit comments

Comments
 (0)