Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Safiullin committed Apr 14, 2023
1 parent 047c35b commit 96e0ff8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def __init__(self, parent=None):
self.menu = QMenu()

# Add the main entries
self.thermal_entry = self.menu.addMenu(f"Current Thermal Mode:\t\t{self.format(self.thermal_mode)}")
self.battery_entry = self.menu.addMenu(f"Current Battery Mode:\t\t{self.format(self.battery_mode)}")
self.thermal_entry = self.menu.addMenu(f"Current Thermal Mode:\t{self.format(self.thermal_mode)}")
self.battery_entry = self.menu.addMenu(f"Current Battery Mode:\t{self.format(self.battery_mode)}")
if self.kde:
self.thermal_entry.setIcon(QIcon.fromTheme("temperature-normal"))
self.battery_entry.setIcon(QIcon.fromTheme("battery-normal"))
Expand Down Expand Up @@ -164,7 +164,7 @@ def set_thermal(self, mode, write=False):
print(f"Set Thermal {mode}")
self.smbios.set_thermal(mode)
self.thermal_mode = self.smbios.get_thermal()
self.menu.actions()[0].setText(f"Current Thermal Mode:\t\t{self.format(self.thermal_mode)}")
self.menu.actions()[0].setText(f"Current Thermal Mode:\t{self.format(self.thermal_mode)}")
for action in self.thermal_entry.actions(): # Make sure the correct thermal mode is checked
if action.text() == self.format(mode):
action.setChecked(True)
Expand All @@ -179,7 +179,7 @@ def set_battery(self, mode):
print(f"Set Battery {mode}")
self.smbios.set_battery(mode)
self.battery_mode = self.smbios.get_battery()
self.menu.actions()[1].setText(f"Current Battery Mode:\t\t{self.format(self.battery_mode)}")
self.menu.actions()[1].setText(f"Current Battery Mode:\t{self.format(self.battery_mode)}")
for action in self.battery_entry.actions(): # Make sure the correct battery mode is checked
if action.text() == self.format(mode):
action.setChecked(True)
Expand Down

0 comments on commit 96e0ff8

Please sign in to comment.