1434 Commits

Author SHA1 Message Date
Kelson
f383bea78c
Merge pull request #1187 from kiwix/Issue#594-search-bar-text-align
Fix Search Bar Cursor Alignment in RTL
2024-09-10 09:28:37 +00:00
ShaopengLin
3906888801 Fix SearchBar Placeholder Alignment in RTL
Align placeholder at leading position in line edit
2024-09-10 09:27:40 +00:00
ShaopengLin
05fcff0834 Fix SearchBar Cursor Alignment in RTL
The cursor was misaligned to the left in RTL.
2024-09-10 09:27:40 +00:00
Kelson
e47d224469
Merge pull request #1177 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2024-09-09 20:20:12 +00:00
translatewiki.net
3400c90186 Localisation updates from https://translatewiki.net. 2024-09-09 20:05:51 +00:00
Kelson
8e6d4eef96
Merge pull request #1202 from kiwix/update-package-ci-cd
Update CI/CD for deb packages
2024-09-09 19:59:19 +00:00
Emmanuel Engelhart
586a2108ab
Update CI/CD for deb packages 2024-09-09 21:50:54 +02:00
Kelson
a69db03aff
Merge pull request #1164 from kiwix/smarter_directory_monitoring
Smarter directory monitoring
2024-09-07 07:37:57 +00:00
Veloman Yunkan
c3a4164541 Debouncing of file updates in monitored dir
Now updates to ZIM files that failed to be added to the library upon
their appearance in a monitored dir are not handled immediately. Instead
they are debounced (deferred/delayed by 1 second) and processed only
after the file has been observed to be stable for some time (1 second as
of this commit).
2024-09-07 07:37:21 +00:00
Veloman Yunkan
fdac248492 Directory monitoring ignores unchanged bad ZIMs
When a change to a monitored directory is detected, any bad ZIM files
in it (that could not be added to the library during the previous
update) are ignored unless their modification timestamp has changed.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
3dd58b3ae4 Fixed indentation 2024-09-07 07:37:21 +00:00
Veloman Yunkan
b7d9b5d855 Enter ContentManager::getMonitoredZimFileInfo()
At this point, the new function is just a stub.

Indentation is not fixed intentionally (in order to minimize the diff).
2024-09-07 07:37:21 +00:00
Veloman Yunkan
9548c9b778 Directory monitoring tracks invalid ZIM files too
A ZIM file that failed to be added to the library isn't just
discarded by directory monitoring but is added to the set of known
ZIM files with a proper status. This enables to process updates to
such files more efficiently (coming next).
2024-09-07 07:37:21 +00:00
Veloman Yunkan
bc05c75448 Added state to the tracked monitored files
Semantically, nothing changes at this point but the possibility for
an enhancement is now open.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
076c19b645 Introduced ContentManager::getLibraryZims()
It is going to slightly evolve as the type of m_knownZimsInDir is
enhanced to keep track of file modification times.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
72bd099cd1 fixup! Enter MonitoredZimFileInfo::ZimFileStatus 2024-09-07 07:37:21 +00:00
Veloman Yunkan
a43c53bf3d Enter MonitoredZimFileInfo::ZimFileStatus
At this point the new enum serves mainly for separating logging
from the logic. But it enables to enhance the logic with more
elaborate handling.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
dee1365327 Minor cleanup 2024-09-07 07:37:21 +00:00
Veloman Yunkan
43fde1640c Fixed indentation 2024-09-07 07:37:21 +00:00
Veloman Yunkan
2df3e2db0b ContentManager::handleZimFileInMonitoredDir()
Indentation is intentionally not fixed (to keep the diff minimal).
2024-09-07 07:37:21 +00:00
Veloman Yunkan
26b4430199 Made ContentManager::asyncUpdateLibraryFromDir() private 2024-09-07 07:37:21 +00:00
Veloman Yunkan
258ed4b913 Clearing of ContentManager::m_knownZimsInDir 2024-09-07 07:37:21 +00:00
Veloman Yunkan
2cd272cd4f Got rid of ContentManager::setMonitorDirZims() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
595d77b832 Moved ContentManager::setMonitoredDirectories() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
b33fc63c93 Fully transferred directory monitoring to ContentManager
ContentManager::setMonitoredDirectories() stays in kiwixapp.cpp to make
the diff easier to understand.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
615c21db50 KiwixApp::setMonitoredDirectories()
Extracted a new function that will next be transferred to ContentManager
along with KiwixApp::m_watcher.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
5f4fcd550c Changed how the list of known ZIM files is updated
Directory monitoring updates the list of known ZIM
files as entries are being added to or removed from the library.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
354a4d1f8a Directory monitoring works via file names instead of paths
- ContentManager::m_knownZimFiles[dirPath] now stores filenames (rather
  than full paths) of known ZIM files in directory at dirPath.

