Project

General

Profile

Actions

Feature #882

closed

Add per-store settings pages

Added by Hammel about 2 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Immediate
Assignee:
Target version:
Start date:
29 Jan 2022
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

Description

Touching left/right will cycle through the stores, showing current settings and allow editing in place.
Settings should show:
  • Read only
  • PiSentry store (allows storage of PiSentry videos) (mutually exclusive to Read Only)
  • Store name (symbollic - might use bind mounts when exporting)

PiSentry stores are bind mounted to /media/pisentry.

These changes are needed so pisentries can find stores for video recordings.

Actions #1

Updated by Hammel about 2 years ago

  • Priority changed from Immediate to Urgent
  • Target version changed from 2.0 - Harkonnen to 2.1 - Feyd
Actions #2

Updated by Hammel 10 months ago

  • Target version changed from 2.1 - Feyd to 3.0 - Corrino
Actions #3

Updated by Hammel 5 months ago

  • Priority changed from Urgent to Immediate
  • Severity changed from 01 - Critical to 04 - Low
Actions #4

Updated by Hammel 4 months ago

  • Severity changed from 04 - Low to 01 - Critical
Actions #5

Updated by Hammel 4 months ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Design

  1. dbUpdateFS(): scan db entry for stamp files.
    1. Read Only (mounted read-only)
    2. PiSentry (unique owner ID created by PiSentry device with group of "PiSentry" so Ironman can read them and with all files marked as 740 perms)
    3. Store Name (contains string name for store)

The function updates an internal DB (GSList). statuswidget.c:drawText() does a lookup for exported directories to get the GSList entry and prints "ro" (read-only), "ps" (pisentry) and/or the store name next to the exported path.

The output should be changed to look like this.

   ro  ps  Store_Name  Store_Export_Path

The list should only show 10 entries at a time. Tapping "next" shows the next 10, and so on. Tapping "prev" shows last 10, and so on. ESC/Home takes the user back to the previous screen. This will require some mods to the touch handler (imageTouchGTK()) to support this.

Actions #6

Updated by Hammel 4 months ago

  • % Done changed from 10 to 50

DB updates are in place.

Now I need to update the UI.

Actions #7

Updated by Hammel 4 months ago

Initial UI updates in place, but the call to drawText() needs to track "pages" of displays. If there are more than 10 exports then Next and Prev options in the StatusWidget needs to page through them. The StatusWidget doesn't yet have the Next/Previous capability. Basically when the Next tap is done the StatusWidget page is incremented (starts at 0). If the Previous tap is done the StatusWidget's page is decremented. And every page update calls gtk_status_update().

Actions #8

Updated by Hammel 4 months ago

Initial test shows the app is not crashing with these updates, but it doesn't show any text on the text page. I think one reason might be that the createPopup() is not created in the main thread, so I'm testing a fix for that now.

Actions #9

Updated by Hammel 4 months ago

That didn't fix it. No text is being displayed on the popup window.

I need to install the default pistore package and make sure that was working.

Actions #10

Updated by Hammel 4 months ago

Mainline pistore does show text in popup window, so it's these UI updates that broke it.

Actions #11

Updated by Hammel 4 months ago

The current implementation is all wrong. While I still want the stamp files, I need to process them in db.c:_sumFS(), which currently builds a string like so:

mntdir:Total:Avail:BlockSize

It should be updated to look like this:

mntdir:Total:Avail:BlockSize:RO:PS:Label

where RO and PS are either Y or N and Label is the last field so it can contain spaces.
_sumFS() is called via dbGetStores() from updateStatus() which is currently only called once. Since the stamp files might change externally updateStatus() needs to be called every time togglePopup() is called. That means the GSList generated by dbGetStores() needs to be freed after it's been used by the status widget, otherwise we'll leak.

The status widget currently just reads the exports file to display text. This needs to be changed to iterate the status->nodes GSList in gtk_status_paint().

Actions #12

Updated by Hammel 4 months ago

Getting the partition label can be done with libblkid which is provided by the util-linux package (actually, in a subpackage called util-linux-libs) in Buildroot. See the partitions.c example for how to do this.

Actions #13

Updated by Hammel 4 months ago

  • % Done changed from 50 to 60

The updated version of this is implemented and ready for testing on hardware.

Actions #14

Updated by Hammel 4 months ago

  • % Done changed from 60 to 70

Fixed some minor bugs and tested on hardware. Seems to be working as expected.

The font used is not fixed width so columns are not aligned. Not sure this is an issue or not.

The list of exported devices is not limited in length. I need to implement a paging mechanism.

Actions #15

Updated by Hammel 4 months ago

  • % Done changed from 70 to 80

Fixed the alignment issues by limiting label names to 5 characters.

But running the togglePopup twice will crash the app. This implies that clean up of allocated list data is not correct.

Actions #16

Updated by Hammel 4 months ago

This may be fixed. Freeing the stores from dbGetStores() in updateStatus() probably caused a double free when gtk_status_set() is called the next time.
This needs to be tested on hardware.

Actions #17

Updated by Hammel 3 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 80 to 100

Tested on hardware and is working well.

Code committed and pushed.

Closing issue.

Actions

Also available in: Atom PDF