summaryrefslogtreecommitdiffstats
path: root/MainPanel.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-01-21 20:27:37 +0100
committercgzones <cgzones@googlemail.com>2021-04-14 17:21:43 +0200
commit36880cd61c52f13c6fd284aa23d42d9493d3ab2e (patch)
tree54df8a9e8ef536db034af9a3f1d6496626ad802b /MainPanel.c
parent812cfcb94df0fc0e6f9d33e39078454842d61609 (diff)
Add read-only option
Add command line option to disable all system and process changing features.
Diffstat (limited to 'MainPanel.c')
-rw-r--r--MainPanel.c5
1 files changed, 3 insertions, 2 deletions
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));

© 2014-2024 Faster IT GmbH | imprint | privacy policy