|
@@ -271,8 +271,10 @@ class Handler:
|
271
|
271
|
giveback = self.builder.get_object("giveback-toggle")
|
272
|
272
|
pd_frame = self.builder.get_object("power-delivery-frame")
|
273
|
273
|
output = self.builder.get_object("output-switch")
|
|
274
|
+ cap_row = self.builder.get_object("source-cap-row")
|
274
|
275
|
cap_warning = self.builder.get_object("source-cap-warning")
|
275
|
276
|
cap_label = self.builder.get_object("short-source-cap-label")
|
|
277
|
+ cap_arrow = self.builder.get_object("source-cap-arrow")
|
276
|
278
|
|
277
|
279
|
self.serial_port = serport
|
278
|
280
|
|
|
@@ -331,7 +333,14 @@ class Handler:
|
331
|
333
|
cap_warning.set_visible(not pdbuddy.follows_power_rules(caps))
|
332
|
334
|
|
333
|
335
|
# Update the text in the capability label
|
334
|
|
- cap_label.set_text('{:g} W'.format(pdbuddy.calculate_pdp(caps)))
|
|
336
|
+ if caps:
|
|
337
|
+ cap_label.set_text('{:g} W'.format(pdbuddy.calculate_pdp(caps)))
|
|
338
|
+ else:
|
|
339
|
+ cap_label.set_text('None')
|
|
340
|
+
|
|
341
|
+ # Make the row insensitive if there are no capabilities
|
|
342
|
+ cap_row.set_activatable(caps)
|
|
343
|
+ cap_arrow.set_visible(caps)
|
335
|
344
|
|
336
|
345
|
# Show the Sink page
|
337
|
346
|
hst = self.builder.get_object("header-stack")
|