Changeset dcd8214 in mainline
- Timestamp:
- 2023-11-02T08:58:21Z (13 months ago)
- Branches:
- master, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 40eab9f
- Parents:
- 3e05a69
- git-author:
- Jiri Svoboda <jiri@…> (2023-11-01 18:58:03)
- git-committer:
- Jiri Svoboda <jiri@…> (2023-11-02 08:58:21)
- Location:
- uspace/app/taskbar-cfg
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar-cfg/meson.build
r3e05a69 rdcd8214 31 31 'taskbar-cfg.c', 32 32 'main.c', 33 'smeedit.c', 33 34 'startmenu.c' 34 35 ) -
uspace/app/taskbar-cfg/startmenu.c
r3e05a69 rdcd8214 46 46 #include <ui/tab.h> 47 47 #include <ui/window.h> 48 #include "smeedit.h" 48 49 #include "startmenu.h" 49 50 #include "taskbar-cfg.h" … … 52 53 static void startmenu_new_entry_clicked(ui_pbutton_t *, void *); 53 54 static void startmenu_delete_entry_clicked(ui_pbutton_t *, void *); 55 static void startmenu_edit_entry_clicked(ui_pbutton_t *, void *); 54 56 55 57 /** Entry list callbacks */ … … 63 65 }; 64 66 65 /** Remove seatbutton callbacks */67 /** Delete entry button callbacks */ 66 68 ui_pbutton_cb_t startmenu_delete_entry_button_cb = { 67 69 .clicked = startmenu_delete_entry_clicked 70 }; 71 72 /** Edit entry button callbacks */ 73 ui_pbutton_cb_t startmenu_edit_entry_button_cb = { 74 .clicked = startmenu_edit_entry_clicked 68 75 }; 69 76 … … 163 170 (void *)smenu); 164 171 165 /* 'New Entry'button */172 /* New entry button */ 166 173 167 174 rc = ui_pbutton_create(ui_res, "New...", &smenu->new_entry); … … 194 201 (void *)smenu); 195 202 196 /* 'Delete Entry'button */203 /* Delete entry button */ 197 204 198 205 rc = ui_pbutton_create(ui_res, "Delete", &smenu->delete_entry); … … 224 231 ui_pbutton_set_cb(smenu->delete_entry, 225 232 &startmenu_delete_entry_button_cb, (void *)smenu); 233 234 /* Edit entry button */ 235 236 rc = ui_pbutton_create(ui_res, "Edit...", &smenu->edit_entry); 237 if (rc != EOK) { 238 printf("Error creating button.\n"); 239 goto error; 240 } 241 242 if (ui_resource_is_textmode(ui_res)) { 243 rect.p0.x = 58; 244 rect.p0.y = 9; 245 rect.p1.x = 68; 246 rect.p1.y = 10; 247 } else { 248 rect.p0.x = 370; 249 rect.p0.y = 140; 250 rect.p1.x = 450; 251 rect.p1.y = 165; 252 } 253 254 ui_pbutton_set_rect(smenu->edit_entry, &rect); 255 256 rc = ui_fixed_add(smenu->fixed, ui_pbutton_ctl(smenu->edit_entry)); 257 if (rc != EOK) { 258 printf("Error adding control to layout.\n"); 259 goto error; 260 } 261 262 ui_pbutton_set_cb(smenu->edit_entry, 263 &startmenu_edit_entry_button_cb, (void *)smenu); 226 264 227 265 ui_tab_add(smenu->tab, ui_fixed_ctl(smenu->fixed)); … … 346 384 } 347 385 386 /** Edit selected menu entry. 387 * 388 * @param smenu Start menu 389 */ 390 void startmenu_edit(startmenu_t *smenu) 391 { 392 smeedit_t *smee; 393 errno_t rc; 394 395 rc = smeedit_create(smenu, &smee); 396 if (rc != EOK) 397 return; 398 399 (void)smee; 400 } 401 348 402 /** Entry in entry list is selected. 349 403 * … … 357 411 } 358 412 359 /** New Entry'button clicked.413 /** New entry button clicked. 360 414 * 361 415 * @param pbutton Push button 362 * @param arg Argument ( dcfg_seats_entry_t *)416 * @param arg Argument (startmenu_t *) 363 417 */ 364 418 static void startmenu_new_entry_clicked(ui_pbutton_t *pbutton, void *arg) … … 368 422 } 369 423 370 /** "Delete Entry'button clicked.424 /** Delete entry button clicked. 371 425 * 372 426 * @param pbutton Push button 373 * @param arg Argument ( dcfg_seats_entry_t *)427 * @param arg Argument (startmenu_t *) 374 428 */ 375 429 static void startmenu_delete_entry_clicked(ui_pbutton_t *pbutton, void *arg) … … 379 433 } 380 434 435 /** Edit entry button clicked. 436 * 437 * @param pbutton Push button 438 * @param arg Argument (startmenu_t *) 439 */ 440 static void startmenu_edit_entry_clicked(ui_pbutton_t *pbutton, void *arg) 441 { 442 startmenu_t *smenu = (startmenu_t *)arg; 443 444 (void)pbutton; 445 startmenu_edit(smenu); 446 } 447 381 448 /** @} 382 449 */ -
uspace/app/taskbar-cfg/startmenu.h
r3e05a69 rdcd8214 46 46 extern errno_t startmenu_insert(startmenu_t *, const char *, const char *, 47 47 startmenu_entry_t **); 48 extern void startmenu_edit(startmenu_t *); 48 49 49 50 #endif
Note:
See TracChangeset
for help on using the changeset viewer.