From ff4f44b22ae8d6522ee22599174a6cdd41bc0314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 5 Dec 2021 19:30:32 +0100 Subject: Pre-select the last sent signal in SignalsPanel Instead of pre-selecting SIGTERM every time, select the signal last send in the same htop session. Closes: #862 --- SignalsPanel.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'SignalsPanel.c') diff --git a/SignalsPanel.c b/SignalsPanel.c index f1c53795..cb71130f 100644 --- a/SignalsPanel.c +++ b/SignalsPanel.c @@ -18,15 +18,14 @@ in the source distribution for its full text. #include "XUtils.h" -Panel* SignalsPanel_new() { +Panel* SignalsPanel_new(int preSelectedSignal) { Panel* this = Panel_new(1, 1, 1, 1, Class(ListItem), true, FunctionBar_newEnterEsc("Send ", "Cancel ")); - const int defaultSignal = SIGTERM; int defaultPosition = 15; unsigned int i; for (i = 0; i < Platform_numberOfSignals; i++) { Panel_set(this, i, (Object*) ListItem_new(Platform_signals[i].name, Platform_signals[i].number)); // signal 15 is not always the 15th signal in the table - if (Platform_signals[i].number == defaultSignal) { + if (Platform_signals[i].number == preSelectedSignal) { defaultPosition = i; } } -- cgit v1.2.3