Commit graph

35939 commits

Author SHA1 Message Date
Aidan MacDonald
cbb57fe714 rbutil: allow checking bootloader installer capabilities
Instead of checking for certain hardcoded strings, fetch
the actual capability bitmask by instantiating an installer
and querying it.

Change-Id: I7883d9c1e90da37ee7c0189732ac626685adbfa1
2022-01-02 15:50:17 -05:00
Aidan MacDonald
42999913ba x1000: Increase USB current limit to 500 mA at all times
The 100 mA USB current limit added in commit 90dd2f84a9
is a problem when booting with a completely dead battery.
Often 100 mA isn't enough to power the player, never mind
charge the battery, so revert to the old behavior of only
limiting charge current.

Given that the original firmware on these devices isn't
following the USB spec to the letter, it's probably not
worth trying to make Rockbox do so unless and until it
causes a real problem - which hasn't happened yet.

Change-Id: I179a08310c226fe01460680c62fd25fd69079256
2022-01-02 20:11:03 +00:00
Aidan MacDonald
83c2398384 x1000: Fix USB connection problems in bootloader
This problem actually had nothing to do with USB boot; it's
because the cable is plugged in when the USB mode menu item
is selected. The USB thread detected the select button press
and went into charge-only mode (as it usually does when you
hold down a key in Rockbox). This is fixed by having the USB
thread ignore most keys in the bootloader.

USB connect events are delivered via the button queue, and
there were also cases where the connection could be missed
if the event happened within another UI screen. This should
also be fixed.

Change-Id: I077d705a6ac845c8713219eee45d26aa6addfa61
2022-01-02 20:11:03 +00:00
Aidan MacDonald
af872b54ec powermgmt: Bugfixes to time estimation code
Guard against division by zero and prevent the time_now
value from going negative if the counter drops below zero.

Change-Id: Ia8cadfe76086d6d0200964c1f27bab0be708b135
2022-01-02 20:11:03 +00:00
William Wilgus
a7703e4926 gui lists add callback for owner drawn items
allow the guts of gui_sync_list to be used with owner drawn items

WIP

printcell_helper--

goal: allow data to be displayed in a spreadsheet format  with an easy to use interface

printcell_set_columns(gui_synclist, title, icon)
 sets title and calculates cell widths
 each column is identified by '$' character
 ex 3 columns title = "Col1$Col2$Col3"
also accepts $*WIDTH$
 ex 3 columns varying width title = "$*64$Col1$*128$Col2$Col3
printcell_enable(gui_synclist, enable)
 sets the printcell function enabled

After setting the columns and enabling the printcell function
 items can be added to the list like normal
 column items are supplied delimited by '$'
 ex item = "Item1$item2$item3"
 they will be placed in cells defined by set_columns and scroll if the cell is too small

--Fixed for 1 bit & 2 bit displays

Change-Id: I49bd7903005d7a54e93af4379b0cdea63c860656
2022-01-01 23:56:51 -05:00
Christian Soffke
edc68b0657 Solitaire: Fix Quit option with no saved games
Selecting "Quit" would start the game
instead of quitting if no games had
previously been saved.

Change-Id: I4874288cc1087697dfb593a371e25da473870c8e
2022-01-01 22:01:30 -05:00
Christian Soffke
14a5355278 Manual: fix FS#12603
"root menu order" item missing from "Config file options" chapter

Change-Id: If6a9adeee3734db73dbf56fa84ade0ee6df4ef9d
2022-01-01 22:01:11 -05:00
Christian Soffke
abfee36ce0 PictureFlow: enable theme in settings menus
Submenus for adjusting settings
were previously left unthemed

Change-Id: I073c7aabfdd9ce4e4c10c4c0dc689112c29b2a58
2022-01-01 22:00:09 -05:00
Aidan MacDonald
025f780685 Update .gitignore for rbutil/ -> utils/ merge
Change-Id: I79326019a2e4c82357de6ffe17e938a882009f53
2021-12-29 00:43:27 +00:00
Dominik Riebeling
bbd1056afb themeeditor: Fix dmg deploy steps.
- Fix binary name in Info.plist.
- Run dmgbuild as Python module, in some cases it isn't available directly.
- Add missing dmgbuild configuration for themeeditor.

