From 36880cd61c52f13c6fd284aa23d42d9493d3ab2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 21 Jan 2021 20:27:37 +0100 Subject: Add read-only option Add command line option to disable all system and process changing features. --- MainPanel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'MainPanel.c') diff --git a/MainPanel.c b/MainPanel.c index 842e8e15..cf7392e4 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -21,7 +21,8 @@ in the source distribution for its full text. #include "XUtils.h" -static const char* const MainFunctions[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", "Nice -", "Nice +", "Kill ", "Quit ", NULL}; +static const char* const MainFunctions[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", "Nice -", "Nice +", "Kill ", "Quit ", NULL}; +static const char* const MainFunctions_ro[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", " ", " ", " ", "Quit ", NULL}; void MainPanel_updateTreeFunctions(MainPanel* this, bool mode) { FunctionBar* bar = MainPanel_getFunctionBar(this); @@ -195,7 +196,7 @@ const PanelClass MainPanel_class = { MainPanel* MainPanel_new() { MainPanel* this = AllocThis(MainPanel); - Panel_init((Panel*) this, 1, 1, 1, 1, Class(Process), false, FunctionBar_new(MainFunctions, NULL, NULL)); + Panel_init((Panel*) this, 1, 1, 1, 1, Class(Process), false, FunctionBar_new(Settings_isReadonly() ? MainFunctions_ro : MainFunctions, NULL, NULL)); this->keys = xCalloc(KEY_MAX, sizeof(Htop_Action)); this->inc = IncSet_new(MainPanel_getFunctionBar(this)); -- cgit v1.2.3