Skip to content
This repository was archived by the owner on Jan 28, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions UserInterface/MainWindow.portlist.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows;
Expand Down Expand Up @@ -177,6 +178,17 @@ private void MenuRemoveOutdated_Click(object sender, RoutedEventArgs e)
var code = ExecutionDialog.RunVcpkg("remove --outdated", out string result, true);
}

private void MenuBrowseHomepage_Click(object sender, RoutedEventArgs e)
{
var port = PortsList.SelectedItem as Port;
var pkg = port.Name.Trim();
var homepage = (port.CoreParagraph.Homepage ?? "").Trim();
if (homepage.StartsWith("http://") || homepage.StartsWith("https://"))
Process.Start(homepage);
else
MessageBox.Show($"Homepage not specified in {pkg}", "Browse Homepage", MessageBoxButton.OK, MessageBoxImage.Warning);
}

#endregion
}
}
2 changes: 2 additions & 0 deletions UserInterface/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@
<MenuItem Header="Show full description" IsCheckable="True"
Checked="MenuShowFullDescription_Checked"
Unchecked="MenuShowFullDescription_Unchecked"/>
<Separator/>
<MenuItem Header="Browse Homepage" Click="MenuBrowseHomepage_Click" />
</ContextMenu>
</ListView.ContextMenu>
<ListView.ItemTemplate>
Expand Down
2 changes: 2 additions & 0 deletions UserInterface/Port.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public static Port ParseControlFile(string filepath)
switch (item.Key)
{
case "Version": port.CoreParagraph.Version = item.Value; break;
case "Homepage": port.CoreParagraph.Homepage = item.Value; break;
case "Build-Depends": port.CoreParagraph.Depends = CommaSplit(item.Value); break;
case "Description": port.CoreParagraph.Description = item.Value; break;
case "Maintainer": port.CoreParagraph.Maintainer = item.Value; break;
Expand Down Expand Up @@ -157,6 +158,7 @@ public sealed class SourceParagraph
{
public string Name { get; set; }
public string Version { get; set; }
public string Homepage { get; set; }
public string Description { get; set; }
public string Maintainer { get; set; }
public string[] Supports { get; set; }
Expand Down