Change-Id: I2db50959b88283f43e2203cf71b130cdb33103dd
2021-12-28 19:53:54 +01:00
Dominik Riebeling
3d983ad3a1 themeeditor: Create MacOS AppBundle / Win32 GUI application.
cmake needs to know about this, otherwise we'll only get an executable.

Change-Id: If40a2a5d021ca49df4afe6bb5bce538d2b466426
2021-12-28 18:34:08 +01:00
Dominik Riebeling
875fcc7daf themeeditor: Fix cmake Qt major version.
Use the correct variable.

Change-Id: I5c59664cb86b0e4d3731e7c9ad13a276a1720cbc
2021-12-28 18:16:28 +01:00
Dominik Riebeling
c055b5e933 rbutil: Add data tags to data driven unit tests.
Make tests implemented as data driven tests show a sensible test data
tag value, so test can get identified more easily.

Change-Id: Ifeb42ed11ce9a8efc6491b2c3b9fe31802a67d33
2021-12-28 17:57:04 +01:00
Dominik Riebeling
0c8f539182 rbutil: Auto-discover tests with cmake.
Change-Id: I2f6511ddc306ba1caecaa917667074cf51b61262
2021-12-28 17:57:04 +01:00
Dominik Riebeling
f37a917e9a cmake: Disable QtTest discovery when cross compiling.
Change-Id: I46e2ad16f592f3adc9f01347e9fcda451c0b3a26
2021-12-28 17:57:04 +01:00
Dominik Riebeling
c1ad915055 cmake: Add QtTest test discovery module.
Allow discivery of the QtTest based unit test.
Taken from https://github.com/ocroquette/cmake-qtest-discovery

Change-Id: I79a54568b2dbc216d35a463b6be36c197203c5b5
2021-12-28 17:57:04 +01:00
Dominik Riebeling
f53f1fbafa rbutil: Fix some more issues found by clazy.
Change-Id: I0a1a849ecea4b4666b08ccb050eb17918e90a258
2021-12-28 17:57:04 +01:00
Christian Soffke
7dffbd84af Playlist Viewer: Add Track Info
Adds a command for showing track info to
the Playlist Viewer's context menu, which
brings up the same screen used by the WPS
for currently playing tracks.

Change-Id: I17d99671935934dad565d290a0d6fb3b0dfd8b01
2021-12-28 11:15:57 -05:00
Christian Soffke
e8b9123205 Database: show song's album in PictureFlow
Adds a 'PictureFlow' command to database context
menus for quickly bringing up the album for a
song in PictureFlow.

Change-Id: I88cd89e93d9418558c698a15fc7fb5d9a90fb262
2021-12-28 11:06:10 -05:00
Christian Soffke
7d59bbd170 Database: Fix selection being reset
Consistent with (preferable) behavior of file browser
after selecting an item for playback

Change-Id: I45a72f6d743fd70c301f9d5de0f8a2a02157b2c6
2021-12-28 10:57:13 -05:00
Aidan MacDonald
96cfe329a6 powermgmt: Better time estimation
This method, while far from perfect, is able to make use of
real-time battery usage information and updates frequently
in fine-grained increments. This should make time estimates
a lot more useful than they previously were.

Change-Id: I66c6daba88210f60a27e239fbbcc56869be3b878
2021-12-28 10:47:40 -05:00
Aidan MacDonald
90dd2f84a9 x1000: Correctly limit USB charging current
The way this was done before was wrong - limiting the charge
current is not enough since the device will draw additional
power to run. Use the AXP192's vbus current limit control to
stay compliant with the USB specification.

Change-Id: I91b84e3480a432e49bec53cf2a17e4e3444404a4
2021-12-28 15:20:27 +00:00
Aidan MacDonald
2d89143962 AXP PMU rewrite (again)
I noticed a few mistakes in the old driver code and it was in
need of an overhaul anyway... I decided to scale things back,
simplify the code and remove most of the debug menus, netting
a nice code size savings.

