| 22 | #include "ui/dialogs/CustomMessageBox.h" |
| 23 | |
| 24 | void MCModInfoFrame::updateWithMod(Mod &m) |
| 25 | { |
| 26 | if (m.type() == m.MOD_FOLDER) |
| 27 | { |
| 28 | clear(); |
| 29 | return; |
| 30 | } |
| 31 | |
| 32 | QString text = ""; |
| 33 | QString name = ""; |
| 34 | if (m.name().isEmpty()) |
| 35 | name = m.mmc_id(); |
| 36 | else |
| 37 | name = m.name(); |
| 38 | |
| 39 | if (m.homeurl().isEmpty()) |
| 40 | text = name; |
| 41 | else |
| 42 | text = "<a href=\"" + m.homeurl() + "\">" + name + "</a>"; |
| 43 | if (!m.authors().isEmpty()) |
| 44 | text += " by " + m.authors().join(", "); |
| 45 | |
| 46 | setModText(text); |
| 47 | |
| 48 | if (m.description().isEmpty()) |
| 49 | { |
| 50 | setModDescription(QString()); |
| 51 | } |
| 52 | else |
| 53 | { |
| 54 | setModDescription(m.description()); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | void MCModInfoFrame::clear() |
| 59 | { |
no test coverage detected