Skip to content

Commit

Permalink
Provide feedback on encryption progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
adenexter committed Nov 24, 2016
1 parent 045e67e commit 534fd56
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/nemo-devicelock/authenticationinput.cpp
Expand Up @@ -64,6 +64,11 @@ void AuthenticationInputAdaptor::AuthenticationEvaluating()
m_authenticationInput->handleAuthenticationEvaluating();
}

void AuthenticationInputAdaptor::AuthenticationProgress(int current, int maximum)
{
m_authenticationInput->authenticationProgress(current, maximum);
}

void AuthenticationInputAdaptor::AuthenticationEnded(bool confirmed)
{
m_authenticationInput->handleAuthenticationEnded(confirmed);
Expand Down Expand Up @@ -288,7 +293,6 @@ void AuthenticationInput::handleAuthenticationEvaluating()

void AuthenticationInput::handleAuthenticationEnded(bool confirmed)
{
qDebug() << "what's the haps";
if (m_status != Idle) {
qCDebug(devicelock, "Authentication ended. Confirmed %s", confirmed ? "true" : "false");

Expand Down
2 changes: 2 additions & 0 deletions src/nemo-devicelock/authenticationinput.h
Expand Up @@ -49,6 +49,7 @@ public slots:
Q_NOREPLY void AuthenticationStarted(uint pid, uint utilizedMethods, uint instruction);
Q_NOREPLY void AuthenticationUnavailable(uint pid, uint error);
Q_NOREPLY void AuthenticationEvaluating();
Q_NOREPLY void AuthenticationProgress(int current, int maximum);
Q_NOREPLY void AuthenticationEnded(bool confirmed);
Q_NOREPLY void Feedback(uint feedback, uint attemptsRemaining, uint utilizedMethods);
Q_NOREPLY void Error(uint error);
Expand Down Expand Up @@ -142,6 +143,7 @@ class NEMODEVICELOCK_EXPORT AuthenticationInput : public QObject, private Connec
void authenticationStarted(Feedback feedback);
void authenticationUnavailable(Error error);
void authenticationEvaluating();
void authenticationProgress(int current, int maximum);
void authenticationEnded(bool confirmed);

void feedback(Feedback feedback, int attemptsRemaining);
Expand Down
13 changes: 13 additions & 0 deletions src/nemo-devicelock/host/hostauthenticationinput.cpp
Expand Up @@ -131,6 +131,19 @@ void HostAuthenticationInput::authenticationEvaluating()
}
}

void HostAuthenticationInput::authenticationProgress(int current, int maximum)
{
if (m_authenticating && !m_inputStack.isEmpty()) {
NemoDBus::send(
m_inputStack.last().connection,
m_inputStack.last().path,
clientInterface,
QStringLiteral("AuthenticationProgress"),
current,
maximum);
}
}

void HostAuthenticationInput::authenticationEnded(bool confirmed)
{
if (m_authenticating) {
Expand Down
1 change: 1 addition & 0 deletions src/nemo-devicelock/host/hostauthenticationinput.h
Expand Up @@ -104,6 +104,7 @@ class HostAuthenticationInput : public HostObject
AuthenticationInput::Feedback feedback = AuthenticationInput::EnterSecurityCode);
void authenticationUnavailable(AuthenticationInput::Error error);
void authenticationEvaluating();
void authenticationProgress(int current, int maximum);
virtual void authenticationEnded(bool confirmed);

virtual void authenticationActive(Authenticator::Methods methods);
Expand Down

0 comments on commit 534fd56

Please sign in to comment.