Changeset f87ff8e in mainline
- Timestamp:
- 2023-12-19T16:19:24Z (12 months ago)
- Branches:
- master, topic/simplify-dev-export
- Children:
- 550ed86, dc5c303
- Parents:
- 82d3c28
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar-cfg/smeedit.c
r82d3c28 rf87ff8e 116 116 117 117 ui_wnd_params_init(¶ms); 118 params.caption = "Edit Start Menu Entry"; 118 params.caption = smentry != NULL ? "Edit Start Menu Entry" 119 : "Create Start Menu Entry"; 119 120 if (ui_is_textmode(ui)) { 120 121 params.rect.p0.x = 0; … … 354 355 caption = ui_entry_get_text(smee->ecaption); 355 356 356 rc = smenu_entry_set_cmd(smee->smentry->entry, cmd); 357 if (rc != EOK) 358 return; 359 360 smenu_entry_set_caption(smee->smentry->entry, caption); 361 if (rc != EOK) 362 return; 363 364 (void)smenu_entry_save(smee->smentry->entry); 365 startmenu_entry_update(smee->smentry); 357 if (smee->smentry == NULL) { 358 /* Create new entry */ 359 rc = smenu_entry_create(smee->startmenu->tbarcfg->tbarcfg, 360 caption, cmd); 361 if (rc != EOK) 362 return; 363 } else { 364 /* Edit existing entry */ 365 366 367 rc = smenu_entry_set_cmd(smee->smentry->entry, cmd); 368 if (rc != EOK) 369 return; 370 371 smenu_entry_set_caption(smee->smentry->entry, caption); 372 if (rc != EOK) 373 return; 374 375 (void)smenu_entry_save(smee->smentry->entry); 376 startmenu_entry_update(smee->smentry); 377 } 378 366 379 smeedit_destroy(smee); 367 380 } -
uspace/app/taskbar-cfg/startmenu.c
r82d3c28 rf87ff8e 379 379 } 380 380 381 /** Create new menu entry. 382 * 383 * @param smenu Start menu 384 */ 385 void startmenu_new_entry(startmenu_t *smenu) 386 { 387 smeedit_t *smee; 388 errno_t rc; 389 390 rc = smeedit_create(smenu, NULL, &smee); 391 if (rc != EOK) 392 return; 393 394 (void)smee; 395 } 396 381 397 /** Edit selected menu entry. 382 398 * … … 431 447 static void startmenu_new_entry_clicked(ui_pbutton_t *pbutton, void *arg) 432 448 { 449 startmenu_t *smenu = (startmenu_t *)arg; 450 433 451 (void)pbutton; 434 (void)arg;452 startmenu_new_entry(smenu); 435 453 } 436 454 -
uspace/app/taskbar-cfg/startmenu.h
r82d3c28 rf87ff8e 47 47 startmenu_entry_t **); 48 48 extern startmenu_entry_t *startmenu_get_selected(startmenu_t *); 49 extern void startmenu_new_entry(startmenu_t *); 49 50 extern void startmenu_edit(startmenu_t *); 50 51 extern errno_t startmenu_entry_update(startmenu_entry_t *); -
uspace/lib/tbarcfg/src/tbarcfg.c
r82d3c28 rf87ff8e 405 405 goto error; 406 406 407 rc = sif_node_set_attr(trans, nentry, "cmd", cmd); 408 if (rc != EOK) 409 goto error; 410 411 rc = sif_node_set_attr(trans, nentry, "caption", caption); 412 if (rc != EOK) 413 goto error; 414 407 415 rc = smenu_entry_new(smenu, nentry, caption, cmd); 408 416 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.