Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.37.1 changes #10

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -81,5 +81,5 @@ build/osx-x86_64/release/moc/moc_predefs.h
/resources/about_html/*

# Translations
/resources/translations/*
/resources/translations/*.qm
!/resources/translations/en_US.ts
3,064 changes: 3,064 additions & 0 deletions resources/translations/da_DK.ts

Large diffs are not rendered by default.

3,063 changes: 3,063 additions & 0 deletions resources/translations/de_CH.ts

Large diffs are not rendered by default.

3,064 changes: 3,064 additions & 0 deletions resources/translations/de_DE.ts

Large diffs are not rendered by default.

203 changes: 130 additions & 73 deletions resources/translations/en_US.ts

Large diffs are not rendered by default.

3,050 changes: 3,050 additions & 0 deletions resources/translations/es_ES.ts

Large diffs are not rendered by default.

3,065 changes: 3,065 additions & 0 deletions resources/translations/fr_FR.ts

Large diffs are not rendered by default.

3,064 changes: 3,064 additions & 0 deletions resources/translations/hu_HU.ts

Large diffs are not rendered by default.

3,064 changes: 3,064 additions & 0 deletions resources/translations/it_IT.ts

Large diffs are not rendered by default.

3,063 changes: 3,063 additions & 0 deletions resources/translations/nl_NL.ts

Large diffs are not rendered by default.

3,050 changes: 3,050 additions & 0 deletions resources/translations/no_NO.ts

Large diffs are not rendered by default.

3,050 changes: 3,050 additions & 0 deletions resources/translations/pl_PL.ts

Large diffs are not rendered by default.

3,050 changes: 3,050 additions & 0 deletions resources/translations/pt_PT.ts

Large diffs are not rendered by default.

3,050 changes: 3,050 additions & 0 deletions resources/translations/sv_SE.ts

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/config/config.cpp
Original file line number Diff line number Diff line change
@@ -365,6 +365,17 @@ void Config::setEntityButtonFuncInverted(bool value) {
emit entityButtonFuncInvertedChanged();
}

bool Config::getShowBatteryPercentage()
{
return m_settings->value("ui/batteryPercent", false).toBool();
}

void Config::setShowBatteryPercentage(bool value)
{
m_settings->setValue("ui/batteryPercent", value);
emit showBatteryPercentageChanged();
}

void Config::setWakeupSensitivity(Config::WakeupSensitivities sensitivity) {
if (m_wakeupSensitivity != sensitivity) {
int id = m_core->setPowerSavingCfg(sensitivity, getDisplayTimeout(), getSleepTimeout());
7 changes: 7 additions & 0 deletions src/config/config.h
Original file line number Diff line number Diff line change
@@ -78,6 +78,8 @@ class Config : public QObject {
Q_PROPERTY(bool entityButtonFuncInverted READ getEntityButtonFuncInverted WRITE setEntityButtonFuncInverted NOTIFY
entityButtonFuncInvertedChanged)

Q_PROPERTY(bool showBatteryPercentage READ getShowBatteryPercentage WRITE setShowBatteryPercentage NOTIFY showBatteryPercentageChanged)

public:
explicit Config(core::Api* core, QObject* parent = nullptr);
~Config();
@@ -133,6 +135,9 @@ class Config : public QObject {
bool getEntityButtonFuncInverted();
void setEntityButtonFuncInverted(bool value);

bool getShowBatteryPercentage();
void setShowBatteryPercentage(bool value);

enum WakeupSensitivities { off = 0, low = 1, medium = 2, high = 3 };
Q_ENUM(WakeupSensitivities)

@@ -235,6 +240,8 @@ class Config : public QObject {

void entityButtonFuncInvertedChanged();

void showBatteryPercentageChanged();

public slots:
void onCoreConnected();
void onConfigChanged(int reqId, int code, core::Config config);
6 changes: 3 additions & 3 deletions src/hardware/battery.cpp
Original file line number Diff line number Diff line change
@@ -89,9 +89,9 @@ void Battery::onWarning(core::MsgEventTypes::WarningEvent event, bool shutdown,
case core::MsgEventTypes::WarningEvent::BATTERY_UNDERVOLT:
qCDebug(lcHwBattery()) << "Low battery";
uc::ui::Notification::createActionableWarningNotification(
tr("Battery needs servicing"),
tr("Critically low battery voltage detected. Charging has been disabled. Battery needs servicing."),
"uc:battery-crit");
tr("Low battery"),
tr("Low battery voltage detected. Charge the battery to 100% before using the remote again."),
"uc:battery-low");
break;
default:
break;
15 changes: 8 additions & 7 deletions src/hardware/wifi.cpp
Original file line number Diff line number Diff line change
@@ -30,9 +30,7 @@ Wifi::Wifi(core::Api *core, QObject *parent) : QObject(parent), m_core(core) {
QObject::connect(m_core, &core::Api::wifiEventChanged, this, &Wifi::onWifiEventChanged);
}

Wifi::~Wifi() {
s_instance = nullptr;
}
Wifi::~Wifi() { s_instance = nullptr; }

QList<WifiNetwork *> Wifi::getNetworkList() {
QList<WifiNetwork *> list;
@@ -77,7 +75,7 @@ void Wifi::connect(const QString &ssid, const QString &password, uc::hw::Securit
emit connecting();

addNetwork(ssid, password, security);
m_lastConnectedSSid = ssid;
m_lastConnectedSSid = ssid;
m_lastConnectedPassword = password;
}

@@ -232,9 +230,7 @@ void Wifi::stopNetworkScan() {
});
}

void Wifi::clearNetworkList() {
m_networkList.clear();
}
void Wifi::clearNetworkList() { m_networkList.clear(); }

void Wifi::getAllWifiNetworks() {
m_knownNetworkList.clear();
@@ -266,6 +262,11 @@ void Wifi::getAllWifiNetworks() {
void Wifi::deleteSavedNetwork(const QString &networkId) {
auto network = m_knownNetworkList.value(networkId);

if (!network) {
ui::Notification::createNotification(tr("Failed to delete network. Wifi network does not exist."), true);
return;
}

int id = m_core->wifiDeleteNetwork(network->getId());

m_core->onResult(
20 changes: 17 additions & 3 deletions src/qml/MainContainer.qml
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ Item {
popupMenu.open();
}

function openEntityEditMenu(obj) {
function openEntityEditMenu(obj, parentGroupId) {
mainContainerRoot.entityObjToEdit = obj;

popupMenu.title = obj.name;
@@ -111,6 +111,12 @@ Item {
title: qsTr("Remove"),
icon: "uc:trash",
callback: function() {
if (parentGroupId !== "") {
let group = GroupController.get(parentGroupId);
group.removeEntity(obj.id);
} else {
currentPage.items.removeItem(obj.id);
}
currentPage.items.removeItem(obj.id);
ui.updatePageItems(currentPage._id);
}
@@ -260,14 +266,22 @@ Item {
currentEntity.delegateItem.toggle();
} else {
if (Config.entityButtonFuncInverted) {
currentEntity.delegateItem.groups.currentItem.item.open();
if (currentEntity.delegateItem.groups.currentItem.item.enabled) {
currentEntity.delegateItem.groups.currentItem.item.open();
} else {
ui.createNotification(currentEntity.delegateItem.groups.currentItem.item.name + " " + qsTr("is unavailable"), true);
}
} else {
currentEntity.delegateItem.groups.currentItem.item.controlTrigger();
}
}
} else {
if (Config.entityButtonFuncInverted) {
currentEntity.delegateItem.open();
if (currentEntity.delegateItem.enabled) {
currentEntity.delegateItem.open();
} else {
ui.createNotification(currentEntity.delegateItem.name + " " + qsTr("is unavailable"), true);
}
} else {
currentEntity.delegateItem.controlTrigger();
}
1 change: 1 addition & 0 deletions src/qml/components/PopupMenu.qml
Original file line number Diff line number Diff line change
@@ -155,6 +155,7 @@ Popup {
text: popupMenu.title
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter }
font: fonts.primaryFont(24, "Bold")
}
2 changes: 1 addition & 1 deletion src/qml/components/Profile.qml
Original file line number Diff line number Diff line change
@@ -824,7 +824,7 @@ Item {
target: closeAnimation

function onFinished() {
buttonNavigation.releaseControl();
buttonNavigation.releaseControl(String(root.containerMain.item));
closed();
}
}
4 changes: 2 additions & 2 deletions src/qml/components/StatusBar.qml
Original file line number Diff line number Diff line change
@@ -290,7 +290,7 @@ Item {
Layout.alignment: Qt.AlignVCenter

pressAndHoldInterval: 500
onPressAndHold: batteryIcon.showPercentage = !batteryIcon.showPercentage
onPressAndHold: Config.showBatteryPercentage = !Config.showBatteryPercentage

RowLayout {
id: batteryIcon
@@ -306,7 +306,7 @@ Item {
text: Battery.level
verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter
font: fonts.primaryFontCapitalized(22)
visible: Battery.isCharging || batteryIcon.showPercentage
visible: Battery.isCharging || Config.showBatteryPercentage
}

Components.Icon {
Loading