Changeset 14cbf07 in mainline for uspace/app/display-cfg/seats.c
- Timestamp:
- 2023-05-15T16:19:52Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2b5628c, 8a4ceaa
- Parents:
- aace43d8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/display-cfg/seats.c
raace43d8 r14cbf07 50 50 #include "seats.h" 51 51 52 static errno_t dcfg_seats_list_populate(dcfg_seats_t *);53 52 static errno_t dcfg_seats_asgn_dev_list_populate(dcfg_seats_t *); 54 53 static errno_t dcfg_seats_avail_dev_list_populate(dcfg_seats_t *, … … 118 117 ui_resource_t *ui_res; 119 118 dcfg_seats_t *seats; 120 dcfg_seats_entry_t *entry;121 119 gfx_rect_t rect; 122 char *caption = NULL; 123 errno_t rc; 124 int rv; 120 errno_t rc; 125 121 126 122 ui_res = ui_window_get_res(dcfg->window); … … 204 200 ui_list_set_cb(seats->seat_list, &dcfg_seats_list_cb, (void *)seats); 205 201 206 rc = dcfg_seats_list_populate(seats);207 if (rc != EOK)208 goto error;209 210 202 /* 'Add...' seat button */ 211 203 … … 272 264 /* 'Devices assigned to seat 'xxx':' label */ 273 265 274 entry = dcfg_seats_get_selected(seats); 275 rv = asprintf(&caption, "Devices assigned to seat '%s':", entry->name); 276 if (rv < 0) { 277 rc = ENOMEM; 278 goto error; 279 } 280 281 rc = ui_label_create(ui_res, caption, &seats->devices_label); 266 rc = ui_label_create(ui_res, "Devices assigned to seat 'xxx':", 267 &seats->devices_label); 282 268 if (rc != EOK) { 283 269 printf("Error creating label.\n"); 284 270 goto error; 285 271 } 286 287 free(caption);288 caption = NULL;289 272 290 273 if (ui_resource_is_textmode(ui_res)) { … … 400 383 ui_tab_add(seats->tab, ui_fixed_ctl(seats->fixed)); 401 384 402 rc = dcfg_seats_asgn_dev_list_populate(seats);403 if (rc != EOK)404 goto error;405 406 385 *rseats = seats; 407 386 return EOK; … … 411 390 if (seats->add_device != NULL) 412 391 ui_pbutton_destroy(seats->add_device); 413 if (caption != NULL)414 free(caption);415 392 if (seats->devices_label != NULL) 416 393 ui_label_destroy(seats->devices_label); … … 431 408 } 432 409 410 /** Populate seats tab with display configuration service data 411 * 412 * @param dcfg Display configuration dialog 413 * @param rseats Place to store pointer to new seat configuration tab 414 * @return EOK on success or an error code 415 */ 416 errno_t dcfg_seats_populate(dcfg_seats_t *seats) 417 { 418 dcfg_seats_entry_t *entry; 419 errno_t rc; 420 421 printf("seats list populate\n"); 422 rc = dcfg_seats_list_populate(seats); 423 if (rc != EOK) 424 return rc; 425 426 /* 427 * Update "Devices assigned to seat 'xxx'" label and populate 428 * assigned devices list. 429 */ 430 entry = dcfg_seats_get_selected(seats); 431 dcfg_seats_list_selected(entry->lentry, (void *)entry); 432 return EOK; 433 } 434 433 435 /** Destroy display configuration dialog. 434 436 * … … 511 513 * @return EOK on success or an error code 512 514 */ 513 staticerrno_t dcfg_seats_list_populate(dcfg_seats_t *seats)515 errno_t dcfg_seats_list_populate(dcfg_seats_t *seats) 514 516 { 515 517 size_t i; … … 594 596 * @return EOK on success or an error code 595 597 */ 596 staticerrno_t dcfg_avail_devices_insert(dcfg_seats_t *seats,598 errno_t dcfg_avail_devices_insert(dcfg_seats_t *seats, 597 599 ui_select_dialog_t *dialog, const char *name, service_id_t svc_id) 598 600 {
Note:
See TracChangeset
for help on using the changeset viewer.