On some distros (Fedora 37), on the very 1st launch of the GUI, it
crashed with the error:
"object of type QCommonStyle has been deleted"
The only way I've found of getting rid of this error is by obtaining this
object on every paint() call.
In 5b5e2714ae we added support for
in-memory cached DB, to allow delete old events from memory (#844).
Unfortunately, on some systems this URI (file::memory:?cache=shared)
creates a file on disk on user's home.
This file is in the end a DB, so if users want to delete old events,
they'll have to save events to disk.
On the other hand, when in-memory DB is selected, we now disable the
option to delete old events from memory.
Closes#857
Due to how QsqlDatabase works from different threads, a connection to
the DB can only be used from the thread that created it.
In order to access a database from different threads you create a new
QsqlDatabase connection to the DB specifying the DB name/file.
With DBs written to the disk, the database file/name is always the
same (say /tmp/file.db).
But with in-memory databases, whenever you create a new connection with
:memory:, it always create a new in-memory DB, so the DB is empty for
the Cleaner() task, and that's why it was not deleting old events.
Closes#844
Added option to create rules from events, filling up the fields of the
new rule with the properties of a connection.
By default the rules' fields are not enabled.
Closes: #843
Added more options for auto excluding/deleting temporary rules.
If the GUI was configured to store events to disk, you could end up
having thousands of temporary rules over time.
Closes: #622
Added ability to perform actions on different parts of the GUI, based on
conditions defined in json files.
There's only one Action of type Highlight for now, to colorize cells and
rows.
There're 3 Highlight actions defined by default:
- rules: applied to the rules view to colorize the columns Enabled and
Action.
- firewall: applied to the fw rules to colorize the columns Action and
Enabled.
- common: applied to the rest of the views to colorize the column
Action.
Users can add new actions to the directory
~/.config/opensnitch/actions/, as .json files. The format is defined
below.
Example of a Highlight action to colorize cells and rows, based on
different texts (simple texts/strings for now):
{
"name": "commonDelegateConfig",
"actions": {
"highlight": {
"cells": [
{
"text": ["allow", "✓ online"],
"cols": [1, 2, 3],
"color": "green",
"bgcolor": "",
"alignment": ["center"]
}
],
"rows": [
{
"text": ["block-domains"],
"cols": [8],
"color": "white",
"bgcolor": "darkMagenta",
"alignment": []
}
]
}
}
Closes: #555
- Fixed crash on Wayland (Fedora 37) when setting the minimum and
maximum size of a pop-up. setMinimumSize() makes crash the GUI.
- With the above fix, we don't need to set QT_QPA_PLATFORM
(Closes: #794)