Skip to content

Commit 01eb464

Browse files
Update to functionality, sizing, and About features.
1 parent 400a6cc commit 01eb464

File tree

1 file changed

+137
-50
lines changed

1 file changed

+137
-50
lines changed

VDD Control/VDD Control/MainWindow.cs

Lines changed: 137 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public mainWindow()
5555
// Sync all menu items with the loaded state
5656
SyncAllMenuItemsWithState();
5757

58-
mainConsole.AppendText($"[INFO] XML Settings loaded: SDR10={SDR10_STATE}, HDR+={HDR10PLUS_STATE}, CustomEDID={CUSTOMEDID_STATE}\n");
58+
// Simplified logging - removed detailed state information
5959

6060
// Sync all menu items with the loaded state
6161
SyncAllMenuItemsWithState();
@@ -943,7 +943,12 @@ private async void Form1_Load(object sender, EventArgs e)
943943

944944
AppendToConsole("Virtual Display Driver Control Initialized.\n");
945945

946-
if (!await TryConnectToDriver())
946+
// Try to connect to the driver once at initialization
947+
if (await TryConnectToDriver())
948+
{
949+
AppendToConsole("[SUCCESS] Connected to the driver.\n");
950+
}
951+
else
947952
{
948953
AppendToConsole("[WARNING] Could not verify driver connection. Ensure the driver is running.\n");
949954
}
@@ -999,7 +1004,7 @@ private string LocateSettingsFile()
9991004
{
10001005
registryFilePath = regPath; // Store the directory or full path
10011006
foundPath = fullPath; // Return the full file path
1002-
mainConsole.AppendText($"[INFO] Settings file found in registry: {fullPath}\n");
1007+
mainConsole.AppendText($"[INFO] Settings file found at registry location: {fullPath}\n");
10031008
return foundPath;
10041009
}
10051010
}
@@ -1055,7 +1060,7 @@ private async Task<bool> TryConnectToDriver()
10551060
using (var pipeClient = new NamedPipeClientStream(".", PIPE_NAME, PipeDirection.InOut))
10561061
{
10571062
await pipeClient.ConnectAsync(2000);
1058-
AppendToConsole("[SUCCESS] Connected to the driver.\n");
1063+
// We'll remove the logging here and only show it at the end
10591064
return true;
10601065
}
10611066
}
@@ -1152,7 +1157,10 @@ private async Task<bool> GetDriverFeatureStatus(string featureName)
11521157
if (string.IsNullOrEmpty(response) || response.StartsWith("[ERROR]"))
11531158
{
11541159
// If there's an error or no response, fall back to XML settings
1155-
AppendToConsole($"[INFO] Could not get driver status for {featureName}, using XML settings.\n");
1160+
if (featureName == "SDR10") // Only log once for the first feature check
1161+
{
1162+
AppendToConsole($"[INFO] Could not get driver status, using XML settings.\n");
1163+
}
11561164
return GetFeatureStatusFromXml(featureName);
11571165
}
11581166

@@ -1169,7 +1177,10 @@ private async Task<bool> GetDriverFeatureStatus(string featureName)
11691177
}
11701178

11711179
// If feature not found in response, fall back to XML settings
1172-
AppendToConsole($"[INFO] Feature {featureName} not found in driver status, using XML settings.\n");
1180+
if (featureName == "SDR10") // Only log once
1181+
{
1182+
AppendToConsole($"[INFO] Could not get driver status, using XML settings.\n");
1183+
}
11731184
return GetFeatureStatusFromXml(featureName);
11741185
}
11751186
catch (Exception ex)
@@ -1237,7 +1248,7 @@ private bool GetFeatureStatusFromXml(string featureName)
12371248
result = false;
12381249
break;
12391250
}
1240-
AppendToConsole($"[INFO] {featureName} from XML settings: {result}\n");
1251+
// We'll skip logging individual feature values for a cleaner output
12411252
return result;
12421253
}
12431254

@@ -1267,7 +1278,7 @@ private async Task SyncMenuItemsWithDriverStatus()
12671278
EDIDCEAOVERRRIDE_STATE = IXCLI.EdidCeaOverride;
12681279

12691280
// Log current states for debugging
1270-
AppendToConsole($"[DEBUG] XML Settings loaded: SDR10={SDR10_STATE}, HDR+={HDR10PLUS_STATE}, CustomEDID={CUSTOMEDID_STATE}\n");
1281+
// Simplified logging - removed detailed state logging
12711282

