diff --git a/Ui/Views/JobsView.Designer.cs b/Ui/Views/JobsView.Designer.cs index 5d50296..7ee25d0 100644 --- a/Ui/Views/JobsView.Designer.cs +++ b/Ui/Views/JobsView.Designer.cs @@ -25,7 +25,10 @@ namespace PolyTraderSharp.Ui.Views this.col_dgv_jobs_Enabled = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.col_dgv_jobs_Run = new System.Windows.Forms.DataGridViewButtonColumn(); this.colDescription = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.toolStripJobs = new System.Windows.Forms.ToolStrip(); + this.tsJobsRefresh = new System.Windows.Forms.ToolStripButton(); ((System.ComponentModel.ISupportInitialize)(this.dgvJobs)).BeginInit(); + this.toolStripJobs.SuspendLayout(); this.SuspendLayout(); // // dgvJobs @@ -104,15 +107,35 @@ namespace PolyTraderSharp.Ui.Views this.colDescription.Name = "colDescription"; this.colDescription.ReadOnly = true; // + // toolStripJobs + // + this.toolStripJobs.ImageScalingSize = new System.Drawing.Size(24, 24); + this.toolStripJobs.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tsJobsRefresh}); + this.toolStripJobs.Location = new System.Drawing.Point(0, 0); + this.toolStripJobs.Name = "toolStripJobs"; + this.toolStripJobs.Size = new System.Drawing.Size(1000, 25); + this.toolStripJobs.TabIndex = 1; + // + // tsJobsRefresh + // + this.tsJobsRefresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.tsJobsRefresh.Name = "tsJobsRefresh"; + this.tsJobsRefresh.Text = "Aktualisieren"; + this.tsJobsRefresh.ToolTipText = "Job-Liste neu zeichnen (Status/Zeiten aktualisieren)."; + // // JobsView // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.dgvJobs); + this.Controls.Add(this.toolStripJobs); this.ClientSize = new System.Drawing.Size(1000, 500); this.Name = "JobsView"; this.Text = "Server Jobs"; ((System.ComponentModel.ISupportInitialize)(this.dgvJobs)).EndInit(); + this.toolStripJobs.ResumeLayout(false); + this.toolStripJobs.PerformLayout(); this.ResumeLayout(false); } @@ -126,5 +149,7 @@ namespace PolyTraderSharp.Ui.Views private System.Windows.Forms.DataGridViewCheckBoxColumn col_dgv_jobs_Enabled; private System.Windows.Forms.DataGridViewButtonColumn col_dgv_jobs_Run; private System.Windows.Forms.DataGridViewTextBoxColumn colDescription; + private System.Windows.Forms.ToolStrip toolStripJobs; + private System.Windows.Forms.ToolStripButton tsJobsRefresh; } } diff --git a/Ui/Views/JobsView.cs b/Ui/Views/JobsView.cs index c3e0c35..2963ed6 100644 --- a/Ui/Views/JobsView.cs +++ b/Ui/Views/JobsView.cs @@ -18,6 +18,7 @@ namespace PolyTraderSharp.Ui.Views colLastRun.DefaultCellStyle.Format = "HH:mm:ss"; colNextRun.DefaultCellStyle.Format = "HH:mm:ss"; dgvJobs.CellContentClick += DgvJobs_CellContentClick; + tsJobsRefresh.Click += (_, _) => dgvJobs.Refresh(); } public void Initialize(JobManager jobManager) diff --git a/Ui/Views/TerminalView.Designer.cs b/Ui/Views/TerminalView.Designer.cs index ae0035e..b98cc96 100644 --- a/Ui/Views/TerminalView.Designer.cs +++ b/Ui/Views/TerminalView.Designer.cs @@ -18,12 +18,20 @@ namespace PolyTraderSharp.Ui.Views private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.pnlTop = new System.Windows.Forms.Panel(); this.btnAutoscroll = new System.Windows.Forms.Button(); this.cbLogLevel = new System.Windows.Forms.ComboBox(); this.lblFilter = new System.Windows.Forms.Label(); this.rtbTerminal = new System.Windows.Forms.RichTextBox(); + this.contextMenuTerminal = new System.Windows.Forms.ContextMenuStrip(this.components); + this.miCopy = new System.Windows.Forms.ToolStripMenuItem(); + this.miSelectAll = new System.Windows.Forms.ToolStripMenuItem(); + this.miCopyAll = new System.Windows.Forms.ToolStripMenuItem(); + this.miSep1 = new System.Windows.Forms.ToolStripSeparator(); + this.miClear = new System.Windows.Forms.ToolStripMenuItem(); this.pnlTop.SuspendLayout(); + this.contextMenuTerminal.SuspendLayout(); this.SuspendLayout(); // // pnlTop @@ -83,6 +91,43 @@ namespace PolyTraderSharp.Ui.Views this.rtbTerminal.Size = new System.Drawing.Size(900, 464); this.rtbTerminal.TabIndex = 1; this.rtbTerminal.Text = ""; + this.rtbTerminal.ContextMenuStrip = this.contextMenuTerminal; + // + // contextMenuTerminal + // + this.contextMenuTerminal.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.miCopy, + this.miSelectAll, + this.miCopyAll, + this.miSep1, + this.miClear}); + this.contextMenuTerminal.Name = "contextMenuTerminal"; + // + // miCopy + // + this.miCopy.Name = "miCopy"; + this.miCopy.ShortcutKeyDisplayString = "Strg+C"; + this.miCopy.Text = "Kopieren"; + // + // miSelectAll + // + this.miSelectAll.Name = "miSelectAll"; + this.miSelectAll.ShortcutKeyDisplayString = "Strg+A"; + this.miSelectAll.Text = "Alles auswählen"; + // + // miCopyAll + // + this.miCopyAll.Name = "miCopyAll"; + this.miCopyAll.Text = "Alles kopieren"; + // + // miSep1 + // + this.miSep1.Name = "miSep1"; + // + // miClear + // + this.miClear.Name = "miClear"; + this.miClear.Text = "Terminal leeren"; // // TerminalView // @@ -95,6 +140,7 @@ namespace PolyTraderSharp.Ui.Views this.Text = "Terminal / Logs"; this.pnlTop.ResumeLayout(false); this.pnlTop.PerformLayout(); + this.contextMenuTerminal.ResumeLayout(false); this.ResumeLayout(false); } @@ -105,5 +151,11 @@ namespace PolyTraderSharp.Ui.Views private System.Windows.Forms.ComboBox cbLogLevel; private System.Windows.Forms.Button btnAutoscroll; private System.Windows.Forms.RichTextBox rtbTerminal; + private System.Windows.Forms.ContextMenuStrip contextMenuTerminal; + private System.Windows.Forms.ToolStripMenuItem miCopy; + private System.Windows.Forms.ToolStripMenuItem miSelectAll; + private System.Windows.Forms.ToolStripMenuItem miCopyAll; + private System.Windows.Forms.ToolStripSeparator miSep1; + private System.Windows.Forms.ToolStripMenuItem miClear; } } diff --git a/Ui/Views/TerminalView.cs b/Ui/Views/TerminalView.cs index 5d3e0ec..7cda319 100644 --- a/Ui/Views/TerminalView.cs +++ b/Ui/Views/TerminalView.cs @@ -27,6 +27,22 @@ namespace PolyTraderSharp.Ui.Views if (cbLogLevel.Items.Count > 0) cbLogLevel.SelectedIndex = 0; btnAutoscroll.Click += (_, _) => ToggleAutoscroll(); _uiLogTimer.Tick += ProcessLogQueue; + + // Kontextmenü: Text aus dem Terminal kopieren (Ctrl+C funktioniert zusätzlich nativ). + miCopy.Click += (_, _) => { if (rtbTerminal.SelectionLength > 0) rtbTerminal.Copy(); }; + miSelectAll.Click += (_, _) => rtbTerminal.SelectAll(); + miCopyAll.Click += (_, _) => CopyAllToClipboard(); + miClear.Click += (_, _) => rtbTerminal.Clear(); + } + + private void CopyAllToClipboard() + { + try + { + if (!string.IsNullOrEmpty(rtbTerminal.Text)) + Clipboard.SetText(rtbTerminal.Text); + } + catch { /* Zwischenablage kann kurzzeitig belegt sein – bewusst ignorieren */ } } /// Verbindet die View mit dem Logger (Laufzeit-DI).