1344 Commits

Author SHA1 Message Date
ShaopengLin
df6560c1a3 Fixed Tab Title Alignment 2024-08-07 15:54:22 -04:00
ShaopengLin
585d29d2aa Fixed missing/inconsistent Tab Border 2024-08-07 12:29:20 -04:00
ShaopengLin
7de1ec98df Fixed Bookmark Button padding
Aligns left/right padding with top/bottom in LTR/RTL
2024-08-07 12:24:16 -04:00
ShaopengLin
848618e5d3 Tab Title Align Incorrectly in RTL Layout
Alignment depends on application layout.
2024-08-07 12:22:02 -04:00
Kelson
f53d7adb1d
Merge pull request #1162 from kiwix/Issue#1145-library-spinner
Aligned Library Download Spinner
2024-07-30 07:27:45 +02:00
ShaopengLin
9d3b0f9613 Aligned Library Download Spinner
Shited drawing to match Download Button
2024-07-28 17:47:16 -04:00
Kelson
319f9e5d6a
Merge pull request #1132 from kiwix/Issue#1073-file-not-found-page
Added Custom File-Not-Found page for Tabs
2024-07-28 22:37:26 +02:00
ShaopengLin
34a4a9ce48 Directory monitoring does not removes zims opened 2024-07-28 15:41:30 -04:00
ShaopengLin
17702f887b File-not-found tab now displays zim name and path 2024-07-28 15:41:04 -04:00
ShaopengLin
368fafb6bc Added custom file-not-found page
Page is displayed when zim file is missing.
2024-07-28 15:38:53 -04:00
Kelson
6ff18a8b0d
Merge pull request #1149 from kiwix/directory_monitoring_improvements
Directory monitoring improvements
2024-07-28 12:45:38 +02:00
Veloman Yunkan
deb91e71fb Enter ContentManager::handleDisappearedZimFile() 2024-07-28 12:31:36 +02:00
Veloman Yunkan
f830d35902 Directory monitoring saves changes in library.xml 2024-07-28 12:31:36 +02:00
Veloman Yunkan
d0f7599cf6 Better handling of renamed files in monitored directory
When a file in the monitored directory is renamed, it is better to
remove the old file from the library before adding the new one.
Doing it the other way around will not work correctly - adding the new file
will fail since a book with that UUID is already present in the library,
and then that book will be removed!
2024-07-28 12:31:36 +02:00
Veloman Yunkan
58e8f71dda Moved directory monitoring to ContentManager 2024-07-28 12:31:36 +02:00
Veloman Yunkan
52583ad6a9 Preparing to move directory monitoring to ContentManager
Moved 3 member functions of Library related to directory from
library.cpp to contentmanager.cpp as is so that the changes made to them
when those functions are transferred to ContentManager are easier to
spot.
2024-07-28 12:31:36 +02:00
Veloman Yunkan
f38b7480f6 Library::updateFromDir() emits booksChanged() signal once per call
The purpose of LibraryManipulator defined in library.cpp was to emit the
booksChanged() signal for every book added to the library. In
Library::updateFromDir() we can do that once per call of that function.
2024-07-28 12:31:36 +02:00
Veloman Yunkan
1e8a181d1a Further cleanup of Library::updateFromDir() 2024-07-28 12:31:36 +02:00
Veloman Yunkan
ce40f5eff6 Even simpler Library::updateFromDir() 2024-07-28 12:31:36 +02:00
Veloman Yunkan
8b2e6d23dd Better return type of Library::getLibraryZimsFromDir()
... which results in slightly simpler Library::updateFromDir().
2024-07-28 12:31:36 +02:00
Veloman Yunkan
7581b34f7b Rewrote KiwixApp::setMonitorDir() via setupDirectoryMonitoring()
Superficially there are some subtle difference between
KiwixApp::setupDirectoryMonitoring() and the part of the
KiwixApp::setMonitorDir() that was replaced by the former. But the end
result of this change should be the same.
2024-07-28 12:31:36 +02:00
Veloman Yunkan
ccacdc0a5c Extracted KiwixApp::setupDirectoryMonitoring() 2024-07-28 12:31:36 +02:00
Kelson
149752dfed
Merge pull request #1155 from kiwix/feature/app-icon-distortion
Make app icon correctly scalable on Windows
2024-07-27 21:03:47 +02:00
sgourdas
ca3f730963 Make app_icon.ico correctly scalable 2024-07-27 21:57:25 +03:00
Kelson
3a7c9c5d0d
Merge pull request #1138 from kiwix/feature/home-button
Added home button
2024-07-23 15:37:29 +02:00
sgourdas
76bb8228ee openHomePage code to standalone function 2024-07-23 15:37:14 +02:00
sgourdas
a7c19105f9 random.svg style alignment 2024-07-23 15:37:14 +02:00
sgourdas
c959fd0ccf Home button toolbar addition 2024-07-23 15:37:14 +02:00
sgourdas
1969fac0a4 code cleanup with auxiliary local variables 2024-07-23 15:37:14 +02:00
Kelson
68a7f4be8b
Merge pull request #1139 from kiwix/feature/monitor-dir-copy
Settings monitor path QOL improvements
2024-07-19 13:15:33 +02:00
sgourdas
84874cddc6 code tidying 2024-07-19 13:15:00 +02:00
sgourdas
1f7795112b Monitor path setting QOL improvements 2024-07-19 13:15:00 +02:00
Kelson
3ee2537baf
Merge pull request #1118 from kiwix/robust_download_management
Asynchronous execution of download actions
2024-07-19 11:33:52 +02:00
Veloman Yunkan
2a1d53f0b0 Safer ContentManager::downloadDisappeared() 2024-07-19 07:12:43 +02:00
Veloman Yunkan
8e4e394f99 Encapsulated kiwix::Downloader in DownloadManager 2024-07-19 07:12:43 +02:00
Veloman Yunkan
373b0140a2 Taking advantage of kiwix/libkiwix#1097 2024-07-19 07:12:43 +02:00
Veloman Yunkan
b5b089f9a6 2-stage asynchronous starting of a download 2024-07-19 07:12:43 +02:00
Veloman Yunkan
07d8aff798 Enter DownloadManager::error() signal
Preparing to handle errors originating in the (future) asynchronous
execution of `ContentManager::startDownload()`.
2024-07-19 07:12:43 +02:00
Veloman Yunkan
426f13a915 Extracted ContentManager::startDownload()
Extracted from ContentManager::downloadBook() the part that should be
executed asynchronously into a new function
`ContentManager::startDownload()`.
2024-07-19 07:12:43 +02:00
Veloman Yunkan
e00f023599 DownloadManager::checkThatBookCanBeDownloaded()
Separated checks that can be performed early (independent of aria2c
services). When the download initiation is converted to a 2-stage
procedure (similar to how it was done for pausing/resuming/cancelling
a download) those checks better be performed synchronously in the main
thread.
2024-07-19 07:12:43 +02:00
Veloman Yunkan
b753a47fbc Got rid of a ContentManager::downloadBook() overload 2024-07-19 07:12:43 +02:00
Veloman Yunkan
d0a8f2519b 2-stage asynchronous cancelling of downloads 2024-07-19 07:12:43 +02:00
Veloman Yunkan
262428e637 Slow download updates don't erase pending actions
... provided that download actions are inserted into the queue *before* existing
update requests.
2024-07-19 07:12:43 +02:00
Veloman Yunkan
3c04e055bf Download user actions have priority over updates 2024-07-19 07:12:43 +02:00
Veloman Yunkan
462fe8e9b4 Fixed indentation
During the previous commit indentation of some lines was preserved
in order to minimize the diff. Now it is fixed.
2024-07-19 07:12:43 +02:00
Veloman Yunkan
0235d0bafa 2-stage pausing/resuming of downloads
Pausing a download now changes its state to PAUSE_REQUESTED and the
pause request is enqueued for asynchronous execution. Similarly,
resuming a download changes its state to RESUME_REQUESTED and the resume
request is enqueued for asynchronous execution.

