mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
st/gui: Make it possible to pass in remote address from the command line
This commit is contained in:
parent
b782478571
commit
3c1576fc44
|
@ -224,10 +224,11 @@ gui_scene_record(struct gui_program *p, const char *camera);
|
|||
/*!
|
||||
* Remote control debugging UI.
|
||||
*
|
||||
* @param Optional address.
|
||||
* @ingroup gui
|
||||
*/
|
||||
void
|
||||
gui_scene_remote(struct gui_program *p);
|
||||
gui_scene_remote(struct gui_program *p, const char *address);
|
||||
|
||||
/*!
|
||||
* Given the frameserver runs the calibration code on it.
|
||||
|
|
|
@ -74,7 +74,7 @@ scene_render(struct gui_scene *scene, struct gui_program *p)
|
|||
if (igButton("Remote", button_dims)) {
|
||||
gui_scene_delete_me(p, scene);
|
||||
|
||||
gui_scene_remote(p);
|
||||
gui_scene_remote(p, NULL);
|
||||
}
|
||||
|
||||
igSeparator();
|
||||
|
|
|
@ -387,7 +387,7 @@ scene_destroy(struct gui_scene *scene, struct gui_program *p)
|
|||
*/
|
||||
|
||||
void
|
||||
gui_scene_remote(struct gui_program *p)
|
||||
gui_scene_remote(struct gui_program *p, const char *address)
|
||||
{
|
||||
struct gui_remote *gr = U_TYPED_CALLOC(struct gui_remote);
|
||||
|
||||
|
@ -396,7 +396,11 @@ gui_scene_remote(struct gui_program *p)
|
|||
gr->rc.fd = -1;
|
||||
|
||||
// GUI input defaults.
|
||||
snprintf(gr->address, sizeof(gr->address), "localhost");
|
||||
if (address != NULL) {
|
||||
snprintf(gr->address, sizeof(gr->address), "%s", address);
|
||||
} else {
|
||||
snprintf(gr->address, sizeof(gr->address), "localhost");
|
||||
}
|
||||
gr->port = 4242;
|
||||
|
||||
gui_scene_push_front(p, &gr->base);
|
||||
|
|
|
@ -47,7 +47,7 @@ main(int argc, char **argv)
|
|||
} else if (argc >= 2 && strcmp("record", argv[1]) == 0) {
|
||||
gui_scene_record(&p.base, argc >= 3 ? argv[2] : NULL);
|
||||
} else if (argc >= 2 && strcmp("remote", argv[1]) == 0) {
|
||||
gui_scene_remote(&p.base);
|
||||
gui_scene_remote(&p.base, argc >= 3 ? argv[2] : NULL);
|
||||
} else {
|
||||
gui_scene_main_menu(&p.base);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue