mirror of https://github.com/xzeldon/htop.git
Disable mouse option when support is unavailable
This commit is contained in:
parent
2ab8fb83ba
commit
e8f27ebc26
|
@ -186,7 +186,9 @@ static CommandLineSettings parseArguments(const char* program, int argc, char**
|
||||||
flags.useColors = false;
|
flags.useColors = false;
|
||||||
break;
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
|
#ifdef HAVE_GETMOUSE
|
||||||
flags.enableMouse = false;
|
flags.enableMouse = false;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 'U':
|
case 'U':
|
||||||
flags.allowUnicode = false;
|
flags.allowUnicode = false;
|
||||||
|
@ -304,8 +306,10 @@ int CommandLine_run(const char* name, int argc, char** argv) {
|
||||||
settings->delay = flags.delay;
|
settings->delay = flags.delay;
|
||||||
if (!flags.useColors)
|
if (!flags.useColors)
|
||||||
settings->colorScheme = COLORSCHEME_MONOCHROME;
|
settings->colorScheme = COLORSCHEME_MONOCHROME;
|
||||||
|
#ifdef HAVE_GETMOUSE
|
||||||
if (!flags.enableMouse)
|
if (!flags.enableMouse)
|
||||||
settings->enableMouse = false;
|
settings->enableMouse = false;
|
||||||
|
#endif
|
||||||
if (flags.treeView)
|
if (flags.treeView)
|
||||||
settings->treeView = true;
|
settings->treeView = true;
|
||||||
if (flags.highlightChanges)
|
if (flags.highlightChanges)
|
||||||
|
|
|
@ -131,7 +131,9 @@ DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager*
|
||||||
&(settings->showCPUTemperature)));
|
&(settings->showCPUTemperature)));
|
||||||
Panel_add(super, (Object*) CheckItem_newByRef("- Show temperature in degree Fahrenheit instead of Celsius", &(settings->degreeFahrenheit)));
|
Panel_add(super, (Object*) CheckItem_newByRef("- Show temperature in degree Fahrenheit instead of Celsius", &(settings->degreeFahrenheit)));
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_GETMOUSE
|
||||||
Panel_add(super, (Object*) CheckItem_newByRef("Enable the mouse", &(settings->enableMouse)));
|
Panel_add(super, (Object*) CheckItem_newByRef("Enable the mouse", &(settings->enableMouse)));
|
||||||
|
#endif
|
||||||
Panel_add(super, (Object*) NumberItem_newByRef("Update interval (in seconds)", &(settings->delay), -1, 1, 255));
|
Panel_add(super, (Object*) NumberItem_newByRef("Update interval (in seconds)", &(settings->delay), -1, 1, 255));
|
||||||
Panel_add(super, (Object*) CheckItem_newByRef("Highlight new and old processes", &(settings->highlightChanges)));
|
Panel_add(super, (Object*) CheckItem_newByRef("Highlight new and old processes", &(settings->highlightChanges)));
|
||||||
Panel_add(super, (Object*) NumberItem_newByRef("- Highlight time (in seconds)", &(settings->highlightDelaySecs), 0, 1, 24 * 60 * 60));
|
Panel_add(super, (Object*) NumberItem_newByRef("- Highlight time (in seconds)", &(settings->highlightDelaySecs), 0, 1, 24 * 60 * 60));
|
||||||
|
|
|
@ -224,8 +224,10 @@ static bool Settings_read(Settings* this, const char* fileName, unsigned int ini
|
||||||
if (this->colorScheme < 0 || this->colorScheme >= LAST_COLORSCHEME) {
|
if (this->colorScheme < 0 || this->colorScheme >= LAST_COLORSCHEME) {
|
||||||
this->colorScheme = 0;
|
this->colorScheme = 0;
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_GETMOUSE
|
||||||
} else if (String_eq(option[0], "enable_mouse")) {
|
} else if (String_eq(option[0], "enable_mouse")) {
|
||||||
this->enableMouse = atoi(option[1]);
|
this->enableMouse = atoi(option[1]);
|
||||||
|
#endif
|
||||||
} else if (String_eq(option[0], "left_meters")) {
|
} else if (String_eq(option[0], "left_meters")) {
|
||||||
Settings_readMeters(this, option[1], 0);
|
Settings_readMeters(this, option[1], 0);
|
||||||
didReadMeters = true;
|
didReadMeters = true;
|
||||||
|
@ -332,7 +334,9 @@ int Settings_write(const Settings* this, bool onCrash) {
|
||||||
fprintf(fd, "update_process_names=%d\n", (int) this->updateProcessNames);
|
fprintf(fd, "update_process_names=%d\n", (int) this->updateProcessNames);
|
||||||
fprintf(fd, "account_guest_in_cpu_meter=%d\n", (int) this->accountGuestInCPUMeter);
|
fprintf(fd, "account_guest_in_cpu_meter=%d\n", (int) this->accountGuestInCPUMeter);
|
||||||
fprintf(fd, "color_scheme=%d\n", (int) this->colorScheme);
|
fprintf(fd, "color_scheme=%d\n", (int) this->colorScheme);
|
||||||
|
#ifdef HAVE_GETMOUSE
|
||||||
fprintf(fd, "enable_mouse=%d\n", (int) this->enableMouse);
|
fprintf(fd, "enable_mouse=%d\n", (int) this->enableMouse);
|
||||||
|
#endif
|
||||||
fprintf(fd, "delay=%d\n", (int) this->delay);
|
fprintf(fd, "delay=%d\n", (int) this->delay);
|
||||||
fprintf(fd, "left_meters="); writeMeters(this, fd, 0);
|
fprintf(fd, "left_meters="); writeMeters(this, fd, 0);
|
||||||
fprintf(fd, "left_meter_modes="); writeMeterModes(this, fd, 0);
|
fprintf(fd, "left_meter_modes="); writeMeterModes(this, fd, 0);
|
||||||
|
@ -437,7 +441,9 @@ Settings* Settings_new(unsigned int initialCpuCount) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->colorScheme = 0;
|
this->colorScheme = 0;
|
||||||
|
#ifdef HAVE_GETMOUSE
|
||||||
this->enableMouse = true;
|
this->enableMouse = true;
|
||||||
|
#endif
|
||||||
this->changed = false;
|
this->changed = false;
|
||||||
this->delay = DEFAULT_DELAY;
|
this->delay = DEFAULT_DELAY;
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
|
|
@ -65,7 +65,9 @@ typedef struct Settings_ {
|
||||||
bool updateProcessNames;
|
bool updateProcessNames;
|
||||||
bool accountGuestInCPUMeter;
|
bool accountGuestInCPUMeter;
|
||||||
bool headerMargin;
|
bool headerMargin;
|
||||||
|
#ifdef HAVE_GETMOUSE
|
||||||
bool enableMouse;
|
bool enableMouse;
|
||||||
|
#endif
|
||||||
int hideFunctionBar; // 0 - off, 1 - on ESC until next input, 2 - permanently
|
int hideFunctionBar; // 0 - off, 1 - on ESC until next input, 2 - permanently
|
||||||
#ifdef HAVE_LIBHWLOC
|
#ifdef HAVE_LIBHWLOC
|
||||||
bool topologyAffinity;
|
bool topologyAffinity;
|
||||||
|
|
Loading…
Reference in New Issue