One new feature is an advanced debug menu which is accessible
by recompiling the code with AXP_EXTRA_DEBUG. It adds quite a
bit of code size and isn't useful other than for development
so it must be manually enabled by editing the source.

Change-Id: I30e17c1194c14823decd726a574ed14451d4cb2d
2021-12-28 15:20:27 +00:00
Dominik Riebeling
b774699560 themeeditor: Remove qmake project files.
It is now part of building with cmake.

Change-Id: I6e6317f3070311c7921f93a3ec44eefdd4f55baf
2021-12-28 10:37:50 +01:00
Dominik Riebeling
3e2a7a56c0 rbutil: Remove qmake project files.
To build it configure with cmake from utils/ folder.

Change-Id: I43fab2df1768e1a055e46ec5712e3a45fefef5a9
2021-12-28 10:35:39 +01:00
Dominik Riebeling
1ddc5a202d themeeditor: Convert to cmake.
Change-Id: Ib46842c157121c64cd0091118aa9b7e43d83b8b3
2021-12-27 16:18:17 +01:00
Dominik Riebeling
36cb0d4050 themeeditor: Add svg application icon and desktop file.
Change-Id: I3213e60679330b5312bddd37669da2b18e7f9627
2021-12-27 16:17:30 +01:00
Dominik Riebeling
2ecbc18535 rbutil: cmake: Make linuxdeploy download a global target.
That way we won't get duplicated targets when the deploy function is
used for multiple targets.

Change-Id: Ie14fdd74fcc496647c3c041ae2fcf902a3cb15fa
2021-12-27 16:14:46 +01:00
Dominik Riebeling
67942629cf rbutil: Explicitly enable AppImage qt deploy plugin.
Change-Id: Id2cb21882b06f60541ecfe22b101d13c4f631131
2021-12-27 12:29:52 +01:00
Dominik Riebeling
88a50ab104 rbutil: Change MacOS dmgbuild to use plistlib.
We're not dealing with binary plist files, to biplist is not the one we
want. Also, plistlib is part of Python.

Change-Id: I529516da0d6b04809a7c0d38b20c6f40900560f8
2021-12-26 21:59:19 +01:00
Dominik Riebeling
5999b4f791 rbutil: Fix cmake deploy function paths.
Update scripts paths with the split-up setup.

Change-Id: I62cd66b7440faa27daead92d04f3cdae67748d60
2021-12-26 21:31:49 +01:00
Dominik Riebeling
241d478ce9 rbutil: Replace QRegExp with QRegularExpression.
More updating for Qt6 compatibility.

Change-Id: I2f5bb943acc1f6bdd7bdab0e90e3c0ede596f43a
2021-12-26 20:13:05 +01:00
Dominik Riebeling
1ad4faa334 rbutil: Modernize connect() calls.
Auto fixed by clazy.

Change-Id: Iea16d892fd81c151f0081f7476acc5eda62afc25
2021-12-26 19:50:19 +01:00
Dominik Riebeling
9f3d6e47e7 rbutil: Remove generated header from giversion interface target.
cmake on Windows doesn't like this, and it's not necessary.

Change-Id: I65b9eb989e51df388cabcb36a246068dba80630c
2021-12-26 11:14:22 +01:00
Dominik Riebeling
80c0268c7a rbutil: Make test compile with Qt6.
Change-Id: I2e6520588c7a82482b2c605d0b295f8fc7e0a03b
2021-12-26 11:06:57 +01:00
Dominik Riebeling
35bc4590ae rbutil: Remove ProgressLogger interface class.
Since we're using signals to connect to the Logger we don't need an
interface class, and the only thing still used was the log level enum.
Put those values in a dedicated header instead.

