UI Slice 5: Menueleiste (Fenster nebeneinander), sicheres Beenden, Modul-Aktivierung

- Fenster-Menue: WindowMenu fuellt die oberste MenuStrip mit Top-Level-Eintraegen
  nebeneinander (mit Icon) statt Untermenue "Fenster"; ModuleView.Icon zentral in der
  App zugewiesen (AssignMenuIcons). Kein miFenster mehr im Launcher-Designer.
- Sicheres Beenden: ShutdownConfirmDialog (10s-Timer sperrt "Jetzt beenden", Abbrechen
  jederzeit) via IModuleUiHost.RequestShutdown(). Nur der Launcher (Hauptprozess) bietet
  "Beenden"; andere Fenster nur "Fenster schliessen" (kein App-Shutdown, Module laufen
  weiter). Launcher-Schliessen-X routet ueber dieselbe Abfrage.
- Modul-Aktivierung (restart-basiert): ServerSettings.DisabledModules, in Program.Main
  vor der DI-Registrierung gefiltert -> deaktivierte Module werden nicht geladen.
  Dashboard-Tab "Module" zeigt Status + schaltet um (Hinweis: greift nach Neustart).
  Optionaler IPolyTraderModule.GetActivationBlocker fuer "nicht aktivierbar"-Info.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-07-23 18:46:09 +02:00
co-authored by Claude Opus 4.8
parent 886de3a85b
commit 039bc240f8
13 changed files with 685 additions and 61 deletions
+120
View File
@@ -0,0 +1,120 @@
namespace PolyTraderSharp.Ui
{
partial class ShutdownConfirmDialog
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
lblTitle = new System.Windows.Forms.Label();
lblInfo = new System.Windows.Forms.Label();
lblCountdown = new System.Windows.Forms.Label();
btnConfirm = new System.Windows.Forms.Button();
btnCancel = new System.Windows.Forms.Button();
countdownTimer = new System.Windows.Forms.Timer(components);
SuspendLayout();
//
// lblTitle
//
lblTitle.AutoSize = true;
lblTitle.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold);
lblTitle.Location = new System.Drawing.Point(18, 16);
lblTitle.Name = "lblTitle";
lblTitle.Size = new System.Drawing.Size(300, 28);
lblTitle.TabIndex = 0;
lblTitle.Text = "PolyTrader sicher beenden?";
//
// lblInfo
//
lblInfo.Location = new System.Drawing.Point(20, 52);
lblInfo.Name = "lblInfo";
lblInfo.Size = new System.Drawing.Size(464, 96);
lblInfo.TabIndex = 1;
lblInfo.Text = "PolyTrader und alle Module werden geordnet heruntergefahren. Laufende API-Aufrufe, "
+ "Order- und Trading-Vorgänge werden dabei sauber abgeschlossen.\r\n\r\n"
+ "Aus Sicherheit ist die Beenden-Schaltfläche erst nach Ablauf eines kurzen Timers "
+ "aktiv. Abbrechen ist jederzeit möglich.";
//
// lblCountdown
//
lblCountdown.AutoSize = true;
lblCountdown.Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Bold);
lblCountdown.ForeColor = System.Drawing.Color.Firebrick;
lblCountdown.Location = new System.Drawing.Point(20, 158);
lblCountdown.Name = "lblCountdown";
lblCountdown.Size = new System.Drawing.Size(200, 23);
lblCountdown.TabIndex = 2;
lblCountdown.Text = "Beenden möglich in 10 s …";
//
// btnConfirm
//
btnConfirm.DialogResult = System.Windows.Forms.DialogResult.OK;
btnConfirm.Enabled = false;
btnConfirm.Location = new System.Drawing.Point(232, 196);
btnConfirm.Name = "btnConfirm";
btnConfirm.Size = new System.Drawing.Size(140, 36);
btnConfirm.TabIndex = 3;
btnConfirm.Text = "Beenden (10 s)";
btnConfirm.UseVisualStyleBackColor = true;
//
// btnCancel
//
btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
btnCancel.Location = new System.Drawing.Point(380, 196);
btnCancel.Name = "btnCancel";
btnCancel.Size = new System.Drawing.Size(104, 36);
btnCancel.TabIndex = 4;
btnCancel.Text = "Abbrechen";
btnCancel.UseVisualStyleBackColor = true;
//
// countdownTimer
//
countdownTimer.Interval = 1000;
countdownTimer.Tick += CountdownTimer_Tick;
//
// ShutdownConfirmDialog
//
AcceptButton = btnConfirm;
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
CancelButton = btnCancel;
ClientSize = new System.Drawing.Size(504, 248);
Controls.Add(btnCancel);
Controls.Add(btnConfirm);
Controls.Add(lblCountdown);
Controls.Add(lblInfo);
Controls.Add(lblTitle);
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
MaximizeBox = false;
MinimizeBox = false;
Name = "ShutdownConfirmDialog";
ShowIcon = false;
ShowInTaskbar = false;
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
Text = "PolyTrader beenden";
ResumeLayout(false);
PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblTitle;
private System.Windows.Forms.Label lblInfo;
private System.Windows.Forms.Label lblCountdown;
private System.Windows.Forms.Button btnConfirm;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Timer countdownTimer;
}
}