Commit Graph

5 Commits

Author SHA1 Message Date
jordi fita mas 87f51e733e Focus on the alert text when there is an error
This is to tell screen readers that have to read the text in the
notification, or the notification pops up and orca, at least, does not
know that it needs to read it.

I also had to change the role of SelectableLabel’s TextArea to
StaticText or orca would only read the first line. Not sure if that is
an error, because TextArea does indeed behave like a StaticText (i.e., a
label) in this case, but TextArea has Accessible.multiLine set to true.
2024-12-30 10:31:14 +01:00
jordi fita mas f77d01134b Include “alert” in the text of ErrorNotification’s close button
Otherwise screen readers just say “close”, and it is more difficult to
know what this button is going to close.
2024-12-30 10:26:50 +01:00
jordi fita mas 45c12ed2bb Stop ErrorNotification’s time on close
Otherwise, if there is another notification before the timer runs out,
it will close the new notification sooner than expected.
2024-12-22 04:20:04 +01:00
jordi fita mas 4766d01ead Add ComponentBehavior QML pragma 2024-12-19 01:05:12 +01:00
jordi fita mas 07705b012a Add a very ugly login page to test database connection
I want to perform all SQL queries in a thread, to avoid freezing the UI,
that sometimes might happen when there is a lot of data to fetch; should
not happen very often, though.

Neither libpq nor Qt SQL allow queries on the same connection from
differents threads, and, in Qt SQL, all queries must be performed from
the same thread where the connection was established.  In Qt5 i had to
either create a connection per thread, or use a QThread-derived object
to hold the connection and use signals and slots to pass query and
response data between the UI and database threads; it was usable but not
pretty.

With Qt6 and Concurrent’s QThreadPool now i can use QFutures instead,
that are not as cumbersome as with Qt5, because i no longer need
QFutureWatcher.  I still have the problem that all queries must be done
from within the same thread, and QThreadPool uses an arbitrary thread.
The solution is to create a “pool” with a single, non-expirable thread,
and call all Concurrent::run onto that pool.

I have to test it properly, and first need to open the database to test
whether that, at least, works. I added a simple “login page” for that,
and to make a first attempt to error messages; i use a control that is
like Kirigami’s InlineMessage for now, but i am not sure.

I also do not know how i will configure database’s connection details. I
usually make use of pg_service.conf, because then the application only
need to know its service name, but i am not sure whether other people
would find it as comfortable as i do.
2024-12-16 12:59:19 +01:00