New field "download path" in the settings page.
To start a download it now uses the download path stored in the settings. Use the new api
of https://github.com/kiwix/kiwix-lib/pull/310 to work.
Display an error messsage if Download* Downloader::startDownload(const std::string& uri)
fails because aria2 doesn't succeed to start the download.
Display an error message if a download get the "error status".
The SettingsManager class has a new member m_zoomFactor with a getter and
a setter. Its value is set at launch and saved with the QSettings.
There is a new field in the settings page where the zoom factor can be
changed, it is multiplied by 100 to be displayed as a percentage.
Each time a file is opened, the zoomfactor of the view is set with the
member m_zoomFactor of the SettingsManager class.
Add an input in the settings page which allows the user to change the Kiwix
server port.
The SettingsManager sets the value(s) of the settings in the setSettings()
method at the start of the app. This method for now sets a default value
but it will use a config file later too.
The setKiwixServerPort() method is called when the user indicates a valid
port. It sets the m_kiwixServerPort member and emit the portChanged() signal
which is connected in the LocalKiwixServer class to update the m_port member.
The server port is now always set before its launch in the runOrStopServer method.
The LocalKiwixServer::openInBrowser() now uses the mp_server->getPort() to
always use the right port. In fact if the user changes the port in the
settings while the server is running the m_port member doesn't match anymore
the port used by the running server so the openInBrowser will use a wrong port.
The KiwixApp class uses now the SettingsManager::getKiwixServerPort() method
to set the port of the kiwix-server
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.
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.
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.