Skip to content

Commit

Permalink
Update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Aug 3, 2023
1 parent de2b4ba commit 682a053
Show file tree
Hide file tree
Showing 23 changed files with 748 additions and 406 deletions.
2 changes: 2 additions & 0 deletions include/api/API.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ class API : public QObject
///
bool isUserAuthorized(const QString& password);

bool isUserBlocked();

///
/// @brief Test if Hyperhdr has the default PW
/// @return The result
Expand Down
4 changes: 3 additions & 1 deletion include/base/AuthManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class AuthManager : public QObject
/// @brief Check if user auth is temporary blocked due to failed attempts
/// @return True on blocked and no further Auth requests will be accepted
///
bool isUserAuthBlocked() const;


///
/// @brief Check if token auth is temporary blocked due to failed attempts
Expand All @@ -92,6 +92,8 @@ public slots:
///
bool isUserAuthorized(const QString& user, const QString& pw);

bool isUserAuthBlocked() const;

///
/// @brief Check if token is authorized
/// @param token The token
Expand Down
2 changes: 2 additions & 0 deletions include/utils/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Logger : public QObject
static void deleteInstance(const QString& name = "");
static void setLogLevel(LogLevel level, const QString& name = "");
static LogLevel getLogLevel(const QString& name = "");
static QString getLastError();

void Message(LogLevel level, const char* sourceFile, const char* func, unsigned int line, const char* fmt, ...);
void setMinLevel(LogLevel level);
Expand All @@ -98,6 +99,7 @@ class Logger : public QObject
static QMutex _mapLock;
static QMap<QString, Logger*> _loggerMap;
static QAtomicInteger<int> GLOBAL_MIN_LOG_LEVEL;
static QString _lastError;

const QString _name;
const QString _appname;
Expand Down
6 changes: 5 additions & 1 deletion include/utils/RgbChannelAdjustment.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RgbChannelAdjustment
/// @param adjustR
/// @param adjustG
/// @param adjustB
RgbChannelAdjustment(quint8 instance, uint8_t adjustR, uint8_t adjustG, uint8_t adjustB, QString channelName);
RgbChannelAdjustment(quint8 instance, uint8_t adjustR, uint8_t adjustG, uint8_t adjustB, QString channelName, bool enabled);

///
/// Transform the given array value
Expand Down Expand Up @@ -63,6 +63,8 @@ class RgbChannelAdjustment

uint8_t correction(uint8_t input) const;

bool isEnabled();

static RgbChannelAdjustment createRgbChannelAdjustment(quint8 instance, const QJsonObject& colorConfig, const QString& channelName, int defaultR, int defaultG, int defaultB);

private:
Expand Down Expand Up @@ -104,4 +106,6 @@ class RgbChannelAdjustment

/// current brightness value
uint8_t _brightness;

bool _enabled;
};
7 changes: 7 additions & 0 deletions sources/api/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,13 @@ bool API::isUserAuthorized(const QString& password)
return res;
}

bool API::isUserBlocked()
{
bool res;
SAFE_CALL_0_RET(_authManager, isUserAuthBlocked, bool, res);
return res;
}

bool API::hasHyperhdrDefaultPw()
{
bool res;
Expand Down
Loading

0 comments on commit 682a053

Please sign in to comment.