In the PAUSE_REQUESTED and RESUME_REQUESTED states download actions
are disabled.

Known issues:
 - The PAUSE_REQUESTED state may be incorrectly restored to DOWNLOADING
   if at the time of pausing an earlier UPDATE request for the same
   download preceded it in the queue or was being executed. After
   the response to the said UPDATE request is received it results
   in the DownloadState being reset to the previous state. But after
   the pause request is processed a subsequent UPDATE request will
   change the state to PAUSED. In GUI this looks as follows (assuming
   slow responses from aria2c, allowing to observe the events in slow
   motion):

   1. Pause button is pressed
   2. Pause button and download progress info (the textual one) disappear
   3. Pause button and download progress info (the textual one) re-appear
   4. Download switches to paused state without any further user actions

   A similar problem exists for resuming the download.

   The solution is to convert the request queue to a priority queue
   where download actions are given precedence over update actions.
   However this will not eliminate the problem completely since a
   pause/resume action may be issued while an update request is being
   processed by aria2c (the likelyhood of which greatly increases if
   aria is mostly stuck struggling with slow storage). The latter
   case will be addressed by tracking the timestamps of the requests
   and ignoring the download status from those update requests that
   were issued before the user action requests.
2024-07-19 07:12:43 +02:00
Veloman Yunkan
ce2fbbf7fc Made DownloadState::status private 2024-07-19 07:12:43 +02:00
Veloman Yunkan
cbdb4b0404 Async execution of download pause/resume actions 2024-07-19 07:12:43 +02:00
Veloman Yunkan
9defd359a6 Download updater thread works via a queue
Made the download updater thread process requests from a queue.

Such a scheme paves the path to performing all download actions
asynchronously by placing them onto the queue (which will eliminate
non-responsiveness of the application when those commands hit the
problem with slow responses from aria2c).
2024-07-19 07:12:43 +02:00
Veloman Yunkan
03c45e814b DownloadManager::updateDownload(bookId) 2024-07-19 07:12:43 +02:00