mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-28 11:41:46 +03:00
Manage disable_quicklook command
This commit is contained in:
parent
a6a8ccbc03
commit
6fae969549
@ -149,6 +149,7 @@ Command-Line Options
|
||||
--disable-log disable log module
|
||||
--enable-process-extended
|
||||
enable extended stats on top process
|
||||
--disable-quicklook disable the Quicklook module
|
||||
--enable-history enable the history mode
|
||||
--path-history PATH_HISTORY
|
||||
Set the export path for graph history
|
||||
@ -263,6 +264,8 @@ The following commands (key pressed) are supported while in Glances:
|
||||
Switch between global CPU and per-CPU stats
|
||||
``2``
|
||||
Enable/disable left sidebar
|
||||
``3``
|
||||
Enable/disable the Quicklook module
|
||||
``/``
|
||||
Switch between short name / command line (processes name)
|
||||
|
||||
|
@ -249,6 +249,9 @@ class _GlancesCurses(object):
|
||||
elif self.pressedkey == ord('2'):
|
||||
# '2' > Enable/disable left sidebar
|
||||
self.args.disable_left_sidebar = not self.args.disable_left_sidebar
|
||||
elif self.pressedkey == ord('3'):
|
||||
# '3' > Enable/disable quicklook
|
||||
self.args.disable_quicklook = not self.args.disable_quicklook
|
||||
elif self.pressedkey == ord('/'):
|
||||
# '/' > Switch between short/long name for processes
|
||||
self.args.process_short_name = not self.args.process_short_name
|
||||
@ -494,7 +497,7 @@ class _GlancesCurses(object):
|
||||
# CPU | PERCPU
|
||||
if self.args.percpu:
|
||||
cpu_width = self.get_stats_display_width(stats_percpu)
|
||||
quicklook_adapt = 116
|
||||
quicklook_adapt = 114
|
||||
else:
|
||||
cpu_width = self.get_stats_display_width(stats_cpu, without_option=(screen_x < 80))
|
||||
quicklook_adapt = 108
|
||||
@ -504,7 +507,7 @@ class _GlancesCurses(object):
|
||||
l += self.get_stats_display_width(stats_memswap)
|
||||
l += self.get_stats_display_width(stats_load)
|
||||
# Quicklook plugin size is dynamic
|
||||
if screen_x > 126:
|
||||
if screen_x > 126 and not self.args.disable_quicklook:
|
||||
# Limit the size to be align with the process
|
||||
quicklook_width = min(screen_x - quicklook_adapt, 87)
|
||||
try:
|
||||
|
@ -141,7 +141,10 @@ class Plugin(GlancesPlugin):
|
||||
ret.append(self.curse_add_line(msg))
|
||||
ret.append(self.curse_new_line())
|
||||
msg = msg_col.format("D", _("Enable/disable Docker stats"))
|
||||
ret.append(self.curse_add_line(msg))
|
||||
ret.append(self.curse_add_line(msg))
|
||||
ret.append(self.curse_new_line())
|
||||
msg = msg_col.format("3", _("Enable/disable Quicklook plugin"))
|
||||
ret.append(self.curse_add_line(msg))
|
||||
|
||||
|
||||
ret.append(self.curse_new_line())
|
||||
|
Loading…
Reference in New Issue
Block a user