Skip to content

Commit 20c5439

Browse files
committed
rm theme
1 parent aad91c7 commit 20c5439

File tree

7 files changed

+3
-42
lines changed

7 files changed

+3
-42
lines changed

conf/glances.conf

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ history_size=1200
2323
##############################################################################
2424

2525
[outputs]
26-
# Theme name (for the moment only for the Curses interface: black or white)
27-
curse_theme=black
2826
# Separator in the Curses and WebUI interface (between top and others plugins)
2927
separator=True
3028
# Set the the Curses and WebUI interface left menu plugin list (comma-separated)

docker-compose/glances.conf

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ history_size=1200
2323
##############################################################################
2424

2525
[outputs]
26-
# Theme name (for the moment only for the Curses interface: black or white)
27-
curse_theme=black
2826
# Separator in the Curses and WebUI interface (between top and others plugins)
2927
separator=True
3028
# Set the the Curses and WebUI interface left menu plugin list (comma-separated)

docs/config.rst

-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ than a second one concerning the user interface:
5959
.. code-block:: ini
6060
6161
[outputs]
62-
# Theme name (for the moment only for the Curses interface: black or white)
63-
curse_theme=black
6462
# Separator in the Curses and WebUI interface (between top and others plugins)
6563
separator=True
6664
# Set the the Curses and WebUI interface left menu plugin list (comma-separated)

docs/man/glances.1

-10
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,6 @@ display FS free space instead of used
313313
.UNINDENT
314314
.INDENT 0.0
315315
.TP
316-
.B \-\-theme\-white
317-
optimize display colors for a white background
318-
.UNINDENT
319-
.INDENT 0.0
320-
.TP
321316
.B \-\-disable\-check\-update
322317
disable online Glances version check
323318
.UNINDENT
@@ -503,9 +498,6 @@ Enable/disable the top menu (QuickLook, CPU, MEM, SWAP, and LOAD)
503498
.B \fB6\fP
504499
Enable/disable mean GPU mode
505500
.TP
506-
.B \fB9\fP
507-
Switch UI theme between black and white
508-
.TP
509501
.B \fB/\fP
510502
Switch between process command line or command name
511503
.TP
@@ -632,8 +624,6 @@ than a second one concerning the user interface:
632624
.nf
633625
.ft C
634626
[outputs]
635-
# Theme name (for the moment only for the Curses interface: black or white)
636-
curse_theme=black
637627
# Separator in the Curses and WebUI interface (between top and others plugins)
638628
separator=True
639629
# Set the the Curses and WebUI interface left menu plugin list (comma\-separated)

glances/main.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,8 @@ def init_args(self):
525525
)
526526
parser.add_argument(
527527
'--theme-white',
528-
action='store_true',
529528
default=False,
530-
dest='theme_white',
531-
help='optimize display colors for a white background',
529+
help='(deprecated, no effect)',
532530
)
533531
# Globals options
534532
parser.add_argument(

glances/outputs/glances_curses.py

+2-21
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ class _GlancesCurses(object):
4747
'4': {'handler': '_handle_quicklook'},
4848
'5': {'handler': '_handle_top_menu'},
4949
'6': {'switch': 'meangpu'},
50-
'9': {'switch': 'theme_white',
51-
'handler': '_handle_theme'},
5250
'/': {'switch': 'process_short_name'},
5351
'a': {'sort_key': 'auto'},
5452
'A': {'switch': 'disable_amps'},
@@ -158,9 +156,6 @@ def __init__(self, config=None, args=None):
158156
logger.critical("Cannot init the curses library ({})".format(e))
159157
sys.exit(1)
160158

161-
# Load the 'outputs' section of the configuration file
162-
# - Init the theme (default is black)
163-
self.theme = {'name': 'black'}
164159

165160
# Load configuration file
166161
self.load_config(config)
@@ -202,18 +197,13 @@ def load_config(self, config):
202197
"""Load the outputs section of the configuration file."""
203198
if config is not None and config.has_section('outputs'):
204199
logger.debug('Read the outputs section in the configuration file')
205-
# Load the theme
206-
self.theme['name'] = config.get_value('outputs', 'curse_theme', default='black')
207200
# Separator ?
208201
self.args.enable_separator = config.get_bool_value('outputs', 'separator', default=True)
209202
# Set the left sidebar list
210203
self._left_sidebar = config.get_list_value('outputs',
211204
'left_menu',
212205
default=self._left_sidebar)
213206

214-
def is_theme(self, name):
215-
"""Return True if the theme *name* should be used."""
216-
return getattr(self.args, 'theme_' + name) or self.theme['name'] == name
217207

218208
def _init_history(self):
219209
"""Init the history option."""
@@ -258,11 +248,7 @@ def _init_colors(self):
258248
# ex: export TERM=xterm-256color
259249
# export TERM=xterm-color
260250

261-
if self.is_theme('white'):
262-
# White theme: black ==> white
263-
curses.init_pair(1, -1, -1)
264-
else:
265-
curses.init_pair(1, -1, -1)
251+
curses.init_pair(1, -1, -1)
266252
if self.args.disable_bg:
267253
curses.init_pair(2, curses.COLOR_RED, -1)
268254
curses.init_pair(3, curses.COLOR_GREEN, -1)
@@ -300,10 +286,7 @@ def _init_colors(self):
300286
try:
301287
curses.init_pair(i + 9, colors_list[i], -1)
302288
except Exception:
303-
if self.is_theme('white'):
304-
curses.init_pair(i + 9, -1, -1)
305-
else:
306-
curses.init_pair(i + 9, -1, -1)
289+
curses.init_pair(i + 9, -1, -1)
307290
self.filter_color = curses.color_pair(9) | A_BOLD
308291
self.selected_color = curses.color_pair(10) | A_BOLD
309292
# Define separator line style
@@ -455,8 +438,6 @@ def _handle_top_menu(self):
455438
else:
456439
self.enable_top()
457440

458-
def _handle_theme(self):
459-
self._init_colors()
460441

461442
def _handle_process_extended(self):
462443
self.args.enable_process_extended = not self.args.enable_process_extended

glances/plugins/help/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ def generate_view_data(self):
128128
('misc_reset_history', msg_col.format('r', 'Reset history')),
129129
('misc_delete_warning_alerts', msg_col.format('w', 'Delete warning alerts')),
130130
('misc_delete_warning_and_critical_alerts', msg_col.format('x', 'Delete warning & critical alerts')),
131-
('misc_theme_white',
132-
'' if self.args.webserver else msg_col.format('9', 'Optimize colors for white background')),
133131
('misc_edit_process_filter_pattern',
134132
'' if self.args.webserver else ' ENTER: Edit process filter pattern'),
135133
]

0 commit comments

Comments
 (0)