mirror of
https://github.com/Steve-Tech/YAFI.git
synced 2026-04-20 01:00:37 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fcb2098cb | ||
|
|
3c55f8fdd6 | ||
|
|
b5dfa93dcf | ||
|
|
154be557ed | ||
|
|
624fed2c71 | ||
|
|
f50a11deaa |
Binary file not shown.
@@ -2,7 +2,7 @@ import os
|
||||
if os.name == 'nt' and os.environ.get('GDK_SCALE') is None:
|
||||
import ctypes
|
||||
scale_factor = ctypes.windll.shcore.GetScaleFactorForDevice(0)
|
||||
os.environ["GDK_SCALE"] = f"{scale_factor//100}"
|
||||
os.environ["GDK_SCALE"] = f"{round(scale_factor, -2)//100}"
|
||||
|
||||
from yafi import main
|
||||
main()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "yafi"
|
||||
version = "0.4"
|
||||
version = "0.5"
|
||||
authors = [
|
||||
{ name="Steve-Tech" }
|
||||
]
|
||||
|
||||
20
yafi/leds.py
20
yafi/leds.py
@@ -104,9 +104,12 @@ class LedsPage(Gtk.Box):
|
||||
if supported_colours[i]:
|
||||
strings.append(colour)
|
||||
|
||||
add_colours(
|
||||
led_pwr_colour_strings, ec_commands.leds.EcLedId.EC_LED_ID_POWER_LED
|
||||
)
|
||||
try:
|
||||
add_colours(
|
||||
led_pwr_colour_strings, ec_commands.leds.EcLedId.EC_LED_ID_POWER_LED
|
||||
)
|
||||
except ec_exceptions.ECError as e:
|
||||
self.led_pwr_colour.set_sensitive(False)
|
||||
|
||||
def handle_led_colour(combobox, led_id):
|
||||
colour = combobox.get_selected() - 2
|
||||
@@ -141,10 +144,13 @@ class LedsPage(Gtk.Box):
|
||||
# Advanced: Charging LED
|
||||
led_chg_colour_strings = self.led_chg_colour.get_model()
|
||||
|
||||
add_colours(
|
||||
led_chg_colour_strings,
|
||||
ec_commands.leds.EcLedId.EC_LED_ID_BATTERY_LED,
|
||||
)
|
||||
try:
|
||||
add_colours(
|
||||
led_chg_colour_strings,
|
||||
ec_commands.leds.EcLedId.EC_LED_ID_BATTERY_LED,
|
||||
)
|
||||
except ec_exceptions.ECError as e:
|
||||
self.led_chg_colour.set_sensitive(False)
|
||||
|
||||
self.led_chg_colour.connect(
|
||||
"notify::selected",
|
||||
|
||||
@@ -126,7 +126,7 @@ class YafiApplication(Adw.Application):
|
||||
developers=["Stephen Horvath"],
|
||||
issue_url="https://github.com/Steve-Tech/YAFI/issues",
|
||||
license_type=Gtk.License.GPL_2_0,
|
||||
version="0.4",
|
||||
version="0.5",
|
||||
website="https://github.com/Steve-Tech/YAFI",
|
||||
)
|
||||
about.add_acknowledgement_section(None, ["Framework Computer Inc. https://frame.work/"])
|
||||
@@ -149,6 +149,8 @@ class YafiApplication(Adw.Application):
|
||||
if hasattr(self, 'error'):
|
||||
if isinstance(self.error, Exception):
|
||||
info += f"{type(self.error).__name__}: {self.error}\n\n"
|
||||
info += ''.join(traceback.format_exception(type(self.error), self.error, self.error.__traceback__))
|
||||
info += "\n\n"
|
||||
else:
|
||||
info += f"Error: {self.error}\n\n"
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
<property name="sensitive">False</property>
|
||||
<property name="subtitle">Limit the minimum charge</property>
|
||||
<property name="title">Discharge Limit</property>
|
||||
<property name="visible">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<ui template-class="YafiWindow" filename="yafi.ui" sha256="9d1b2f030e4a816eb0b1aa53ae1d80c5b50a2f4646e32c7a64803eb6f6ed3947"/>
|
||||
<ui template-class="ThermalsPage" filename="thermals.ui" sha256="e301e65649005315ff60d250b60a47f6250ad6feb27db104051fcf0143cde173"/>
|
||||
<ui template-class="LedsPage" filename="leds.ui" sha256="0350d22d570de039d63602ba40925f17fff6680fd5909d2ebf19600f351eb0f2"/>
|
||||
<ui template-class="BatteryLimiterPage" filename="battery-limiter.ui" sha256="656384cbc7dbfc0f2fd85b3f8c2d5e35066ec3368c5f464c31c8b82c5da334de"/>
|
||||
<ui template-class="BatteryLimiterPage" filename="battery-limiter.ui" sha256="b5d41b19cb1fb7ca5b4bcfae43244e54111f5e8d8c51d95448d6a92b5185d2c4"/>
|
||||
<ui template-class="HardwarePage" filename="hardware.ui" sha256="f4deec4e38e683fde97656802dbfb2a638ab46a0e36af5c9a37f277f49e2aabb"/>
|
||||
<ui template-class="BatteryPage" filename="battery.ui" sha256="d495280cb543a26cdee1c2939e5af980d8d3878c326e360eeab4f05195cdbdc9"/>
|
||||
</cambalache-project>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user