[jira] refactoring

This commit is contained in:
streetturtle 2020-09-03 21:28:01 -04:00
parent 23d1090d02
commit cbe2557273
1 changed files with 9 additions and 10 deletions

View File

@ -65,18 +65,18 @@ local jira_widget = wibox.widget {
self.txt.text = new_value self.txt.text = new_value
end, end,
set_icon = function(self, path) set_icon = function(self, path)
self.a.b.c.image = path self:get_children_by_id('c')[1]:set_image(path)
end, end,
is_everything_ok = function(self, is_ok) is_everything_ok = function(self, is_ok)
if is_ok then if is_ok then
self.a.b.d:set_visible(false) self:get_children_by_id('d')[1]:set_visible(false)
self.a.b.c:set_opacity(1) self:get_children_by_id('c')[1]:set_opacity(1)
self.a.b.c:emit_signal('widget:redraw_needed') self:get_children_by_id('c')[1]:emit_signal('widget:redraw_needed')
else else
self.txt:set_text('') self.txt:set_text('')
self.a.b.d:set_visible(true) self:get_children_by_id('d')[1]:set_visible(true)
self.a.b.c:set_opacity(0.2) self:get_children_by_id('c')[1]:set_opacity(0.2)
self.a.b.c:emit_signal('widget:redraw_needed') self:get_children_by_id('c')[1]:emit_signal('widget:redraw_needed')
end end
end end
} }
@ -92,7 +92,6 @@ local popup = awful.popup{
widget = {} widget = {}
} }
local number_of_issues local number_of_issues
local warning_shown = false local warning_shown = false
@ -117,7 +116,7 @@ local function worker(args)
show_warning(stderr) show_warning(stderr)
warning_shown = true warning_shown = true
widget:is_everything_ok(false) widget:is_everything_ok(false)
tooltip:add_to_object(jira_widget) tooltip:add_to_object(widget)
widget:connect_signal('mouse::enter', function() widget:connect_signal('mouse::enter', function()
tooltip.text = stderr tooltip.text = stderr
@ -127,7 +126,7 @@ local function worker(args)
end end
warning_shown = false warning_shown = false
tooltip:remove_from_object(jira_widget) tooltip:remove_from_object(widget)
widget:is_everything_ok(true) widget:is_everything_ok(true)
local result = json.decode(stdout) local result = json.decode(stdout)