Before deleting a book, check all the tabs opened (except the first wich is
the home tab and the last wich is the "new tab" button) and close those who
have the same id of the book.
Split the tags into a stringlist to remove tags that start with "_" and then
join them into one string with a space as separator.
Remove the replacement of the commoda points by spaces from the js file
because we do not need it anymore.
add an event listener on the mouse click event, if it's the middle button
(the scroll wheel click) it closes the tab on which the cursor is.
In the closeTab() method, add a security to prevent closing the "new tab
button" tab.
Use a new api of listBooksIds
Click on a column header sets the "activeSort" variable with the sort's type
and the "sortOrderAsc" to true or false according to ascending or descending
sort. These variables are used to set css classes and to set the m_sortBy
ContentManager's member and m_sortOrderAsc ContentManager's member which are
used to get the books id's list sorted.
Display the "local kiwix server" option in the menu
This option opens a Qdialog that have options to control the server (run, open
in browser, stop).
The KiwixServe::run() method use execvp to run the kiwix-serve binary.
add a new tab with a button inside at the start of the app. When this button
is pressed, it inserts a new tab just before this tab.
To avoid that this tab/button can be selected when a tab is closed, the
SelectionBehaviorOnRemove is set to select the left tab if it's the most
right before the tab/button and the right if not
These changes allow many improvements :
- they fix the infinite refresh of the library due to the multiple
"bookChanged" signal emitted when several operations on books were
performed simultaneously (launch several downloads)
- the scroll isn't reset to the top of the list when starting a download at
the bottom of the list
- (better optimization ?)
Now methods that concern only one book emit the signal "oneBookChanged"
with the id of the book, the JS slot search by id the correspondent book in
its list and replace it with an updated one.
Qt seems to disconnect every signal handlers (signal emitted by QCompleter)
of QLineEdit (the SearchBar) every time the QLineEdit loses the focus,
so it has to be connected every time it gains the focus with the mouse.
To align vertically the flexboxes of the same column when the window is too
small, set the flexbox property "overflow" to "hidden" allows all these flexboxes
to have the same width no matter what its content
When the download of a book finishes while the cancel's dialog is opened
and then that the user confirms the deletion of the book, the app crashes
because aria2 can't find the active download (which is already complete).
Pause the download before opening the dialog and check the download's status
before cancel it avoid this crash.