| 35 | } |
| 36 | |
| 37 | void EditBookmarkDialog::show() { |
| 38 | Pane::show(); |
| 39 | |
| 40 | if (m_isNew) { |
| 41 | fetchChild<LabelWidget>("lblTitle")->setText("NEW BOOKMARK"); |
| 42 | fetchChild<ButtonWidget>("remove")->hide(); |
| 43 | } else { |
| 44 | fetchChild<LabelWidget>("lblTitle")->setText("EDIT BOOKMARK"); |
| 45 | fetchChild<ButtonWidget>("remove")->show(); |
| 46 | } |
| 47 | |
| 48 | auto assets = Root::singleton().assets(); |
| 49 | fetchChild<ImageWidget>("imgIcon")->setImage(strf("/interface/bookmarks/icons/{}.png", m_bookmark.icon)); |
| 50 | |
| 51 | fetchChild<LabelWidget>("lblPlanetName")->setText(m_bookmark.targetName); |
| 52 | fetchChild<TextBoxWidget>("name")->setText(m_bookmark.bookmarkName, false); |
| 53 | fetchChild<TextBoxWidget>("name")->focus(); |
| 54 | } |
| 55 | |
| 56 | void EditBookmarkDialog::ok() { |
| 57 | m_bookmark.bookmarkName = fetchChild<TextBoxWidget>("name")->getText(); |