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.
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.
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.
Check the available storage before the start of a download thanks to
QStorageInfo::bytesAvailable(), if the book size is bigger than this value
an alert message appears.
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.
flatpack doesn't export files that aren't prefixed like the app (org.kiwix.desktop)
so it has to be renamed and to be precised in the mimetype.xml file because it doesn't matched to the mimetype's name anymore
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, ...)
The current list of available language is a fixed list.
It is generated by the union of languages we have (on library.kiwix.org)
and languages Qt know of. So some languages for which we have content
are not available.
For now, the filtering is made only for remote catalog.
This probably have to be changed, but for now it is better to
display all the content the user has.
It would be nice to be able to style it using css (QTabBar::tab:first)
but I can't figure how :/
We need to :
- hardcore the size of the tabs using `tabSizeHint`.
- "deactivate" the tab button with `setTabButton`
- set the size of the icons.
Fix#73
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.