sytem: fix updater when moonraker doesn't return configured_type
This commit is contained in:
parent
926773f4f3
commit
1753105265
@ -174,8 +174,7 @@ class SystemPanel(ScreenPanel):
|
|||||||
i = 0
|
i = 0
|
||||||
label = Gtk.Label()
|
label = Gtk.Label()
|
||||||
label.set_line_wrap(True)
|
label.set_line_wrap(True)
|
||||||
if "configured_type" in info:
|
if 'configured_type' in info and info['configured_type'] == 'git_repo':
|
||||||
if info['configured_type'] == 'git_repo':
|
|
||||||
if not info['is_valid'] or info['is_dirty']:
|
if not info['is_valid'] or info['is_dirty']:
|
||||||
label.set_markup(_("Do you want to recover %s?") % program)
|
label.set_markup(_("Do you want to recover %s?") % program)
|
||||||
grid.attach(label, 0, i, 1, 1)
|
grid.attach(label, 0, i, 1, 1)
|
||||||
@ -217,11 +216,6 @@ class SystemPanel(ScreenPanel):
|
|||||||
details.set_halign(Gtk.Align.START)
|
details.set_halign(Gtk.Align.START)
|
||||||
grid.attach(details, 0, i, 1, 1)
|
grid.attach(details, 0, i, 1, 1)
|
||||||
i = i + 1
|
i = i + 1
|
||||||
else:
|
|
||||||
label.set_markup("<b>" + _("%s will be updated to version") % program.capitalize() +
|
|
||||||
": %s</b>" % (info['remote_version']))
|
|
||||||
grid.attach(label, 0, i, 1, 1)
|
|
||||||
i = i + 1
|
|
||||||
if "package_count" in info:
|
if "package_count" in info:
|
||||||
label.set_markup("<b>" + _("%d Packages will be updated") % info['package_count'] + ":</b>\n")
|
label.set_markup("<b>" + _("%d Packages will be updated") % info['package_count'] + ":</b>\n")
|
||||||
label.set_halign(Gtk.Align.CENTER)
|
label.set_halign(Gtk.Align.CENTER)
|
||||||
@ -239,6 +233,11 @@ class SystemPanel(ScreenPanel):
|
|||||||
j = j + 1
|
j = j + 1
|
||||||
if (pos == 2):
|
if (pos == 2):
|
||||||
i = i + 1
|
i = i + 1
|
||||||
|
else:
|
||||||
|
label.set_markup("<b>" + _("%s will be updated to version") % program.capitalize() +
|
||||||
|
": %s</b>" % (info['remote_version']))
|
||||||
|
grid.attach(label, 0, i, 1, 1)
|
||||||
|
i = i + 1
|
||||||
|
|
||||||
scroll.add(grid)
|
scroll.add(grid)
|
||||||
|
|
||||||
@ -359,7 +358,7 @@ class SystemPanel(ScreenPanel):
|
|||||||
logging.info("%s: %s" % (p, info))
|
logging.info("%s: %s" % (p, info))
|
||||||
|
|
||||||
if p != "system":
|
if p != "system":
|
||||||
if info['configured_type'] == 'git_repo':
|
if 'configured_type' in info and info['configured_type'] == 'git_repo':
|
||||||
if info['is_valid'] and not info['is_dirty']:
|
if info['is_valid'] and not info['is_dirty']:
|
||||||
if info['version'] == info['remote_version']:
|
if info['version'] == info['remote_version']:
|
||||||
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, info['version']))
|
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, info['version']))
|
||||||
@ -378,7 +377,7 @@ class SystemPanel(ScreenPanel):
|
|||||||
self.labels["%s_status" % p].get_style_context().add_class('invalid')
|
self.labels["%s_status" % p].get_style_context().add_class('invalid')
|
||||||
self.labels["%s_status" % p].set_sensitive(True)
|
self.labels["%s_status" % p].set_sensitive(True)
|
||||||
else:
|
else:
|
||||||
if info['version'] == info['remote_version']:
|
if 'version' in info and info['version'] == info['remote_version']:
|
||||||
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, info['version']))
|
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, info['version']))
|
||||||
self.labels["%s_status" % p].set_label(_("Up To Date"))
|
self.labels["%s_status" % p].set_label(_("Up To Date"))
|
||||||
self.labels["%s_status" % p].get_style_context().remove_class('update')
|
self.labels["%s_status" % p].get_style_context().remove_class('update')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user