Commit graph

5343 commits

Author SHA1 Message Date
Xiao YiFang 235bd8dc57 add translation to save bookmark action 2022-06-02 20:32:31 +08:00
Xiao YiFang 66499007f6 clean code: remove \n in parameter of GD_DPRINTF 2022-06-02 20:11:05 +08:00
Igor Kushnir 99982a1c11 ArticleView: expose only minimal API to JavaScript
https://doc.qt.io/archives/qt-5.5/qtwebkit-bridge.html#internet-security
Qt WebKit Bridge documentation recommends:
  When exposing native objects to an open web environment, it is
  important to understand the security implications. Think whether the
  exposed object enables the web environment access things that
  shouldn't be open, and whether the web content loaded by that web page
  comes from a trusted source.

The author of Qt WebChannel has said the following in a talk that
introduced this Qt module (WebKit Bridge replacement for Qt WebEngine):
  My suggestion here is to write dedicated QObjects with a slim, minimal
  API that only have the signals and methods that you deem safe to be
  used from the outside.
- see a comment under https://redirect.invidious.io/watch?v=KnvnTi6XafA
2022-06-02 13:51:13 +03:00
Xiao YiFang f015ff555f feature: save bookmark to favorite panel
reuse fulltext match to implement this bookmark feature
2022-06-02 08:16:01 +08:00
Xiao YiFang 3262fe4fe4 Merge branch 'goldendict-master' into staged 2022-06-02 07:14:49 +08:00
Xiao YiFang 8f6284747f fix merge upstream conflict 2022-06-02 07:14:38 +08:00
Igor Kushnir aa33b8bebc Disable assert macro checks in Release builds 2022-06-01 18:40:35 +03:00
Xiao YiFang 85e2bcfa43 Merge branch 'goldendict-master' into staged 2022-06-01 23:23:55 +08:00
Xiao YiFang 077d139fb5 fix merge conflict 2022-06-01 23:23:41 +08:00
Igor Kushnir 8acec2e062 Reduce build log verbosity
The default qmake build output is overly verbose. Adding the "silent"
switch to CONFIG makes it much more concise, comparable to default CMake
output. This way warnings and errors are much easier to find.

