33 Commits

Author SHA1 Message Date
ShaopengLin
b20749b5ef Adjust SideBar Layout to Zoom Level 2024-11-05 01:52:30 -05:00
ShaopengLin
bb4628a35a Add Tooltip to Elided TOC Items 2024-11-05 01:52:30 -05:00
ShaopengLin
8177906399 Remove Visual Side-Effect of <a> Tags
Retain the original look of the headers
2024-11-05 01:52:30 -05:00
ShaopengLin
19c3601601 Proper TOC Style, Numbering and Indentation 2024-11-05 01:52:30 -05:00
ShaopengLin
b487a144fc Add Hide Button in TOC
Extra button for user to close TOC
2024-11-05 01:52:30 -05:00
ShaopengLin
9d88f88fb1 Enable ToggleTOCAction
Show/Hide TOC with button and shortcut
2024-11-05 01:52:30 -05:00
ShaopengLin
cdd47cf2dd Introduce KiwixWebChannelObject.{h, cpp}
Pass TOC title translation. More to come later
2024-11-05 01:52:30 -05:00
ShaopengLin
b9b16bee3a Parses HTML and inject Table of Content 2024-11-05 01:50:08 -05:00
ShaopengLin
ababd716e4 Reserve Space Left for TOC
Same width as reading list.
2024-11-05 01:50:08 -05:00
ShaopengLin
ef40fca328 Introduce QWebEngine Javascript Infrastructure
Setup for TOC Javascript/CSS Injection
2024-11-05 01:50:08 -05:00
Nikhil Tanwar
8f61b418f9 Replace QWebEngineView with QTreeView for ContentManagerView
We'll be using a QTreeView to display elements of the library.
2023-07-24 13:24:15 +05:30
Emmanuel Engelhart
529f549af1
No need of semi-colon after function declaration 2022-02-13 13:26:54 +01:00
Nikhil Tanwar
8ba4e8ab85 Stored settings view in settings manager
Deleted some helper functions (browseDownloadDir, confirmDownloadDir, resetDownloadDir) from SettingsManager
Deleted unnecessary settingsManager.js and settingsManager.html
Fixed settingsManager.css code factoring issues
2021-10-19 05:09:07 +02:00
luddens
8f1d870553 change download directory setting UX
- remove "apply" button
- kiwixPort and zoomFactor are saved onchange
- download directory has a confirm dialog
2020-07-10 12:11:21 +02:00
luddens
3b300f90e5 translate settingsmanager html page 2020-04-07 15:40:07 +02:00
luddens
fb582627dc translate contentmanager html page 2020-04-07 15:39:48 +02:00
luddens
870dba20b0 add the possibility to set the download path in the settings
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.
2020-03-03 15:27:17 +01:00
luddens
bc481f56fe improve download error management
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".
2019-11-22 16:34:03 +01:00
luddens
0289709771 Add a default zoom field in the settings
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.
2019-11-19 18:31:54 +02:00
luddens
aab3d123a0 kiwix server port can be set
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
2019-11-01 15:59:17 +01:00
luddens
175c46cddf settings page architecture 2019-11-01 15:59:17 +01:00
luddens
2d1087a079 hidden tags aren't display
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.
2019-09-03 15:52:08 +02:00
luddens
ac59676bf7 add books sorting
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.
2019-07-24 16:23:18 +02:00
luddens
2022bb2acb Refresh only one book instead of all the library
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.
2019-06-25 18:52:05 +02:00
luddens
daad089994 Replace the ";" between tags by " " 2019-06-25 10:31:15 +02:00
luddens
044aec9689 Pause book's download while dialog to cancel is open
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.
2019-06-24 14:33:11 +02:00
luddens
b72dc743a7 play/pause/cancel button new design 2019-06-12 14:46:52 +02:00
luddens
6f10585d7f add alert if there is not enough storage to download
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.
2019-06-12 10:02:00 +02:00
luddens
2436248d22 add a confirmation msg before cancelling download 2019-05-28 17:32:20 +02:00
luddens
df4034ee09 add a confirmation message before deleting 2019-05-28 17:32:19 +02:00
luddens
7cfc92c80f add options in context menu 2019-05-13 15:42:32 +02:00
luddens
949d50866c Split ContentManager.html into 3 files (html, css, js) 2019-05-13 13:58:18 +02:00
Matthieu Gautier
a6f8bbd6e5 Add a first version of the contentManager. 2018-10-17 11:00:09 +02:00