Skip to content

Commit

Permalink
Make consistent use of MiB & GiB in GUI/CLI tools
Browse files Browse the repository at this point in the history
supplementary to QubesOS/qubes-issues#7889
  • Loading branch information
alimirjamali committed Aug 9, 2024
1 parent 5902fa1 commit 7fe7a73
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions qubes_config/global_config/basics_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def __init__(self):
self.qmemman_config = None

def get_values(self) -> Dict[str, int]:
"""Returns a dict of 'vm-min-mem': value in MB and
'dom0-mem-boost': value in MB """
"""Returns a dict of 'vm-min-mem': value in MiB and
'dom0-mem-boost': value in MiB """
self.qmemman_config = ConfigParser()
self.qmemman_config.read(self.QMEMMAN_CONFIG_PATH)

Expand All @@ -209,8 +209,8 @@ def get_values(self) -> Dict[str, int]:
return result

def save_values(self, values_dict: Dict[str, int]):
"""Wants a dict of 'vm-min-mem': value in MB and
'dom0-mem-boost': value in MB"""
"""Wants a dict of 'vm-min-mem': value in MiB and
'dom0-mem-boost': value in MiB"""
# qmemman settings
text_dict = {key: str(int(value)) + 'MiB'
for key, value in values_dict.items()}
Expand Down
2 changes: 1 addition & 1 deletion qubes_config/new_qube.glade
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">MB</property>
<property name="label" translatable="yes">MiB</property>
</object>
<packing>
<property name="expand">False</property>
Expand Down
2 changes: 1 addition & 1 deletion qui/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def update_state(self, memory=0, header=False):
if header:
markup = _('<b>RAM</b>')
else:
markup = f'{str(int(memory/1024))} MB'
markup = f'{str(int(memory/1024))} MiB'

self.mem_label.set_markup(markup)

Expand Down

0 comments on commit 7fe7a73

Please sign in to comment.