12721283
// Update UI to match
12731284
UpdateAllMenuItemsWithStates();
@@ -1312,7 +1323,7 @@ private async Task SyncMenuItemsWithDriverStatus()
13121323
EDIDCEAOVERRRIDE_STATE = IXCLI.EdidCeaOverride;
13131324

13141325
// Log current states for debugging
1315-
AppendToConsole($"[DEBUG] XML Settings loaded: SDR10={SDR10_STATE}, HDR+={HDR10PLUS_STATE}, CustomEDID={CUSTOMEDID_STATE}\n");
1326+
// Simplified logging - removed detailed state logging
13161327

13171328
// Update UI to match
13181329
UpdateAllMenuItemsWithStates();
@@ -3814,27 +3825,28 @@ private void mttSupport_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
38143825
}
38153826
private void ShowAboutDialog()
38163827
{
3817-
// Create an about dialog
3828+
// Create an about dialog with size adjusted to avoid scrollbars
38183829
Form aboutDialog = new Form
38193830
{
38203831
Text = "About Virtual Driver Control",
3821-
Size = new Size(450, 300),
3832+
Size = new Size(600, 750), // Even larger to ensure all content fits without scrollbars
38223833
FormBorderStyle = FormBorderStyle.FixedDialog,
38233834
StartPosition = FormStartPosition.CenterParent,
38243835
MaximizeBox = false,
38253836
MinimizeBox = false,
38263837
BackColor = Color.FromArgb(32, 34, 37),
3827-
ForeColor = Color.White
3838+
ForeColor = Color.White,
3839+
AutoScroll = false // Disable scrolling as we'll size properly
38283840
};
38293841

3830-
// Add logo placeholder (could be replaced with an actual logo)
3842+
// Add logo placeholder
38313843
Label logoLabel = new Label
38323844
{
38333845
Text = "VDD Control",
38343846
Font = new Font("Consolas", 18, FontStyle.Bold),
38353847
ForeColor = Color.White,
38363848
TextAlign = ContentAlignment.MiddleCenter,
3837-
Size = new Size(400, 30),
3849+
Size = new Size(550, 30),
38383850
Location = new Point(25, 20)
38393851
};
38403852
aboutDialog.Controls.Add(logoLabel);
@@ -3846,8 +3858,8 @@ private void ShowAboutDialog()
38463858
Font = new Font("Consolas", 10),
38473859
ForeColor = Color.White,
38483860
TextAlign = ContentAlignment.MiddleCenter,
3849-
Size = new Size(400, 20),
3850-
Location = new Point(25, 50)
3861+
Size = new Size(550, 20),
3862+
Location = new Point(25, 55) // Increased vertical spacing
38513863
};
38523864
aboutDialog.Controls.Add(versionLabel);
38533865

@@ -3858,45 +3870,131 @@ private void ShowAboutDialog()
38583870
Font = new Font("Consolas", 9),
38593871
ForeColor = Color.White,
38603872
TextAlign = ContentAlignment.TopLeft,
3861-
Size = new Size(400, 40),
3862-
Location = new Point(25, 80)
3873+
Size = new Size(550, 40),
3874+
Location = new Point(25, 90) // Increased vertical spacing
38633875
};
38643876
aboutDialog.Controls.Add(descLabel);
38653877