- Library::getLibraryZimsFromDir() returns a set of file names (rather
  than paths)

Note that the change of the semantics of ContentManager::m_knownZimFiles
has been carried out via the change in the value of the second argument
of ContentManager::setMonitorDirZims():

1. In KiwixApp::setupDirectoryMonitoring() the latter is fed with the
   output of (the now changed) Library::getLibraryZimsFromDir()

2. In ContentManager::updateLibraryFromDir() all variables representing
   a set of files now contain filenames only (note that
   ContentManager::handleNewZimFiles() returns just a subset of its second
   parameter) and therefore produce a set of filenames.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
743400fa1a Problematic ZIM files keep being monitored
Before this change, once a ZIM file was detected in a monitored
directory it could slip into the known ZIM file list even if it was
a partially downloaded ZIM file that failed to be added to the library.
This happens when another valid/healthy ZIM file is added to the
monitored directory or a known ZIM file is removed from it (the bad
ZIM file is included in the update triggered by the other ZIM file).

Now ZIM files that failed to be added to the library are NOT inserted
in the list of known ZIM files and thus will be reevaluated for every
change in the monitored directory. Thus a file being downloaded by an
external tool will eventually be successfully added to the library
(since updates to the file should trigger an update to the directory due
to the changed modification time of the file).

This however may result in excessive CPU usage in the following
scenario. Suppose that there are a number of partially downloaded files.
Only one of them is being downloaded, while the others are paused. Every
time the next chunk of data is written to that active file, directory
monitoring will try to add *all of* those partial ZIM files.

There are two optimizations against such waste of CPU cycles:

1. Only try to add those files that had their modification
   time changed since the previous attempt.

2. Debounce the updates (react to updates, for example, at most once per
   second).

Those optimizations will come next.
2024-09-07 07:37:21 +00:00
Veloman Yunkan
fc7570a49c Renamed a few vars in ContentManager::updateLibraryFromDir() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
d5d5987fc1 ContentManager::handleNewZimFiles() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
af18f5826c fixup! ContentManager::handleDisappearedZimFiles() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
c912fe9d34 ContentManager::handleDisappearedZimFiles() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
40f00901e1 More debugging info from directory monitoring 2024-09-07 07:37:21 +00:00
Veloman Yunkan
1ea6ffd20a fixup! Introduced DBGOUT() 2024-09-07 07:37:21 +00:00
Veloman Yunkan
b30cbd9c0b Introduced DBGOUT()
Converted commented out debugging statements to calls of the new
DBGOUT() macro.
2024-09-07 07:37:21 +00:00
Kelson
6fee1ebabc
Merge pull request #1191 from kiwix/Issue#972-category-translation-porting
Remove old version category session data on startup
2024-09-03 11:21:08 +00:00
ShaopengLin
e2ca5d63c2 Remove old version category session data on startup
Saved category pairs seperated by '|' is from old version
2024-09-03 11:20:51 +00:00
Kelson
84b72e5aff
Merge pull request #1192 from kiwix/require-libkiwix-14
Requires libkiwix14+
2024-09-02 09:32:51 +00:00
Emmanuel Engelhart
67ba3d059d
Requires libkiwix14+ 2024-09-01 16:07:09 +02:00
Kelson
2af64e2c4f
Merge pull request #1188 from kiwix/issue1148
Pre-download check for largest supported file size
2024-08-30 11:58:24 +00:00
Veloman Yunkan
49c668d57c Pre-download check for largest supported file size 2024-08-30 11:51:16 +00:00
Kelson
1eb926cfd2
Merge pull request #1175 from kiwix/Issue#972-translate-categories
Implemented Category Translation
2024-08-30 11:47:48 +00:00
ShaopengLin
5f1feebf54 Removed Category i18n 2024-08-30 11:32:57 +00:00
ShaopengLin
cb701b8f86 Add Category Translation
Translations come from libkiwix
2024-08-30 11:32:57 +00:00
ShaopengLin
ebe3112e6a Session stores Category Keys
Storing filter pairs is redundant.
2024-08-30 11:32:57 +00:00
ShaopengLin
617609eee4 Make public KiwixChoiceBox typedef
Public interfaces uses this typedef.
2024-08-30 11:32:57 +00:00
ShaopengLin
f973041ac8 Fix Inconsistent ChoiceBox parsing
setSelection parses two SelectionList differently
2024-08-30 11:32:57 +00:00
Kelson
0c7b60c80c
Merge pull request #1134 from kiwix/Issue#77-implement-save-page
Implemented Save  Page
2024-08-30 11:02:47 +00:00
ShaopengLin
7fcd6b5256 Added Save Page to context menu 2024-08-30 10:41:24 +00:00