Change-Id: Ic3aee14ba13b81e283b477d11b1c15a5c26ffeab
2021-12-26 11:05:25 +01:00
Dominik Riebeling
01e245417e rbutil: Fix various issues found by clazy.
Change-Id: I91ca2baed34f0f3b561602f95f66bbd4e17e74ab
2021-12-25 19:59:57 +01:00
Dominik Riebeling
0768705545 rbutil: Fix invalid access on error in test.
Change-Id: Ie9c65041bb4a1ba4215a2d0786bf984cfa6d023b
2021-12-25 17:47:14 +01:00
Dominik Riebeling
c753d31549 rbutil: Remove unused variable from test.
Change-Id: Iea57ffa319f50df8836c0c7c608ff37a394eb68d
2021-12-25 17:47:14 +01:00
Dominik Riebeling
6ff75b475c rbutil: Modernize connect() calls.
Auto fixed by clazy.

Change-Id: Ib7cce8c0a85f8f915263980bf5d2508a4b19bbe3
2021-12-25 17:47:14 +01:00
Dominik Riebeling
dce2ccdd96 rbutil: Remove unused mspack source to fix warning.
We don't need this file, and the implementations are stubs, causing a
compile warning. Remove it from the build.

Change-Id: I4ee2594c8fbc3ecf4661cc4144f8d9072bd6d983
2021-12-25 17:47:14 +01:00
Dominik Riebeling
afe0e18113 mkamsboot: Fix a warning.
Change-Id: Ie16176226bf23a19e51abd6e9ae94244701872db
2021-12-25 17:47:14 +01:00
Dominik Riebeling
eb8dc75d38 rbutil: Create git version information at build time.
Change-Id: Iaf701f4d64d6852423f6a28a753b27abc43477e2
2021-12-25 17:47:14 +01:00
Dominik Riebeling
6783b2c8a7 rbspeex: Fix unused variable warning.
Change-Id: I24a0a9c28101f0d7f17d9e8e4a778f9566ba4701
2021-12-25 17:47:14 +01:00
Dominik Riebeling
e9ef7f0dd3 rbutil: Split out rbutilqt parts into separate cmake list.
Change-Id: I84ada20765b98620e1f06bc7116bbdaaae296fe9
2021-12-25 17:47:14 +01:00
Dominik Riebeling
c979717b80 rbutil: Fix logger segfault on application exit.
Getting the values from a QMultiMap() returns a list, but not the same
on consecutive calls. Thus calling it twice to get the iterators will
yield different lists, causing the iterator to fail.

Fixes a segfault when destructing the logger.

Change-Id: Ie8ea8d3a9acf6fbd3969fbb49cbc50a1c1fa2854
2021-12-25 17:47:14 +01:00
Dominik Riebeling
774b35cccf rbutil: Deploy support in cmake.
Add a "deploy" target that will create a distributable file.

- Linux: AppImage.
- Windows: zip file.
- MacOS: dmg.

Change-Id: Id8ae9c021bc5bbb1abf066205b57d943c3f3b327
2021-12-25 17:47:14 +01:00
Dominik Riebeling
4eb3f05042 rbutil: Increase test timeout value for HttpGet tests.
The test timeout is used to abort the tests if something goes wrong and
should not occur during normal test run. On some systems the current
value is too small, causing a timeout and thus test failure before
HttpGet responds.  Increasing the timeout fixes this.

Change-Id: Ib61dd97d9f866c03cca9d2f0d7cb151f7076410d
2021-12-25 17:47:14 +01:00
Dominik Riebeling
f2798c225a rbutil: Simplify reading rockbox-info.txt.
Simplify, and replace use of QRegExp with QRegularExpression for Qt6
compatibility.

Also fix the test running on Windows. RockboxInfo constructs the
filename from path and filename, so we cannot pass an empty path, since
that results in an invalid path. On Linux / MacOS this works only
because we use an absolute path.

Change-Id: Ieaf30a2df005291d3e997aabf42d64ee832381c2
2021-12-25 17:47:14 +01:00
Dominik Riebeling
dc677208d0 rbutil: Fix unit tests on Windows.
Change-Id: I124882eb26b01e1acfadfba55bc718ab330ab52a
2021-12-25 17:47:14 +01:00