summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b68d63)
raw | patch | inline | side by side (parent: 3b68d63)
author | Max Kellermann <max@duempel.org> | |
Wed, 30 Sep 2009 19:13:21 +0000 (21:13 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 30 Sep 2009 19:13:21 +0000 (21:13 +0200) |
Automatically queue the "output" idle event when the user
enables/disables an output.
enables/disables an output.
src/screen_outputs.c | patch | blob | history |
diff --git a/src/screen_outputs.c b/src/screen_outputs.c
index 7ecc353cb88476a0331b5966ee58ca81d382caff..7f19ce283fe3c876a971cccb051417d91c7f1f03 100644 (file)
--- a/src/screen_outputs.c
+++ b/src/screen_outputs.c
return -1;
}
- /* XXX reload */
+ c->events |= MPD_IDLE_OUTPUT;
screen_status_printf(_("Output '%s' enabled"),
mpd_output_get_name(output));
return -1;
}
- /* XXX reload */
+ c->events |= MPD_IDLE_OUTPUT;
screen_status_printf(_("Output '%s' disabled"),
mpd_output_get_name(output));
}
- outputs_repaint();
-
return 0;
}
list_window_paint(lw, outputs_list_callback, NULL);
}
+static void
+screen_outputs_update(struct mpdclient *c)
+{
+ if (c->events & MPD_IDLE_OUTPUT) {
+ clear_outputs_list();
+ fill_outputs_list(c);
+ outputs_repaint();
+ }
+}
+
static bool
outputs_cmd(struct mpdclient *c, command_t cmd)
{
.close = outputs_close,
.resize = outputs_resize,
.paint = outputs_paint,
+ .update = screen_outputs_update,
.cmd = outputs_cmd,
.get_title = outputs_title,
};