mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-15 14:51:14 -08:00
example 'meshtastic': fix background mode on android; revisions
This commit is contained in:
parent
44bd77cb08
commit
3585e7886a
7 changed files with 13 additions and 3 deletions
|
|
@ -191,7 +191,7 @@ void BLE_ME::setBackgroundMode(bool background) {
|
|||
}
|
||||
|
||||
static QString packetsFile() {
|
||||
return QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/meshtastic-packets.bin";
|
||||
return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/../meshtastic-packets.bin";
|
||||
}
|
||||
|
||||
void BLE_ME::saveBytes(const QByteArray& packet) {
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ QT::QT() : QObject() {
|
|||
[&](Qt::ApplicationState state) {
|
||||
if (state == Qt::ApplicationInactive) {
|
||||
ble->setBackgroundMode(true);
|
||||
ecl_fun("app:on-background-mode");
|
||||
} else if (state == Qt::ApplicationActive) {
|
||||
ble->setBackgroundMode(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,6 +173,9 @@
|
|||
(dolist (packet packets)
|
||||
(received-from-radio packet))
|
||||
(receiving-done)
|
||||
;; this will show eventual red circles with numbers of unread messages
|
||||
(q> |currentIndex| ui:*group-view* -1)
|
||||
(q> |currentIndex| ui:*main-view* 0) ; 'Group'
|
||||
(values))
|
||||
|
||||
(defun node-to-name (num)
|
||||
|
|
|
|||
|
|
@ -51,6 +51,11 @@
|
|||
(lora:get-node-config)))
|
||||
(values))
|
||||
|
||||
(defun on-background-mode () ; see Qt
|
||||
;; for showing number of unread messages
|
||||
(change-setting :latest-receiver nil)
|
||||
(values))
|
||||
|
||||
;;; settings
|
||||
|
||||
(let (file)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#:message-dialog
|
||||
#:make-backup
|
||||
#:my-ip
|
||||
#:on-background-mode
|
||||
#:on-config-complete
|
||||
#:restore-eventual-backup
|
||||
#:save-settings
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
(defun ini ()
|
||||
(q> |model| ui:*region*
|
||||
(cons "-" (rest (mapcar 'symbol-name (lora:keywords :region-code)))))
|
||||
(mapcar 'symbol-name (lora:keywords :region-code)))
|
||||
(x:when-it (app:setting :region)
|
||||
(q> |currentIndex| ui:*region*
|
||||
(q! |indexOfValue| ui:*region*
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
application still try to draw after
|
||||
"applicationStateChanged(Qt::ApplicationSuspended)"
|
||||
signal is sent! -->
|
||||
<meta-data android:name="android.app.background_running" android:value="false"/>
|
||||
<meta-data android:name="android.app.background_running" android:value="true"/>
|
||||
<!-- Background running -->
|
||||
<!-- auto screen scale factor -->
|
||||
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue