| 1 |
// SPDX-FileCopyrightText: Nheko Contributors |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: GPL-3.0-or-later |
| 4 |
|
| 5 |
import QtQuick 2.3 |
| 6 |
import QtQuick.Controls 2.3 |
| 7 |
import QtQuick.Layouts 1.10 |
| 8 |
import im.nheko 1.0 |
| 9 |
|
| 10 |
ColumnLayout { |
| 11 |
property string title: qsTr("Verification Code") |
| 12 |
|
| 13 |
spacing: 16 |
| 14 |
|
| 15 |
Label { |
| 16 |
Layout.preferredWidth: scroll.availableWidth |
| 17 |
Layout.fillWidth: true |
| 18 |
wrapMode: Text.Wrap |
| 19 |
text: qsTr("Please verify the following emoji. You should see the same emoji on both sides. If they differ, please press 'They do not match!' to abort verification!") |
| 20 |
color: palette.text |
| 21 |
verticalAlignment: Text.AlignVCenter |
| 22 |
} |
| 23 |
|
| 24 |
Item { Layout.fillHeight: true; } |
| 25 |
RowLayout { |
| 26 |
id: emojis |
| 27 |
|
| 28 |
property var mapping: [{ |
| 29 |
"number": 0, |
| 30 |
"emoji": "🐶", |
| 31 |
"description": "Dog", |
| 32 |
"unicode": "U+1F436" |
| 33 |
}, { |
| 34 |
"number": 1, |
| 35 |
"emoji": "🐱", |
| 36 |
"description": "Cat", |
| 37 |
"unicode": "U+1F431" |
| 38 |
}, { |
| 39 |
"number": 2, |
| 40 |
"emoji": "🦁", |
| 41 |
"description": "Lion", |
| 42 |
"unicode": "U+1F981" |
| 43 |
}, { |
| 44 |
"number": 3, |
| 45 |
"emoji": "🐎", |
| 46 |
"description": "Horse", |
| 47 |
"unicode": "U+1F40E" |
| 48 |
}, { |
| 49 |
"number": 4, |
| 50 |
"emoji": "🦄", |
| 51 |
"description": "Unicorn", |
| 52 |
"unicode": "U+1F984" |
| 53 |
}, { |
| 54 |
"number": 5, |
| 55 |
"emoji": "🐷", |
| 56 |
"description": "Pig", |
| 57 |
"unicode": "U+1F437" |
| 58 |
}, { |
| 59 |
"number": 6, |
| 60 |
"emoji": "🐘", |
| 61 |
"description": "Elephant", |
| 62 |
"unicode": "U+1F418" |
| 63 |
}, { |
| 64 |
"number": 7, |
| 65 |
"emoji": "🐰", |
| 66 |
"description": "Rabbit", |
| 67 |
"unicode": "U+1F430" |
| 68 |
}, { |
| 69 |
"number": 8, |
| 70 |
"emoji": "🐼", |
| 71 |
"description": "Panda", |
| 72 |
"unicode": "U+1F43C" |
| 73 |
}, { |
| 74 |
"number": 9, |
| 75 |
"emoji": "🐓", |
| 76 |
"description": "Rooster", |
| 77 |
"unicode": "U+1F413" |
| 78 |
}, { |
| 79 |
"number": 10, |
| 80 |
"emoji": "🐧", |
| 81 |
"description": "Penguin", |
| 82 |
"unicode": "U+1F427" |
| 83 |
}, { |
| 84 |
"number": 11, |
| 85 |
"emoji": "🐢", |
| 86 |
"description": "Turtle", |
| 87 |
"unicode": "U+1F422" |
| 88 |
}, { |
| 89 |
"number": 12, |
| 90 |
"emoji": "🐟", |
| 91 |
"description": "Fish", |
| 92 |
"unicode": "U+1F41F" |
| 93 |
}, { |
| 94 |
"number": 13, |
| 95 |
"emoji": "🐙", |
| 96 |
"description": "Octopus", |
| 97 |
"unicode": "U+1F419" |
| 98 |
}, { |
| 99 |
"number": 14, |
| 100 |
"emoji": "🦋", |
| 101 |
"description": "Butterfly", |
| 102 |
"unicode": "U+1F98B" |
| 103 |
}, { |
| 104 |
"number": 15, |
| 105 |
"emoji": "🌷", |
| 106 |
"description": "Flower", |
| 107 |
"unicode": "U+1F337" |
| 108 |
}, { |
| 109 |
"number": 16, |
| 110 |
"emoji": "🌳", |
| 111 |
"description": "Tree", |
| 112 |
"unicode": "U+1F333" |
| 113 |
}, { |
| 114 |
"number": 17, |
| 115 |
"emoji": "🌵", |
| 116 |
"description": "Cactus", |
| 117 |
"unicode": "U+1F335" |
| 118 |
}, { |
| 119 |
"number": 18, |
| 120 |
"emoji": "🍄", |
| 121 |
"description": "Mushroom", |
| 122 |
"unicode": "U+1F344" |
| 123 |
}, { |
| 124 |
"number": 19, |
| 125 |
"emoji": "🌏", |
| 126 |
"description": "Globe", |
| 127 |
"unicode": "U+1F30F" |
| 128 |
}, { |
| 129 |
"number": 20, |
| 130 |
"emoji": "🌙", |
| 131 |
"description": "Moon", |
| 132 |
"unicode": "U+1F319" |
| 133 |
}, { |
| 134 |
"number": 21, |
| 135 |
"emoji": "☁️", |
| 136 |
"description": "Cloud", |
| 137 |
"unicode": "U+2601U+FE0F" |
| 138 |
}, { |
| 139 |
"number": 22, |
| 140 |
"emoji": "🔥", |
| 141 |
"description": "Fire", |
| 142 |
"unicode": "U+1F525" |
| 143 |
}, { |
| 144 |
"number": 23, |
| 145 |
"emoji": "🍌", |
| 146 |
"description": "Banana", |
| 147 |
"unicode": "U+1F34C" |
| 148 |
}, { |
| 149 |
"number": 24, |
| 150 |
"emoji": "🍎", |
| 151 |
"description": "Apple", |
| 152 |
"unicode": "U+1F34E" |
| 153 |
}, { |
| 154 |
"number": 25, |
| 155 |
"emoji": "🍓", |
| 156 |
"description": "Strawberry", |
| 157 |
"unicode": "U+1F353" |
| 158 |
}, { |
| 159 |
"number": 26, |
| 160 |
"emoji": "🌽", |
| 161 |
"description": "Corn", |
| 162 |
"unicode": "U+1F33D" |
| 163 |
}, { |
| 164 |
"number": 27, |
| 165 |
"emoji": "🍕", |
| 166 |
"description": "Pizza", |
| 167 |
"unicode": "U+1F355" |
| 168 |
}, { |
| 169 |
"number": 28, |
| 170 |
"emoji": "🎂", |
| 171 |
"description": "Cake", |
| 172 |
"unicode": "U+1F382" |
| 173 |
}, { |
| 174 |
"number": 29, |
| 175 |
"emoji": "❤️", |
| 176 |
"description": "Heart", |
| 177 |
"unicode": "U+2764U+FE0F" |
| 178 |
}, { |
| 179 |
"number": 30, |
| 180 |
"emoji": "😀", |
| 181 |
"description": "Smiley", |
| 182 |
"unicode": "U+1F600" |
| 183 |
}, { |
| 184 |
"number": 31, |
| 185 |
"emoji": "🤖", |
| 186 |
"description": "Robot", |
| 187 |
"unicode": "U+1F916" |
| 188 |
}, { |
| 189 |
"number": 32, |
| 190 |
"emoji": "🎩", |
| 191 |
"description": "Hat", |
| 192 |
"unicode": "U+1F3A9" |
| 193 |
}, { |
| 194 |
"number": 33, |
| 195 |
"emoji": "👓", |
| 196 |
"description": "Glasses", |
| 197 |
"unicode": "U+1F453" |
| 198 |
}, { |
| 199 |
"number": 34, |
| 200 |
"emoji": "🔧", |
| 201 |
"description": "Spanner", |
| 202 |
"unicode": "U+1F527" |
| 203 |
}, { |
| 204 |
"number": 35, |
| 205 |
"emoji": "🎅", |
| 206 |
"description": "Santa", |
| 207 |
"unicode": "U+1F385" |
| 208 |
}, { |
| 209 |
"number": 36, |
| 210 |
"emoji": "👍", |
| 211 |
"description": "Thumbs Up", |
| 212 |
"unicode": "U+1F44D" |
| 213 |
}, { |
| 214 |
"number": 37, |
| 215 |
"emoji": "☂️", |
| 216 |
"description": "Umbrella", |
| 217 |
"unicode": "U+2602U+FE0F" |
| 218 |
}, { |
| 219 |
"number": 38, |
| 220 |
"emoji": "⌛", |
| 221 |
"description": "Hourglass", |
| 222 |
"unicode": "U+231B" |
| 223 |
}, { |
| 224 |
"number": 39, |
| 225 |
"emoji": "⏰", |
| 226 |
"description": "Clock", |
| 227 |
"unicode": "U+23F0" |
| 228 |
}, { |
| 229 |
"number": 40, |
| 230 |
"emoji": "🎁", |
| 231 |
"description": "Gift", |
| 232 |
"unicode": "U+1F381" |
| 233 |
}, { |
| 234 |
"number": 41, |
| 235 |
"emoji": "💡", |
| 236 |
"description": "Light Bulb", |
| 237 |
"unicode": "U+1F4A1" |
| 238 |
}, { |
| 239 |
"number": 42, |
| 240 |
"emoji": "📕", |
| 241 |
"description": "Book", |
| 242 |
"unicode": "U+1F4D5" |
| 243 |
}, { |
| 244 |
"number": 43, |
| 245 |
"emoji": "✏️", |
| 246 |
"description": "Pencil", |
| 247 |
"unicode": "U+270FU+FE0F" |
| 248 |
}, { |
| 249 |
"number": 44, |
| 250 |
"emoji": "📎", |
| 251 |
"description": "Paperclip", |
| 252 |
"unicode": "U+1F4CE" |
| 253 |
}, { |
| 254 |
"number": 45, |
| 255 |
"emoji": "✂️", |
| 256 |
"description": "Scissors", |
| 257 |
"unicode": "U+2702U+FE0F" |
| 258 |
}, { |
| 259 |
"number": 46, |
| 260 |
"emoji": "🔒", |
| 261 |
"description": "Lock", |
| 262 |
"unicode": "U+1F512" |
| 263 |
}, { |
| 264 |
"number": 47, |
| 265 |
"emoji": "🔑", |
| 266 |
"description": "Key", |
| 267 |
"unicode": "U+1F511" |
| 268 |
}, { |
| 269 |
"number": 48, |
| 270 |
"emoji": "🔨", |
| 271 |
"description": "Hammer", |
| 272 |
"unicode": "U+1F528" |
| 273 |
}, { |
| 274 |
"number": 49, |
| 275 |
"emoji": "☎️", |
| 276 |
"description": "Telephone", |
| 277 |
"unicode": "U+260EU+FE0F" |
| 278 |
}, { |
| 279 |
"number": 50, |
| 280 |
"emoji": "🏁", |
| 281 |
"description": "Flag", |
| 282 |
"unicode": "U+1F3C1" |
| 283 |
}, { |
| 284 |
"number": 51, |
| 285 |
"emoji": "🚂", |
| 286 |
"description": "Train", |
| 287 |
"unicode": "U+1F682" |
| 288 |
}, { |
| 289 |
"number": 52, |
| 290 |
"emoji": "🚲", |
| 291 |
"description": "Bicycle", |
| 292 |
"unicode": "U+1F6B2" |
| 293 |
}, { |
| 294 |
"number": 53, |
| 295 |
"emoji": "✈️", |
| 296 |
"description": "Aeroplane", |
| 297 |
"unicode": "U+2708U+FE0F" |
| 298 |
}, { |
| 299 |
"number": 54, |
| 300 |
"emoji": "🚀", |
| 301 |
"description": "Rocket", |
| 302 |
"unicode": "U+1F680" |
| 303 |
}, { |
| 304 |
"number": 55, |
| 305 |
"emoji": "🏆", |
| 306 |
"description": "Trophy", |
| 307 |
"unicode": "U+1F3C6" |
| 308 |
}, { |
| 309 |
"number": 56, |
| 310 |
"emoji": "⚽", |
| 311 |
"description": "Ball", |
| 312 |
"unicode": "U+26BD" |
| 313 |
}, { |
| 314 |
"number": 57, |
| 315 |
"emoji": "🎸", |
| 316 |
"description": "Guitar", |
| 317 |
"unicode": "U+1F3B8" |
| 318 |
}, { |
| 319 |
"number": 58, |
| 320 |
"emoji": "🎺", |
| 321 |
"description": "Trumpet", |
| 322 |
"unicode": "U+1F3BA" |
| 323 |
}, { |
| 324 |
"number": 59, |
| 325 |
"emoji": "🔔", |
| 326 |
"description": "Bell", |
| 327 |
"unicode": "U+1F514" |
| 328 |
}, { |
| 329 |
"number": 60, |
| 330 |
"emoji": "⚓", |
| 331 |
"description": "Anchor", |
| 332 |
"unicode": "U+2693" |
| 333 |
}, { |
| 334 |
"number": 61, |
| 335 |
"emoji": "🎧", |
| 336 |
"description": "Headphones", |
| 337 |
"unicode": "U+1F3A7" |
| 338 |
}, { |
| 339 |
"number": 62, |
| 340 |
"emoji": "📁", |
| 341 |
"description": "Folder", |
| 342 |
"unicode": "U+1F4C1" |
| 343 |
}, { |
| 344 |
"number": 63, |
| 345 |
"emoji": "📌", |
| 346 |
"description": "Pin", |
| 347 |
"unicode": "U+1F4CC" |
| 348 |
}] |
| 349 |
|
| 350 |
Layout.alignment: Qt.AlignHCenter |
| 351 |
|
| 352 |
Repeater { |
| 353 |
id: repeater |
| 354 |
|
| 355 |
model: 7 |
| 356 |
|
| 357 |
delegate: Rectangle { |
| 358 |
color: "transparent" |
| 359 |
implicitHeight: Qt.application.font.pixelSize * 8 |
| 360 |
implicitWidth: col.width |
| 361 |
|
| 362 |
ColumnLayout { |
| 363 |
id: col |
| 364 |
|
| 365 |
property var emoji: emojis.mapping[flow.sasList[index]] |
| 366 |
|
| 367 |
Layout.fillWidth: true |
| 368 |
anchors.bottom: parent.bottom |
| 369 |
|
| 370 |
Label { |
| 371 |
//height: font.pixelSize * 2 |
| 372 |
Layout.alignment: Qt.AlignHCenter |
| 373 |
text: col.emoji.emoji |
| 374 |
font.pixelSize: Qt.application.font.pixelSize * 2 |
| 375 |
font.family: Settings.emojiFont != "" ? Settings.emojiFont : undefined |
| 376 |
color: palette.text |
| 377 |
} |
| 378 |
|
| 379 |
Label { |
| 380 |
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom |
| 381 |
text: col.emoji.description |
| 382 |
color: palette.text |
| 383 |
} |
| 384 |
|
| 385 |
} |
| 386 |
|
| 387 |
} |
| 388 |
|
| 389 |
} |
| 390 |
|
| 391 |
} |
| 392 |
Item { Layout.fillHeight: true; } |
| 393 |
|
| 394 |
Label { |
| 395 |
Layout.preferredWidth: 400 |
| 396 |
Layout.fillWidth: true |
| 397 |
wrapMode: Text.Wrap |
| 398 |
text: qsTr("The displayed emoji might look different in different clients if a different font is used. Similarly they might be translated into different languages. Nonetheless they should depict one of 64 different objects or animals. For example a lion and a cat are different, but a cat is the same even if one client just shows a cat face, while another client shows a full cat body.") |
| 399 |
color: palette.text |
| 400 |
verticalAlignment: Text.AlignVCenter |
| 401 |
} |
| 402 |
|
| 403 |
Item { Layout.fillHeight: true; } |
| 404 |
|
| 405 |
RowLayout { |
| 406 |
Button { |
| 407 |
Layout.alignment: Qt.AlignLeft |
| 408 |
text: qsTr("They do not match!") |
| 409 |
onClicked: { |
| 410 |
flow.cancel(); |
| 411 |
dialog.close(); |
| 412 |
} |
| 413 |
} |
| 414 |
|
| 415 |
Item { |
| 416 |
Layout.fillWidth: true |
| 417 |
} |
| 418 |
|
| 419 |
Button { |
| 420 |
Layout.alignment: Qt.AlignRight |
| 421 |
text: qsTr("They match!") |
| 422 |
onClicked: flow.next() |
| 423 |
} |
| 424 |
|
| 425 |
} |
| 426 |
|
| 427 |
} |