3866-
// Add developers section
3867-
Label developersHeader = new Label
3878+
int currentY = 145; // Increased starting position
3879+
3880+
// Project Leadership section
3881+
Label leadershipHeader = new Label
38683882
{
3869-
Text = "Developers:",
3870-
Font = new Font("Consolas", 9, FontStyle.Bold),
3883+
Text = "Project Leadership",
3884+
Font = new Font("Consolas", 10, FontStyle.Bold),
38713885
ForeColor = Color.White,
38723886
TextAlign = ContentAlignment.MiddleLeft,
3873-
Size = new Size(100, 20),
3874-
Location = new Point(25, 130)
3887+
Size = new Size(200, 20),
3888+
Location = new Point(25, currentY)
3889+
};
3890+
aboutDialog.Controls.Add(leadershipHeader);
3891+
currentY += 25;
3892+
3893+
Label leadershipLabel = new Label
3894+
{
3895+
Text = "• Mike \"MikeTheTech\" Rodriguez – Project Manager, Owner, and Principal Programmer",
3896+
Font = new Font("Consolas", 9),
3897+
ForeColor = Color.White,
3898+
TextAlign = ContentAlignment.TopLeft,
3899+
Size = new Size(500, 20),
3900+
Location = new Point(35, currentY)
3901+
};
3902+
aboutDialog.Controls.Add(leadershipLabel);
3903+
currentY += 40; // Increased spacing
3904+
3905+
// Core Development section
3906+
Label coreDevHeader = new Label
3907+
{
3908+
Text = "Core Development",
3909+
Font = new Font("Consolas", 10, FontStyle.Bold),
3910+
ForeColor = Color.White,
3911+
TextAlign = ContentAlignment.MiddleLeft,
3912+
Size = new Size(200, 20),
3913+
Location = new Point(25, currentY)
3914+
};
3915+
aboutDialog.Controls.Add(coreDevHeader);
3916+
currentY += 25;
3917+
3918+
Label coreDevLabel = new Label
3919+
{
3920+
Text = "• Bud – Former Lead Programmer\n" +
3921+
"• zjoasan – Programmer; scripting, EDID integration, installer logic\n" +
3922+
"• Baloukj – 8‑bit / 10‑bit color‑depth implementation; first public release\n" +
3923+
" of the new Microsoft driver",
3924+
Font = new Font("Consolas", 9),
3925+
ForeColor = Color.White,
3926+
TextAlign = ContentAlignment.TopLeft,
3927+
Size = new Size(550, 80), // Increased width and height
3928+
Location = new Point(35, currentY)
3929+
};
3930+
aboutDialog.Controls.Add(coreDevLabel);
3931+
currentY += 95; // Increased spacing
3932+
3933+
// Research & Engineering Support section
3934+
Label researchHeader = new Label
3935+
{
3936+
Text = "Research & Engineering Support",
3937+
Font = new Font("Consolas", 10, FontStyle.Bold),
3938+
ForeColor = Color.White,
3939+
TextAlign = ContentAlignment.MiddleLeft,
3940+
Size = new Size(250, 20),
3941+
Location = new Point(25, currentY)
3942+
};
3943+
aboutDialog.Controls.Add(researchHeader);
3944+
currentY += 25;
3945+
3946+
Label researchLabel = new Label
3947+
{
3948+
Text = "• Anakngtokwa – Source discovery and driver‑code research\n" +
3949+
"• AKATrevorJay – High‑resolution EDID contribution\n" +
3950+
"• LexTrack – MiniScreenRecorder script",
3951+
Font = new Font("Consolas", 9),
3952+
ForeColor = Color.White,
3953+
TextAlign = ContentAlignment.TopLeft,
3954+
Size = new Size(550, 70), // Increased width and height
3955+
Location = new Point(35, currentY)
3956+
};
3957+
aboutDialog.Controls.Add(researchLabel);
3958+
currentY += 85; // Increased spacing
3959+
3960+
// Foundational Code section
3961+
Label foundationHeader = new Label
3962+
{
3963+
Text = "Foundational Code & Inspiration",
3964+
Font = new Font("Consolas", 10, FontStyle.Bold),
3965+
ForeColor = Color.White,
3966+
TextAlign = ContentAlignment.MiddleLeft,
3967+
Size = new Size(250, 20),
3968+
Location = new Point(25, currentY)
38753969
};
3876-
aboutDialog.Controls.Add(developersHeader);
3970+
aboutDialog.Controls.Add(foundationHeader);
3971+
currentY += 25;
38773972

3878-
Label developersLabel = new Label
3973+
Label foundationLabel = new Label
38793974
{
3880-
Text = "- MikeTheTech\n- Jocke",
3975+
Text = "• Microsoft, ge9, sitiom – Original Indirect Display Driver sample\n" +
3976+
"• Roshkins – Original repository host and maintainer",
38813977
Font = new Font("Consolas", 9),
38823978
ForeColor = Color.White,
38833979
TextAlign = ContentAlignment.TopLeft,
3884-
Size = new Size(400, 40),
3885-
Location = new Point(35, 150)
3980+
Size = new Size(550, 50), // Increased width and height
3981+
Location = new Point(35, currentY)
38863982
};
3887-
aboutDialog.Controls.Add(developersLabel);
3983+
aboutDialog.Controls.Add(foundationLabel);
3984+
currentY += 75; // Increased spacing
38883985

