[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://github.com/monich/harbour-foilauth.git</param>
<param name="branch">master</param>
- <param name="revision">bf9f887</param>
+ <param name="revision">a064b7d</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.9.tar.gz/foil-ui/FoilUiEnterPasswordView.qml
^
|
@@ -12,6 +12,7 @@
property bool wrongPassword
property Component iconComponent
+ property bool _completed
readonly property var _settings: foilUi.settings
readonly property int _screenHeight: page.isLandscape ? Screen.width : Screen.height
readonly property bool _landscapeLayout: page.isLandscape && Screen.sizeCategory < Screen.Large
@@ -31,10 +32,31 @@
inputField.requestFocus()
}
+ Component.onCompleted: _completed = true
+
+ Timer {
+ id: pullDownMenuVisibleTimer
+
+ interval: 400
+ onTriggered: pullDownMenu.visible = true
+ }
+
PullDownMenu {
id: pullDownMenu
- visible: !Qt.inputMethod.visible
+ visible: false
+
+ readonly property bool shouldBeVisible: _completed && !Qt.inputMethod.visible
+
+ // Hide immediately, show with a delay
+ onShouldBeVisibleChanged: {
+ if (shouldBeVisible) {
+ pullDownMenuVisibleTimer.restart()
+ } else {
+ pullDownMenuVisibleTimer.stop()
+ visible = false
+ }
+ }
MenuItem {
text: foilUi.qsTrEnterPasswordViewMenuGenerateNewKey()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.9.tar.gz/qml/CoverPage.qml
^
|
@@ -27,7 +27,7 @@
color: Theme.primaryColor
opacity: 0.1
- readonly property bool active: list.model.needTimer && foilModel.timerActive && displayOn
+ readonly property bool active: foilModel.timerActive && displayOn
readonly property real value: (foilModel.timeLeft - 1)/(foilModel.period - 1)
Behavior on width {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.9.tar.gz/qml/EditAuthTokenDialog.qml
^
|
@@ -153,6 +153,7 @@
id: timeshiftField
width: parent.columnWidth
+ textRightMargin: Theme.paddingLarge/2 + timeshiftEditButton.width + textMargin
//: Text field label (number of password digits)
//% "Time shift (seconds)"
label: qsTrId("foilauth-token-timeshift-text")
@@ -167,6 +168,39 @@
EnterKey.iconSource: "image://theme/icon-m-enter-accept"
EnterKey.onClicked: thisDialog.accept()
+
+ MouseArea {
+ id: timeshiftEditButton
+
+ parent: timeshiftField
+ x: parent.width - width - parent.textMargin
+ width: textEllipsis.implicitWidth + Theme.paddingLarge/2
+ height: parent.height - Theme.paddingLarge
+
+ Text {
+ id: textEllipsis
+
+ anchors {
+ top: parent.top
+ topMargin: timeshiftField.textTopMargin
+ horizontalCenter: parent.horizontalCenter
+ }
+ font.pixelSize: Theme.fontSizeMedium
+ text: "…"
+ textFormat: Text.PlainText
+ color: parent.pressed && parent.containsMouse ? Theme.highlightColor : Theme.primaryColor
+ }
+
+ onClicked: {
+ var editor = pageStack.push(Qt.resolvedUrl("TimeShiftDialog.qml"), {
+ allowedOrientations: thisDialog.allowedOrientations,
+ timeshift: thisDialog.timeshift / 60
+ })
+ editor.accepted.connect(function() {
+ thisDialog.timeshift = editor.timeshift * 60
+ })
+ }
+ }
}
ComboBox {
|
[-]
[+]
|
Added |
_service:tar_git:harbour-foilauth-1.1.9.tar.gz/qml/TimeShiftDialog.qml
^
|
@@ -0,0 +1,61 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+Dialog {
+ property int timeshift // In minutes
+
+ readonly property real screenHeight: isPortrait ? Screen.height : Screen.width
+ readonly property int _fullRound: 24 * 60
+ property int _timebase
+
+ DialogHeader { id: dialogHeader }
+
+ TimePicker {
+ id: timePicker
+
+ property int _lastHour
+ readonly property int _timeshift: _timebase + 60 * hour + minute
+ readonly property int _absTimeshift: Math.abs(_timeshift)
+
+ y: Math.max((screenHeight - height)/2, dialogHeader.y + dialogHeader.height + Theme.paddingLarge)
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ onHourChanged: {
+ if (hour < _lastHour - 6) {
+ _timebase += _fullRound
+ } else if (hour > _lastHour + 6) {
+ _timebase -= _fullRound
+ }
+ _lastHour = hour
+ }
+
+ Label {
+ anchors.centerIn: parent
+ font {
+ pixelSize: Theme.fontSizeExtraLarge
+ family: Theme.fontFamilyHeading
+ }
+ text: (timePicker._timeshift < 0 ? "-" : timePicker._timeshift > 0 ? "+" : "") +
+ xx(Math.floor(timePicker._absTimeshift / 60)) + ":" +
+ xx(timePicker._absTimeshift % 60)
+
+ function xx(n) {
+ return (n >= 10) ? n : "0" + n
+ }
+ }
+ }
+
+ onOpened: {
+ _timebase = Math.floor(timeshift / _fullRound) * _fullRound
+ if (timeshift < 0) _timebase -= _fullRound
+ var delta = timeshift - _timebase
+ timePicker.hour = timePicker._lastHour = Math.floor(delta / 60)
+ timePicker.minute = delta % 60
+ }
+
+ onDone: {
+ if (result == DialogResult.Accepted) {
+ timeshift = timePicker._timeshift
+ }
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.9.tar.gz/settings/settings.qml
^
|
@@ -26,7 +26,7 @@
description: applicationName ?
//: Settings page header description (app version)
//% "Version %1"
- qsTrId("foilauth-settings_page-header-version").arg("1.1.7") : ""
+ qsTrId("foilauth-settings_page-header-version").arg("1.1.9") : ""
Image {
id: appIcon
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.9.tar.gz/src/FoilAuthModel.cpp
^
|
@@ -883,13 +883,13 @@
unlink(dest->str);
}
- if ((iTime || iToken.type() != FoilAuth::AuthTypeTOTP) && !isCanceled()) {
+ if ((iTime || iToken.type() == FoilAuth::AuthTypeHOTP) && !isCanceled()) {
iCurrentPassword = iToken.passwordString(iTime);
- if (iToken.type() == FoilAuth::AuthTypeTOTP) {
+ if (iToken.type() == FoilAuth::AuthTypeHOTP) {
+ iPrevPassword = iNextPassword = iCurrentPassword;
+ } else {
iPrevPassword = iToken.passwordString(iTime - FoilAuth::PERIOD);
iNextPassword = iToken.passwordString(iTime + FoilAuth::PERIOD);
- } else {
- iPrevPassword = iNextPassword = iCurrentPassword;
}
HDEBUG(qPrintable(iPrevPassword) << qPrintable(iCurrentPassword) <<
qPrintable(iNextPassword));
@@ -1587,7 +1587,7 @@
if (iFoilState == FoilModelReady) {
const int n = iData.count();
for (int i = 0; i < n; i++) {
- if (iData.at(i)->iToken.type() == FoilAuthTypes::AuthTypeTOTP) {
+ if (iData.at(i)->iToken.type() != FoilAuthTypes::AuthTypeHOTP) {
return true;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.9.tar.gz/src/FoilAuthToken.cpp
^
|
@@ -291,7 +291,7 @@
{
if (iType == AuthTypeSteam) {
static const QString ALPHABET("23456789BCDFGHJKMNPQRTVWXY");
- uint hash = FoilAuth::hash(iSecret, aTime, iAlgorithm);
+ uint hash = FoilAuth::hash(iSecret, aTime + iTimeshift, iAlgorithm);
QString pass;
for (int i = 0; i < iDigits; i++) {
@@ -309,7 +309,7 @@
return QString().sprintf("%0*u", iDigits, (iType == AuthTypeHOTP) ?
FoilAuth::HOTP(iSecret, iCounter, maxPass, iAlgorithm) :
- FoilAuth::TOTP(iSecret, aTime, maxPass, iAlgorithm));
+ FoilAuth::TOTP(iSecret, aTime + iTimeshift, maxPass, iAlgorithm));
}
}
|