From 2f91faf876fda4cbf584f941a9b1812ff541c15e Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Sat, 23 Feb 2019 13:35:36 +0100 Subject: [PATCH 1/3] GitHub #30 Fix About Page Text for Light Ambiances --- qml/pages/About.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qml/pages/About.qml b/qml/pages/About.qml index 248c9a2..671a25a 100644 --- a/qml/pages/About.qml +++ b/qml/pages/About.qml @@ -73,7 +73,7 @@ Page { horizontalAlignment: TextEdit.Center readOnly: true text: qsTr("A Simple Sailfish OTP Generator\n(RFC 6238/4226 compatible)") - color: "white" + color: Theme.primaryColor } TextArea { id: copyright @@ -82,7 +82,7 @@ Page { horizontalAlignment: TextEdit.Center readOnly: true text: qsTr("Copyright: Stefan Brand\nLicense: BSD (3-clause)") - color: "white" + color: Theme.primaryColor } Button { id: manual @@ -108,7 +108,7 @@ Page { horizontalAlignment: TextEdit.Center readOnly: true text: "\n"+qsTr("SailOTP uses the following third party libs:")+"\n\nhttp://caligatio.github.io/jsSHA/\nhttps://code.google.com/archive/p/crypto-js/\nhttp://sourceforge.net/projects/qzxing/\nhttp://fukuchi.org/works/qrencode/" - color: "white" + color: Theme.primaryColor } TextArea { @@ -119,7 +119,7 @@ Page { horizontalAlignment: TextEdit.Center readOnly: true text: qsTr("Contributors:")+"\n\nRobin Appelman: SteamGuard "+qsTr("Support") - color: "white" + color: Theme.primaryColor } TextArea { @@ -130,7 +130,7 @@ Page { horizontalAlignment: TextEdit.Center readOnly: true text: qsTr("Translators:")+"\n\nChinese: BirdZhang\nFinnish: Johan Heikkilä\nFrench: Romain Tartière\nItalian: Tichy\nRussian: moorchegue\nSpanish: p4moedo\nSwedish: Åke Engelbrektson\nEnglish: Stefan Brand\nGerman: Stefan Brand" - color: "white" + color: Theme.primaryColor } } VerticalScrollDecorator { } From 714f1f1917e501d6a246f9749971da3c09cb0516 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Sat, 23 Feb 2019 16:00:41 +0100 Subject: [PATCH 2/3] Github #29 Fix Progressbar Position for Light Ambiances, First Attempt --- qml/pages/MainView.qml | 51 +++++++++++++++------------ translations/harbour-sailotp-de.ts | 26 +++++++------- translations/harbour-sailotp-es.ts | 26 +++++++------- translations/harbour-sailotp-fi.ts | 26 +++++++------- translations/harbour-sailotp-fr.ts | 26 +++++++------- translations/harbour-sailotp-it.ts | 26 +++++++------- translations/harbour-sailotp-pt_BR.ts | 26 +++++++------- translations/harbour-sailotp-ru.ts | 26 +++++++------- translations/harbour-sailotp-sv.ts | 26 +++++++------- translations/harbour-sailotp-zh_CN.ts | 26 +++++++------- translations/harbour-sailotp.ts | 26 +++++++------- 11 files changed, 159 insertions(+), 152 deletions(-) diff --git a/qml/pages/MainView.qml b/qml/pages/MainView.qml index eb6451e..59f9636 100644 --- a/qml/pages/MainView.qml +++ b/qml/pages/MainView.qml @@ -40,6 +40,7 @@ Page { // This holds the time of the last update of the page as Unix Timestamp (in Milliseconds) property double lastUpdated: 0 + property double seconds_global: 0 // Reload the List of OTPs from storage function refreshOTPList() { @@ -56,26 +57,24 @@ Page { function refreshOTPValues() { // get seconds from current Date var curDate = new Date(); - var seconds_global = curDate.getSeconds() % 30 + seconds_global = curDate.getSeconds() % 30 // Iterate over all List entries for (var i=0; i 2000)) { + if (appWin.listModel.get(i).otp === "------" || seconds == 0 || (curDate.getTime() - lastUpdated > 2000)) { var curOTP = OTP.calcOTP(appWin.listModel.get(i).secret, appWin.listModel.get(i).type, appWin.listModel.get(i).len, appWin.listModel.get(i).diff, 0) appWin.listModel.setProperty(i, "otp", curOTP); } - } else if (appWin.coverType == "HOTP" && (curDate.getTime() - lastUpdated > 2000) && appWin.listModel.get(i).fav == 1) { + } else if (appWin.coverType === "HOTP" && (curDate.getTime() - lastUpdated > 2000) && appWin.listModel.get(i).fav === 1) { // If we are coming back from the CoverPage update OTP value if current favourite is HOTP appWin.listModel.setProperty(i, "otp", appWin.coverOTP); } } - // Update the Progressbar - updateProgress.value = 29 - seconds_global // Set lastUpdate property lastUpdated = curDate.getTime(); } @@ -111,25 +110,9 @@ Page { } } - ProgressBar { - id: updateProgress - width: parent.width - maximumValue: 29 - anchors.top: parent.top - anchors.topMargin: Theme.itemSizeExtraSmall - Theme.paddingSmall - // Only show when there are enries - visible: appWin.listModel.count - } - - SilicaListView { id: otpList - - header: PageHeader { - title: "SailOTP" - } - anchors.fill: parent model: appWin.listModel width: parent.width @@ -140,6 +123,30 @@ Page { hintText: qsTr("Pull down to add a OTP") } + header: Row { + height: Theme.itemSizeSmall + width: parent.width + ProgressBar { + id: updateProgress + anchors.top: parent.top + // Hack to get the Progress Bar in roughly the same spot on Light and Dark Ambiances + anchors.topMargin: Theme.colorScheme === 0 ? Theme.paddingLarge * 1.1 : Theme.paddingSmall * 0.6 + height: Theme.itemSizeSmall + width: parent.width * 0.65 + maximumValue: 29 + value: 29 - seconds_global + // Only show when there are enries + visible: appWin.listModel.count + } + PageHeader { + id: header + anchors.top: parent.top + height: Theme.itemSizeSmall + width: parent.width * 0.35 + title: "SailOTP" + } + } + delegate: ListItem { id: otpListItem menu: otpContextMenu diff --git a/translations/harbour-sailotp-de.ts b/translations/harbour-sailotp-de.ts index d6f133c..e230827 100644 --- a/translations/harbour-sailotp-de.ts +++ b/translations/harbour-sailotp-de.ts @@ -250,67 +250,67 @@ Lizenz: BSD (3-Klausel) MainView - + About Über - + Settings Einstellungen - + Export / Import Export / Import - + Add Token Token hinzufügen - + Nothing here Hier ist nichts - + Pull down to add a OTP Nach unten ziehen zum hinzufügen - + Deleting Lösche - + Token for Token für - + copied to clipboard kopiert - + Move up Nach oben - + Move down Nach unten - + Edit Bearbeiten - + Delete Löschen diff --git a/translations/harbour-sailotp-es.ts b/translations/harbour-sailotp-es.ts index 65f7db6..8863118 100644 --- a/translations/harbour-sailotp-es.ts +++ b/translations/harbour-sailotp-es.ts @@ -250,67 +250,67 @@ Licencia: BSD (de 3 cláusulas) MainView - + About Acerca de - + Settings Configuración - + Export / Import Exportar/Importar - + Add Token Añadir Token - + Nothing here Nada aquí - + Pull down to add a OTP Tire hacia abajo para añadir tokens OTP - + Deleting Borrando - + Token for Token para - + copied to clipboard copiado al portapapeles - + Move up Ascender - + Move down Descender - + Edit Editar - + Delete Borrar diff --git a/translations/harbour-sailotp-fi.ts b/translations/harbour-sailotp-fi.ts index c4f09a1..c0e6fcc 100644 --- a/translations/harbour-sailotp-fi.ts +++ b/translations/harbour-sailotp-fi.ts @@ -251,68 +251,68 @@ Lisenssi: BSD (3-clause) MainView - + About Tietoja - + Settings Translated using Google Translate Asetukset - + Export / Import Eksportoi / Importoi - + Add Token Lisää tunnus - + Nothing here Tyhjä - + Pull down to add a OTP Vedä alaspäin lisääksesi OTP:n - + Deleting Poistaa - + Token for Tunnus - + copied to clipboard kopioitu leikepöydälle - + Move up Siirrä ylös - + Move down Siirrä alas - + Edit Muokkaa - + Delete Poista diff --git a/translations/harbour-sailotp-fr.ts b/translations/harbour-sailotp-fr.ts index 8471527..201381e 100644 --- a/translations/harbour-sailotp-fr.ts +++ b/translations/harbour-sailotp-fr.ts @@ -250,68 +250,68 @@ Licence : BSD (3 clauses) MainView - + About À propos - + Settings Translated using Google Translate Paramètres - + Export / Import Exporter / Importer - + Add Token Ajouter un OTP - + Nothing here Aucun mot de passe - + Pull down to add a OTP Glissez vers le bas pour ajouter un OTP - + Deleting Suppression - + Token for OTP pour - + copied to clipboard copié dans le presse-papier - + Move up Déplacer vers le haut - + Move down Déplacer vers le bas - + Edit Modifier - + Delete Supprimer diff --git a/translations/harbour-sailotp-it.ts b/translations/harbour-sailotp-it.ts index 7c78bcc..bc9ef24 100644 --- a/translations/harbour-sailotp-it.ts +++ b/translations/harbour-sailotp-it.ts @@ -250,67 +250,67 @@ Licenza: BSD (3-clause) MainView - + About Informazioni - + Settings Imopstazioni - + Export / Import Esporta / Importa - + Add Token Aggiungi Token - + Nothing here Qua non c'è nulla - + Pull down to add a OTP Trascina giù per aggiungere una OTP - + Deleting Cancellazione - + Token for Token per - + copied to clipboard copiato negli appunti - + Move up Sposta su - + Move down Sposta giù - + Edit Modifica - + Delete Cancella diff --git a/translations/harbour-sailotp-pt_BR.ts b/translations/harbour-sailotp-pt_BR.ts index 26cec05..c441792 100644 --- a/translations/harbour-sailotp-pt_BR.ts +++ b/translations/harbour-sailotp-pt_BR.ts @@ -249,67 +249,67 @@ Licença: BSD (3-clause) MainView - + About Sobre - + Settings Configurações - + Export / Import Exportar e importar - + Add Token Adicionar Token - + Nothing here Nada aqui - + Pull down to add a OTP Puxe para baixo para adicionar um OTP - + Deleting Apagando - + Token for Token para - + copied to clipboard copiado para a área de transferência - + Move up Mover para cima - + Move down Mover para baixo - + Edit Editar - + Delete Apagar diff --git a/translations/harbour-sailotp-ru.ts b/translations/harbour-sailotp-ru.ts index e926443..163aa1d 100644 --- a/translations/harbour-sailotp-ru.ts +++ b/translations/harbour-sailotp-ru.ts @@ -251,68 +251,68 @@ License: BSD (3-clause) MainView - + About О приложении - + Settings Translated using Google Translate настройки - + Export / Import Экспорт / импорт - + Add Token Добавить токен - + Nothing here Ничего нету - + Pull down to add a OTP Потяните вниз чтобы добавить OTP - + Deleting Удаление - + Token for Токен для - + copied to clipboard скопирован в буфер обмена - + Move up Передвинуть вверх - + Move down Передвинуть вниз - + Edit Редактировать - + Delete Удалить diff --git a/translations/harbour-sailotp-sv.ts b/translations/harbour-sailotp-sv.ts index fbbd443..021a4d3 100644 --- a/translations/harbour-sailotp-sv.ts +++ b/translations/harbour-sailotp-sv.ts @@ -251,68 +251,68 @@ Licens: BSD (3-clause) MainView - + About Om - + Settings Translated using Google Translate Inställningar - + Export / Import Export / Import - + Add Token Lägg till Token - + Nothing here Inget här - + Pull down to add a OTP Dra neråt för att lägga till en OTP - + Deleting Tar bort - + Token for Token för - + copied to clipboard kopierad till urklipp - + Move up Flytta upp - + Move down Flytta ner - + Edit Redigera - + Delete Ta bort diff --git a/translations/harbour-sailotp-zh_CN.ts b/translations/harbour-sailotp-zh_CN.ts index d8db44a..f27ead1 100644 --- a/translations/harbour-sailotp-zh_CN.ts +++ b/translations/harbour-sailotp-zh_CN.ts @@ -249,67 +249,67 @@ License: BSD (3-clause) MainView - + About 关于 - + Settings 设置 - + Export / Import 导出/导入 - + Add Token 添加令牌 - + Nothing here 无内容 - + Pull down to add a OTP 下拉添加一个OTP - + Deleting 删除中 - + Token for 令牌 - + copied to clipboard 已复制到剪切板 - + Move up 向上 - + Move down 向下 - + Edit 编辑 - + Delete 删除 diff --git a/translations/harbour-sailotp.ts b/translations/harbour-sailotp.ts index fd1a26d..d107c4a 100644 --- a/translations/harbour-sailotp.ts +++ b/translations/harbour-sailotp.ts @@ -248,67 +248,67 @@ License: BSD (3-clause) MainView - + About - + Settings - + Export / Import - + Add Token - + Nothing here - + Pull down to add a OTP - + Deleting - + Token for - + copied to clipboard - + Move up Move up - + Move down Move down - + Edit - + Delete From 2db39865130f9def362433a64c27a4f9695de908 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Sat, 23 Feb 2019 16:39:15 +0100 Subject: [PATCH 3/3] Github #28 Check Input for Valid Base32 --- qml/pages/AddOTP.qml | 4 +++- translations/harbour-sailotp-de.ts | 10 +++++----- translations/harbour-sailotp-es.ts | 10 +++++----- translations/harbour-sailotp-fi.ts | 10 +++++----- translations/harbour-sailotp-fr.ts | 10 +++++----- translations/harbour-sailotp-it.ts | 10 +++++----- translations/harbour-sailotp-pt_BR.ts | 10 +++++----- translations/harbour-sailotp-ru.ts | 10 +++++----- translations/harbour-sailotp-sv.ts | 10 +++++----- translations/harbour-sailotp-zh_CN.ts | 10 +++++----- translations/harbour-sailotp.ts | 10 +++++----- 11 files changed, 53 insertions(+), 51 deletions(-) diff --git a/qml/pages/AddOTP.qml b/qml/pages/AddOTP.qml index ac33528..28ce97c 100644 --- a/qml/pages/AddOTP.qml +++ b/qml/pages/AddOTP.qml @@ -115,6 +115,8 @@ Dialog { text: paramKey != "" ? paramKey : "" placeholderText: qsTr("Secret OTP Key") focus: true + validator: RegExpValidator { regExp: /^(?:[A-Za-z2-7]{8})*(?:[A-Za-z2-7]{2}={6}|[A-Za-z2-7]{4}={4}|[A-Za-z2-7]{5}={3}|[A-Za-z2-7]{7}=)?$/ } + inputMethodHints: Qt.ImhNoPredictiveText horizontalAlignment: TextInput.AlignLeft EnterKey.enabled: text.length > 15 @@ -168,7 +170,7 @@ Dialog { } // Check if we can Save - canAccept: otpLabel.text.length > 0 && otpSecret.text.length >= 16 && otpLen.text >= 1 && ((paramType == "TOTP" && otpDiff.text != "") || paramType == "TOTP_STEAM" || otpCounter.text.length > 0) ? true : false + canAccept: otpLabel.text.length > 0 && otpSecret.text.length >= 16 && otpSecret.acceptableInput && otpLen.text >= 1 && ((paramType == "TOTP" && otpDiff.text != "") || paramType == "TOTP_STEAM" || otpCounter.text.length > 0) ? true : false // Save if page is Left with Add onDone: { diff --git a/translations/harbour-sailotp-de.ts b/translations/harbour-sailotp-de.ts index e230827..4e18625 100644 --- a/translations/harbour-sailotp-de.ts +++ b/translations/harbour-sailotp-de.ts @@ -101,28 +101,28 @@ Lizenz: BSD (3-Klausel) Geheimer Schlüssel - + Length Länge - + Length of the Token Länge des Tokens - + Time Derivation (Seconds) Zeitabweichung (Sekunden) - + Next Counter Value Nächster Zählerwert - + Next Value of the Counter Nächster Wert für den Zähler diff --git a/translations/harbour-sailotp-es.ts b/translations/harbour-sailotp-es.ts index 8863118..4693c0b 100644 --- a/translations/harbour-sailotp-es.ts +++ b/translations/harbour-sailotp-es.ts @@ -101,28 +101,28 @@ Licencia: BSD (de 3 cláusulas) Llave secreta OTP - + Length Longitud - + Length of the Token Longitud del token - + Time Derivation (Seconds) Derivación de tiempo (segundos) - + Next Counter Value Siguiente Contador - + Next Value of the Counter Siguiente valor del contador diff --git a/translations/harbour-sailotp-fi.ts b/translations/harbour-sailotp-fi.ts index c0e6fcc..151b61e 100644 --- a/translations/harbour-sailotp-fi.ts +++ b/translations/harbour-sailotp-fi.ts @@ -101,28 +101,28 @@ Lisenssi: BSD (3-clause) Salainen OTP-avain - + Length Pituus - + Length of the Token Tunnuksen pituus - + Time Derivation (Seconds) Aikapoikkeama (sekunneissa) - + Next Counter Value Seuraava laskenta-arvo - + Next Value of the Counter Laskurin seuraava arvo diff --git a/translations/harbour-sailotp-fr.ts b/translations/harbour-sailotp-fr.ts index 201381e..2212fee 100644 --- a/translations/harbour-sailotp-fr.ts +++ b/translations/harbour-sailotp-fr.ts @@ -100,28 +100,28 @@ Licence : BSD (3 clauses) Clé secrète OTP - + Length Longueur - + Length of the Token Longueur du jeton - + Time Derivation (Seconds) Dérivation de temps (secondes) - + Next Counter Value Prochaine valeur du compteur - + Next Value of the Counter Prochaine valeur du compteur diff --git a/translations/harbour-sailotp-it.ts b/translations/harbour-sailotp-it.ts index bc9ef24..07f0973 100644 --- a/translations/harbour-sailotp-it.ts +++ b/translations/harbour-sailotp-it.ts @@ -101,28 +101,28 @@ Licenza: BSD (3-clause) Chiave OTP segreta - + Length Lunghezza - + Length of the Token Lunghezza del Token - + Time Derivation (Seconds) Derivazione Temporale (Secondi) - + Next Counter Value Valore Prossimo Contatore - + Next Value of the Counter Prossimo Valore del Contatore diff --git a/translations/harbour-sailotp-pt_BR.ts b/translations/harbour-sailotp-pt_BR.ts index c441792..b13d1dd 100644 --- a/translations/harbour-sailotp-pt_BR.ts +++ b/translations/harbour-sailotp-pt_BR.ts @@ -100,28 +100,28 @@ Licença: BSD (3-clause) Chave secreta OTP - + Length Tamanho - + Length of the Token Tamanho to Token - + Time Derivation (Seconds) Derivação do tempo (segundos) - + Next Counter Value Próximo valor do contador - + Next Value of the Counter Próximo valor do contador diff --git a/translations/harbour-sailotp-ru.ts b/translations/harbour-sailotp-ru.ts index 163aa1d..53dedbb 100644 --- a/translations/harbour-sailotp-ru.ts +++ b/translations/harbour-sailotp-ru.ts @@ -101,28 +101,28 @@ License: BSD (3-clause) Секретный ключ OTP - + Length Длина - + Length of the Token Длина токена - + Time Derivation (Seconds) Интервал расхождения (секунд) - + Next Counter Value Следующее значение счетчика - + Next Value of the Counter Следующее значение счетчика diff --git a/translations/harbour-sailotp-sv.ts b/translations/harbour-sailotp-sv.ts index 021a4d3..f7a883c 100644 --- a/translations/harbour-sailotp-sv.ts +++ b/translations/harbour-sailotp-sv.ts @@ -101,28 +101,28 @@ Licens: BSD (3-clause) Hemlig OTP-nyckel - + Length längd - + Length of the Token Längden av token - + Time Derivation (Seconds) Tidsavvikelsen (sekunder) - + Next Counter Value Nästa räknarvärde - + Next Value of the Counter Nästa värde på räknaren diff --git a/translations/harbour-sailotp-zh_CN.ts b/translations/harbour-sailotp-zh_CN.ts index f27ead1..1424470 100644 --- a/translations/harbour-sailotp-zh_CN.ts +++ b/translations/harbour-sailotp-zh_CN.ts @@ -100,28 +100,28 @@ License: BSD (3-clause) OTP密钥 - + Length 长度 - + Length of the Token 令牌的长度 - + Time Derivation (Seconds) 时间推导(秒) - + Next Counter Value 下一个计数器的值 - + Next Value of the Counter 下一个计数器的值 diff --git a/translations/harbour-sailotp.ts b/translations/harbour-sailotp.ts index d107c4a..e748339 100644 --- a/translations/harbour-sailotp.ts +++ b/translations/harbour-sailotp.ts @@ -99,28 +99,28 @@ License: BSD (3-clause) - + Length Length - + Length of the Token Length of the Token - + Time Derivation (Seconds) Time Derivation (Seconds) - + Next Counter Value - + Next Value of the Counter