38893986
// Add links section
38903987
Label linksHeader = new Label
38913988
{
38923989
Text = "Links:",
3893-
Font = new Font("Consolas", 9, FontStyle.Bold),
3990+
Font = new Font("Consolas", 10, FontStyle.Bold),
38943991
ForeColor = Color.White,
38953992
TextAlign = ContentAlignment.MiddleLeft,
38963993
Size = new Size(100, 20),
3897-
Location = new Point(25, 190)
3994+
Location = new Point(25, currentY)
38983995
};
38993996
aboutDialog.Controls.Add(linksHeader);
3997+
currentY += 25;
39003998

39013999
LinkLabel githubLink = new LinkLabel
39024000
{
@@ -3905,22 +4003,23 @@ private void ShowAboutDialog()
39054003
LinkColor = Color.LightBlue,
39064004
ActiveLinkColor = Color.White,
39074005
TextAlign = ContentAlignment.TopLeft,
3908-
Size = new Size(400, 20),
3909-
Location = new Point(35, 210)
4006+
Size = new Size(500, 20),
4007+
Location = new Point(35, currentY)
39104008
};
39114009
githubLink.LinkClicked += (s, e) => System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
39124010
{
39134011
FileName = "https://github.com/VirtualDisplay/",
39144012
UseShellExecute = true
39154013
});
39164014
aboutDialog.Controls.Add(githubLink);
4015+
currentY += 55; // Increased spacing
39174016

39184017
// Add OK button
39194018
Button okButton = new Button
39204019
{
39214020
Text = "OK",
39224021
Size = new Size(80, 30),
3923-
Location = new Point(350, 230),
4022+
Location = new Point(495, currentY), // Further adjusted position
39244023
BackColor = Color.FromArgb(45, 47, 49),
39254024
ForeColor = Color.White,
39264025
FlatStyle = FlatStyle.Flat
@@ -3978,16 +4077,8 @@ private void devModeLoggingToolStripMenuItem_Click_1(object sender, EventArgs e)
39784077
}
39794078
private void UpdateAllMenuItemsWithStates()
39804079
{
3981-
// Debug: Log current state values
3982-
AppendToConsole($"[DEBUG] Updating menu items - Current state values:\n");
3983-
AppendToConsole($" SDR10_STATE: {SDR10_STATE}\n");
3984-
AppendToConsole($" HDR10PLUS_STATE: {HDR10PLUS_STATE}\n");
3985-
AppendToConsole($" CUSTOMEDID_STATE: {CUSTOMEDID_STATE}\n");
3986-
AppendToConsole($" HARDWARECURSOR_STATE: {HARDWARECURSOR_STATE}\n");
3987-
AppendToConsole($" PREVENTEDIDSPOOF_STATE: {PREVENTEDIDSPOOF_STATE}\n");
3988-
AppendToConsole($" EDIDCEAOVERRRIDE_STATE: {EDIDCEAOVERRRIDE_STATE}\n");
3989-
AppendToConsole($" LOGGING_STATE: {LOGGING_STATE}\n");
3990-
AppendToConsole($" DEVLOGGING_STATE: {DEVLOGGING_STATE}\n");
4080+
// Simplified debug logging
4081+
AppendToConsole($"[DEBUG] Updating menu items\n");
39914082

39924083
// Update primary menu items
39934084
sDR10bitToolStripMenuItem.Checked = SDR10_STATE;
@@ -4021,11 +4112,7 @@ private void UpdateAllMenuItemsWithStates()
40214112
if (devModeLoggingToolStripMenuItem1 != null)
40224113
devModeLoggingToolStripMenuItem1.Checked = DEVLOGGING_STATE;
40234114

4024-
// Debug: Log actual menu item states after update
4025-
AppendToConsole($"[DEBUG] Menu items after update:\n");
4026-
AppendToConsole($" SDR10 menu: {sDR10bitToolStripMenuItem.Checked}\n");
4027-
AppendToConsole($" HDR+ menu: {hDRToolStripMenuItem.Checked}\n");
4028-
AppendToConsole($" CustomEDID menu: {customEDIDToolStripMenuItem.Checked}\n");
4115+
// Removed detailed logging of menu states
40294116

40304117
// Force UI update
40314118
mainVisibleMenuStrip.Invalidate();

0 commit comments

Comments
 (0)