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.
add a div with the loading's animation. When the contentManager sends the
remote library's update's request, it emits a "true" displayLoadIcon signal
that remove the class "do-not-display" and it emits a "false" displayLoadIcon
signal when it has to display the local library.
Foreach "summary" element that represents a book, Vue.js binds its id with
the book's id.
When a "contextmenu" event (right-click) is emitted, it saves the mouse's
coordinates to set the contextmenu's position and display it if the cursor
is on a book.
The "displayMenu(book)" function displays the contextmenu if the "book"
parameter isn't null. It handles which options to show too (for now there is
the "delete" option only).
The delete option calls "eraseBook(book)" that uses
"getBookFromMousePosition()" to know which book has to be deleted.
"getBookFromMousePosition(info)" gets all elements at the mouse's
position, selects a "summary" element which has the "book-summary" class if
there is one, to get the book requested thanks to the id bind by Vue.js and
return it.
add a column at the book's list's table with "delete" button. This ui
is temporary.
On click, this button sends the id of the selected book at the
ContentManager class which gets book by this id, and erases all files
in relationship with this book on the computer.
When there is a lot of book it can take some time to display all books.
Even more, when displaying ALL books, I face the kiwix-desktop freezing.
So let's display only 20 books and if the user scroll to the end of
the displayed books, display 20 more books.
The limits is made at rendering, this allow us to not change all the
logic behind (request, filtering, ...)
When doing a search in the library, we know for sure that the result will
be a subset of the library we have (without query). So we can do the
search locally (through the books we already have in cache) instead of
doing another request.
The pagination was added as a workaround to a too slow display of
the content.
Now that with commit 4cbf001 we are displaying the icons async, the
pagination is no more usefull.
The update of book info are made somehow sync. (They are async, but
somehow, the view update hangout).
Getting the favicon content is pretty long and it seems that the view
(and getting remote content) take a long time.
By using a real url, QWebViewEngine handle everything nicely and it speed
up everything.
Move all methods used by contentManager html into the contentManager class.
We do not export anymore the kiwixapp, the library or the downloader.
As the downloader was use only to export the methods to html, we can
remove it (and use kiwix::Downloader).