| 104 | } |
| 105 | |
| 106 | void TicketsLayout::tickets_DefaultKey(const cnt::Ticket tik) { |
| 107 | const auto tik_app_id = esGetRightsIdApplicationId(&tik.rights_id); |
| 108 | const auto used_title = tik.IsUsed(); |
| 109 | const auto tik_used = used_title.has_value(); |
| 110 | |
| 111 | auto info = cfg::Strings.GetString(201) + "\n\n\n"; |
| 112 | |
| 113 | info += cfg::Strings.GetString(90) + " " + util::FormatApplicationId(tik_app_id); |
| 114 | if(tik_used) { |
| 115 | info += " (" + used_title->get().cache.display_name + ")"; |
| 116 | } |
| 117 | |
| 118 | const auto key_gen = esGetRightsIdKeyGeneration(&tik.rights_id); |
| 119 | info += "\n" + cfg::Strings.GetString(95) + " " + std::to_string(key_gen) + " (" + hos::GetKeyGenerationRange(key_gen) + ")"; |
| 120 | info += "\n" + cfg::Strings.GetString(447) + " " + FormatTicketType(tik.type); |
| 121 | info += "\n\n"; |
| 122 | info += tik_used ? cfg::Strings.GetString(202) : cfg::Strings.GetString(203); |
| 123 | |
| 124 | const auto opt_1 = g_MainApplication->DisplayDialog(cfg::Strings.GetString(200), info, { cfg::Strings.GetString(245), cfg::Strings.GetString(244), cfg::Strings.GetString(438), cfg::Strings.GetString(18) }, true); |
| 125 | if(opt_1 == 0) { |
| 126 | if(tik_used) { |
| 127 | g_MainApplication->DisplayDialog(cfg::Strings.GetString(200), cfg::Strings.GetString(440), { cfg::Strings.GetString(234) }, true); |
| 128 | } |
| 129 | else { |
| 130 | const auto opt_2 = g_MainApplication->DisplayDialog(cfg::Strings.GetString(200), cfg::Strings.GetString(204), { cfg::Strings.GetString(111), cfg::Strings.GetString(18) }, true); |
| 131 | if(opt_2 == 0) { |
| 132 | const auto rc = cnt::RemoveTicket(tik); |
| 133 | if(R_SUCCEEDED(rc)) { |
| 134 | g_MainApplication->ShowNotification(cfg::Strings.GetString(206)); |
| 135 | this->UpdateElements(); |
| 136 | } |
| 137 | else { |
| 138 | HandleResult(rc, cfg::Strings.GetString(207)); |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | else if((opt_1 == 1) || (opt_1 == 2)) { |
| 144 | const auto export_cert = (opt_1 == 2); |
| 145 | |
| 146 | const auto expt_tik_path = expt::ExportTicketCert(tik_app_id, export_cert); |
| 147 | g_MainApplication->ShowNotification(cfg::Strings.GetString(439) + " '" + fs::GetSdCardExplorer()->FullPresentablePathFor(expt_tik_path) + "'"); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | } |
nothing calls this directly
no test coverage detected