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`.
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.
The side bar has some constraints :
- If the contentManager is displayed, we cannot change or hide the side
bar.
- The readingList button must follow the currentside bar, not its
internal status (checked/unchecked).
The real zimId is `xxxx` (stored in the zim itself), not `xxxx.zim` (we
use as host url).
Store the host as an id means that we always need to convert from `xxxx` to
`xxxx.zim` (and the contrary). It is prone to mistake when we forget to
convert to the correct format.
We must use `xxxx.zim` only in the url as is it use to identify what is
asked in the urlschemehandler. Everywhere else, we only need the real
zimId.
In case of rapid input in the contentManager's search entry, the
search request will be launch rapidly. As the view is updated async, the
`getBookInfos` may be used to get information on a book not in the
library anymore. We must handle this to avoid crashing.
Fix#65