Adding CONFIG-=silent to the qmake command line doesn't restore the
verbosity because it is applied before the "CONFIG += silent" line in
goldendict.pro. Add a new CONFIG switch "verbose_build_output" to allow
increasing build log verbosity without editing goldendict.pro.
2022-06-01 18:00:45 +03:00
Abs62 f9652487b9 Zim: A little more support for new format features 2022-06-01 17:51:56 +03:00
Xiao YiFang 530591ffbd fix: add unicodeoption to qregularexpression 2022-06-01 21:15:25 +08:00
xiaoyifang 35efa7ac06
Merge branch 'goldendict:master' into staged 2022-06-01 07:24:52 +08:00
xiaoyifang 297aaa2435
Merge pull request #82 from xiaoyifang/feature/add-date
add date to version
2022-06-01 07:22:41 +08:00
Abs62 55122eb739 Zim: Handle new namespace (issue #1502) 2022-05-31 21:08:47 +03:00
Xiao YiFang 5302403d8a add date to version 2022-06-01 00:06:32 +08:00
Xiao YiFang accbfd8f02 Merge branch 'staged' into dev 2022-05-31 00:07:04 +08:00
Xiao YiFang d13390befc add html css 100% 2022-05-31 00:06:21 +08:00
Xiao YiFang 8e65958ee0 Merge branch 'staged' into dev 2022-05-30 20:38:01 +08:00
Xiao YiFang 71b5d3e6ba opt:remove runnable in ftshelper 2022-05-30 20:21:44 +08:00
Xiao YiFang 002a4c8302 add debug info to release version 2022-05-30 20:04:33 +08:00
Xiao YiFang 5bb2fce3c4 fix:clang warning in macos 2022-05-29 16:42:04 +08:00
Xiao YiFang 99876e6680 Merge branch 'staged' into dev 2022-05-29 16:01:13 +08:00
Xiao YiFang 9c1a22d142 rename utils getHostBase(QUrl) to getHostBaseFromUrl 2022-05-29 16:00:30 +08:00
xiaoyifang b02d95e38c Update CHANGES.md 2022-05-29 16:00:29 +08:00
Xiao YiFang 7d43aea9b2 opt: right context menu ,remove non-sense characters
like punctuation and space and symbols
2022-05-29 16:00:29 +08:00
Xiao YiFang 4ac7afc6bf pro: add /permissive- option
in Qt6.3+VS2022 ,the option can supresse the permissive warning.
2022-05-29 16:00:29 +08:00
Xiao YiFang 7910209ae1 clean code: remove dsl runnable ,remove comment endline carriage 2022-05-29 16:00:28 +08:00
Xiao YiFang 7d0523b503 clean code:remove runnable in zim.cc 2022-05-29 16:00:28 +08:00
Xiao YiFang 7ec75d60b9 opt: refact the inspector windows logic 2022-05-29 16:00:28 +08:00
Xiao YiFang ee95307628 fix:remove x11extra private 2022-05-29 16:00:28 +08:00
Xiao YiFang c45b4cc255 fix: invalid gdlookup url should be forbidden. 2022-05-28 10:41:28 +08:00
Xiao YiFang f98ac1b588 clean code:remove useless code 2022-05-27 21:54:30 +08:00
xiaoyifang 83684c2614
Merge pull request #78 from xiaoyifang/staged
routine merge.
2022-05-26 21:40:02 +08:00
Xiao YiFang 96347bef7f opt: print _MSC_FULL_VER instead of incorrect VS version
the _MSC_FULL_VER and VS version has no direct and sound connection.
2022-05-26 21:03:18 +08:00
Xiao YiFang 6bc1e0d219 clean code: remove uiauto.hh wordbyauto.hh(.cc) 2022-05-26 21:02:46 +08:00
xiaoyifang 2bccf038b1
Merge branch 'goldendict:master' into staged 2022-05-26 07:12:25 +08:00
wisherhxl 0cea62699d Linux-specific: workaround of clipboard issue with Ctrl+C+C
Closes #1420, closes #650, closes #858.
2022-05-25 21:01:33 +03:00
Xiao YiFang e241cbef33 fix merge conflict
when merge the changes introduced by pull #77
2022-05-25 23:54:45 +08:00
Igor Kushnir c770e9688e Don't update state prematurely in showTranslationFor()
MainWindow::showTranslationFor() overloads disable the "Pronounce Word"
action, then call ArticleView::showDefinition(). And then immediately
update pronounce availability, Found in Dictionaries list, Back and
Forward buttons. Since ArticleView::showDefinition() loads the requested
page asynchronously, the previous page is still current. Therefore the
"Pronounce Word" action is immediately re-enabled (if the still-current
article has sounds), the other state updates have no effect whatsoever.
Once the new page is loaded, the state is updated again in
MainWindow::pageLoaded() - this time with the desired effect.

So the only effect of the state updates in
MainWindow::showTranslationFor() is to revert the intentional disabling
of the "Pronounce Word" action. Plus waste some CPU time. The
pronunciation-disabling behavior looks better to me and is consistent
with the scan popup's behavior (which immediately hides the
"Pronounce Word" button).
2022-05-25 18:27:18 +03:00
Xiao YiFang 12f7db7414 fix: remove deprecated css 2022-05-25 19:45:19 +08:00
xiaoyifang 4096362183
Merge pull request #76 from xiaoyifang/golden-master
merge upstream changes
2022-05-25 08:02:21 +08:00
Xiao YiFang f1bcb37e76 fix upstream merge conflict 2022-05-25 08:00:58 +08:00
Igor Kushnir 201f11e656 Set current article at most once in loadFinished()
When the current article is set and the user expands or collapses
optional parts (e.g. via the Ctrl+* shortcut),
ArticleView::setCurrentArticle() is called twice from
ArticleView::loadFinished(). Furthermore, the window scroll position is
restored before the second jump. This is wasteful. Move the
higher-priority setCurrentArticle() call up and, if it succeeds, skip
the other call and the scrolling.

I have measured the time spent running the affected code fragment on my
GNU/Linux system before and at this commit. When the loaded articles are
not very large, the performance gain of this commit is only about 1 ms.
However, when one of the displayed articles was huge (the
"United States" English Wikipedia article), the time went from 120 ms to
5 ms.
2022-05-24 21:02:20 +03:00
Xiao YiFang efb4a84da2 fix: duplicated entries in epwing dictionary 2022-05-24 20:32:23 +03:00
Xiao YiFang 1f01e545d1 disable print background 2022-05-24 21:40:53 +08:00
Xiao YiFang b55da16c33 clean code: remove deprecated css properties 2022-05-24 21:25:21 +08:00
Xiao YiFang 49fab235b9 Merge branch 'staged' into dev 2022-05-24 21:03:58 +08:00
Xiao YiFang 19a09b5f1b fix:remove epwing headword size limitation 2022-05-24 21:03:25 +08:00
Xiao YiFang fe544130df Merge branch 'goldendict-master' into staged 2022-05-24 20:25:26 +08:00