| 63 | } // namespace |
| 64 | |
| 65 | void AboutBox(not_null<Ui::GenericBox*> box) { |
| 66 | box->setTitle(u"64Gram Desktop"_q); |
| 67 | |
| 68 | auto layout = box->verticalLayout(); |
| 69 | |
| 70 | const auto version = layout->add( |
| 71 | object_ptr<Ui::LinkButton>( |
| 72 | box, |
| 73 | tr::lng_about_version( |
| 74 | tr::now, |
| 75 | lt_version, |
| 76 | currentVersionText()), |
| 77 | st::aboutVersionLink), |
| 78 | QMargins( |
| 79 | st::boxRowPadding.left(), |
| 80 | -st::lineWidth * 3, |
| 81 | st::boxRowPadding.right(), |
| 82 | st::boxRowPadding.bottom())); |
| 83 | version->setClickedCallback([=] { |
| 84 | if (cRealAlphaVersion()) { |
| 85 | auto url = u"https://tdesktop.com/"_q; |
| 86 | if (Platform::IsWindows32Bit()) { |
| 87 | url += u"win/%1.zip"_q; |
| 88 | } else if (Platform::IsWindows64Bit()) { |
| 89 | url += u"win64/%1.zip"_q; |
| 90 | } else if (Platform::IsWindowsARM64()) { |
| 91 | url += u"winarm/%1.zip"_q; |
| 92 | } else if (Platform::IsMac()) { |
| 93 | url += u"mac/%1.zip"_q; |
| 94 | } else if (Platform::IsLinux()) { |
| 95 | url += u"linux/%1.tar.xz"_q; |
| 96 | } else { |
| 97 | Unexpected("Platform value."); |
| 98 | } |
| 99 | url = url.arg(u"talpha%1_%2"_q |
| 100 | .arg(cRealAlphaVersion()) |
| 101 | .arg(Core::countAlphaVersionSignature(cRealAlphaVersion()))); |
| 102 | |
| 103 | QGuiApplication::clipboard()->setText(url); |
| 104 | |
| 105 | box->getDelegate()->show( |
| 106 | Ui::MakeInformBox( |
| 107 | "The link to the current private alpha " |
| 108 | "version of Telegram Desktop was copied " |
| 109 | "to the clipboard.")); |
| 110 | } else { |
| 111 | File::OpenUrl(Core::App().changelogLink()); |
| 112 | } |
| 113 | }); |
| 114 | |
| 115 | Ui::AddSkip(layout, st::aboutTopSkip); |
| 116 | |
| 117 | const auto addText = [&](rpl::producer<TextWithEntities> text) { |
| 118 | const auto label = layout->add( |
| 119 | object_ptr<Ui::FlatLabel>(box, std::move(text), st::aboutLabel), |
| 120 | st::boxRowPadding); |
| 121 | label->setLinksTrusted(); |
| 122 | Ui::AddSkip(layout, st::aboutSkip); |
nothing calls this directly
no test coverage detected