Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 38f5aa325c | |||
| ac53fbf80e |
@@ -82,6 +82,17 @@ jobs:
|
||||
echo Installer directory contents:
|
||||
dir installer
|
||||
|
||||
- name: Create Portable Zip
|
||||
shell: powershell
|
||||
run: |
|
||||
$version = "${{ gitea.ref_name }}".TrimStart("v")
|
||||
$buildDir = "DellMonitorControl\bin\Release\net9.0-windows"
|
||||
$zipName = "MonitorControl-Portable-$version.zip"
|
||||
|
||||
Write-Host "Creating portable zip: $zipName"
|
||||
Compress-Archive -Path "$buildDir\*" -DestinationPath $zipName -Force
|
||||
Write-Host "Zip created successfully"
|
||||
|
||||
- name: Create Release
|
||||
shell: powershell
|
||||
env:
|
||||
@@ -104,7 +115,7 @@ jobs:
|
||||
$body = @{
|
||||
tag_name = $tag
|
||||
name = "Monitor Control $tag"
|
||||
body = "## Monitor Control $tag`n`n### Installation`nDownload and run the installer.`n`n### Features`n- System tray monitor control`n- Brightness/Contrast adjustment`n- Input source switching`n- Quick-switch toolbar`n`n### Requirements`n- Windows 10/11`n- .NET 9.0 Runtime"
|
||||
body = "## Monitor Control $tag`n`n### Installation`n- **Installer**: Download and run the setup exe`n- **Portable**: Download the zip, extract anywhere, and run DellMonitorControl.exe`n`n### Features`n- System tray monitor control`n- Brightness/Contrast adjustment`n- Input source switching`n- Quick-switch toolbar`n`n### Requirements`n- Windows 10/11`n- .NET 9.0 Runtime"
|
||||
} | ConvertTo-Json
|
||||
|
||||
$release = Invoke-RestMethod -Uri "$baseUrl/repos/$repo/releases" -Method Post -Headers @{"Authorization"="token $env:GITEA_TOKEN"; "Content-Type"="application/json"} -Body $body
|
||||
@@ -113,10 +124,15 @@ jobs:
|
||||
}
|
||||
|
||||
# Upload installer
|
||||
$filePath = "C:\build\app\installer\MonitorControl-Setup-$version.exe"
|
||||
$fileName = "MonitorControl-Setup-$version.exe"
|
||||
Write-Host "Uploading $fileName..."
|
||||
$installerPath = "C:\build\app\installer\MonitorControl-Setup-$version.exe"
|
||||
$installerName = "MonitorControl-Setup-$version.exe"
|
||||
Write-Host "Uploading $installerName..."
|
||||
curl.exe -X POST -H "Authorization: token $env:GITEA_TOKEN" -F "attachment=@$installerPath" "$baseUrl/repos/$repo/releases/$releaseId/assets?name=$installerName"
|
||||
|
||||
curl.exe -X POST -H "Authorization: token $env:GITEA_TOKEN" -F "attachment=@$filePath" "$baseUrl/repos/$repo/releases/$releaseId/assets?name=$fileName"
|
||||
# Upload portable zip
|
||||
$zipPath = "MonitorControl-Portable-$version.zip"
|
||||
$zipName = "MonitorControl-Portable-$version.zip"
|
||||
Write-Host "Uploading $zipName..."
|
||||
curl.exe -X POST -H "Authorization: token $env:GITEA_TOKEN" -F "attachment=@$zipPath" "$baseUrl/repos/$repo/releases/$releaseId/assets?name=$zipName"
|
||||
|
||||
Write-Host "Installer uploaded successfully"
|
||||
Write-Host "All assets uploaded successfully"
|
||||
|
||||
@@ -8,14 +8,16 @@
|
||||
<RootNamespace>DellMonitorControl</RootNamespace>
|
||||
<Product>ControlMyMonitorManagement</Product>
|
||||
<UseWPF>true</UseWPF>
|
||||
<Company>Dang</Company>
|
||||
<Copyright>Copyright © DangWang $([System.DateTime]::Now.ToString(yyyy))</Copyright>
|
||||
<Company>MarketAlly</Company>
|
||||
<Authors>David H. Friedel Jr</Authors>
|
||||
<Copyright>Copyright © MarketAlly $([System.DateTime]::Now.ToString(yyyy))</Copyright>
|
||||
<ApplicationIcon>MonitorIcon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.0.17</Version>
|
||||
<AssemblyVersion>1.0.17.0</AssemblyVersion>
|
||||
<FileVersion>1.0.17.0</FileVersion>
|
||||
<Version>1.0.19</Version>
|
||||
<AssemblyVersion>1.0.19.0</AssemblyVersion>
|
||||
<FileVersion>1.0.19.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -181,6 +181,15 @@ public partial class MainWindow : Window
|
||||
var inputOptions = await CMMCommand.GetInputSourceOptions(m.SerialNumber);
|
||||
DebugLogger.Log($" Input options count: {inputOptions.Count}");
|
||||
|
||||
// Some monitors don't report current input in their possible values list
|
||||
// Add it if missing so user can see what's currently selected
|
||||
if (inputSource.HasValue && !inputOptions.Any(o => o.Value == inputSource.Value))
|
||||
{
|
||||
var currentInputName = CMMCommand.GetInputSourceName(inputSource.Value);
|
||||
inputOptions.Insert(0, new InputSourceOption(inputSource.Value, currentInputName));
|
||||
DebugLogger.Log($" Added missing current input: {inputSource.Value} ({currentInputName})");
|
||||
}
|
||||
|
||||
DebugLogger.Log($" Getting power status...");
|
||||
var powerStatus = await CMMCommand.GetMonPowerStatus(m.SerialNumber) ?? "Unknown";
|
||||
DebugLogger.Log($" Power status: {powerStatus}");
|
||||
@@ -188,7 +197,8 @@ public partial class MainWindow : Window
|
||||
_loadedMonitors.Add((m, inputOptions));
|
||||
|
||||
// Apply config to filter hidden ports and use custom labels
|
||||
var filteredOptions = MonitorConfigManager.ApplyConfigToOptions(m.SerialNumber, inputOptions);
|
||||
// Pass currentInput so we never hide the currently active port
|
||||
var filteredOptions = MonitorConfigManager.ApplyConfigToOptions(m.SerialNumber, inputOptions, inputSource);
|
||||
DebugLogger.Log($" Filtered options count: {filteredOptions.Count}");
|
||||
|
||||
// Monitor name header with Config button
|
||||
|
||||
@@ -86,7 +86,8 @@ public static class MonitorConfigManager
|
||||
|
||||
public static List<InputSourceOption> ApplyConfigToOptions(
|
||||
string serialNumber,
|
||||
List<InputSourceOption> options)
|
||||
List<InputSourceOption> options,
|
||||
int? currentInput = null)
|
||||
{
|
||||
var monitorConfig = GetMonitorConfig(serialNumber);
|
||||
|
||||
@@ -101,8 +102,11 @@ public static class MonitorConfigManager
|
||||
|
||||
if (portConfig != null)
|
||||
{
|
||||
// Respect hidden setting - don't show hidden ports
|
||||
if (portConfig.IsHidden)
|
||||
// Never hide the currently active input - user needs to see what's selected
|
||||
bool isCurrentInput = currentInput.HasValue && option.Value == currentInput.Value;
|
||||
|
||||
// Respect hidden setting - don't show hidden ports (unless it's the current input)
|
||||
if (portConfig.IsHidden && !isCurrentInput)
|
||||
continue;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(portConfig.CustomLabel))
|
||||
|
||||
@@ -130,7 +130,7 @@ public static class CMMCommand
|
||||
return options;
|
||||
}
|
||||
|
||||
private static string GetInputSourceName(int vcpValue)
|
||||
public static string GetInputSourceName(int vcpValue)
|
||||
{
|
||||
return vcpValue switch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user