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.
The buffers, where reply of a request is send, were deleted when they were about
to close but it makes the app crash, they have to be deleted when the request
object is deleted
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.
Using Curl fct of the kiwix library is synchrone, so when the server accepts
the request but doesn't answer, the kiwix-desktop app is unresponsive.
To avoid that, this is a new architecture based on the Qt network request
management.
There is a new member in the contentmanager based on the new class
OpdsRequestManagerManager. It has two members : m_networkManager sends the
request and return a pointer stored in mp_reply which will receive the answer
of the request.
When the remote library has to be update, it calls
the doUpdate method. It checks if there already is a running request and
aborts it if yes. Then m_networkManager sends the
request and return a pointer stored in mp_reply which will receive the answer
of the request. The signal 'finished' of the mp_reply is connected to the slot
receiveContent. In this slot it checks if the signal 'finished' was emit
because of an abort, if not it reads and emit a signal bookChanged with the
content in parameter. This signal in connected in the ContentManager class
to the slot 'updateRemoteLibrary' which update the remote library member.
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.
It appears that setting `INCLUDEPATH` in qmake break things.
Because qmake add the include path using `-isystem`.
We don't need to extract include path and define from PKGCONFIG_CFLAGS.
Updating `CFLAGS` and `CXXFLAGS` is enough. No need for complex things.
Fix#90Fixkiwix/kiwix-build#260
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 a new file is downloaded, it extracts tags from xml to set m_book's taglist
rm useless 'emit(booksChanged())'
'emit(filterParamsChanged())' calls 'updateLibrary()' that calls 'emit(booksChanged())'
We need to remove the child widget from the stackWidget before we remove
the tab. Else the onCurrentChanged will try to get the widget of the new
tab and if the tab and the stack are not in sync, we may get the wrong
widget.
As `closeTab` remove the widget from the stack we don't need to remove
it again in listen of `CloseTabAction`.