Commit graph

751 commits

Author SHA1 Message Date
xiaoyifang 8b88ea544e
opt: add fullindex position (#916)
* opt: enable fulltext with position info

* opt: add fulltext position support

* 🎨 apply clang-format changes

* i18n: update translation entries

* opt: default enablePosition=false

* opt: fulltext search highlight

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-07-01 22:39:43 +08:00
YiFang Xiao ed8072d78f fix: statusbar at some rare conditions crash
the stacktrace show the line is parentWidget().
avoid using this the parentWidget() method.
2023-07-01 22:33:58 +08:00
YiFang Xiao e971d2be67 opt: dsl target url 2023-07-01 14:08:48 +08:00
YiFang Xiao 45a71d1fdf fix: tts only enable current locale
too many locale tts initialization cost too much time.
2023-06-28 10:59:39 +08:00
shenleban tongying fa27f32146
clean: unify how data added to dataRequestInstant 2023-06-24 17:36:10 -04:00
YiFang Xiao 8628a12e5f fix:dsl language parse issue
fix #902
2023-06-24 20:44:29 +08:00
xiaoyifang a878e725f2
fix: code smells in group widget (#901)
* fix: code smells in group widget

* 🎨 apply clang-format changes

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-24 15:30:20 +08:00
xiaoyifang 5d3f1a3e3d
Merge pull request #899 from shenlebantongying/datareq_append_str
clean: unify DataRequest string data appends
2023-06-24 14:28:01 +08:00
xiaoyifang 6a9ed739e8
Merge pull request #900 from shenlebantongying/xdxf_fix
feat: XDXF: distinguish `ex_orig` and `ex_tran`
2023-06-24 09:56:19 +08:00
shenleban tongying 48f2c94d0c
feat: XDXF: distinguish ex_orig and ex_tran
* this will make xdxf_ex_marked to inherit color, thus don't set it
to black.
2023-06-23 14:35:49 -04:00
shenleban tongying e06606ba3c
clean: unify DataRequest string data appends 2023-06-23 12:23:32 -04:00
YiFang Xiao 43c2cfdd65 fix: group widget null check 2023-06-23 09:28:35 +08:00
YiFang Xiao 2359352781 fix: editDictionaries tab interaction 2023-06-23 09:28:35 +08:00
YiFang Xiao aa94af4382 fix: fix double release pointer 2023-06-23 09:28:35 +08:00
YiFang Xiao 4d452e7a63 fix: tts null check 2023-06-23 09:28:35 +08:00
YiFang Xiao f909413caa fix: code smells 2023-06-23 09:28:35 +08:00
YiFang Xiao 0a9a053945 opt: enable breakpad on macos
action: add macos breakpad workflow

action: breakpad

action: breakpad

action: breakpad dmg

action: breakpad

action: macos breakpad action does not need to build automatically
2023-06-23 09:28:35 +08:00
YiFang Xiao 3b935e7660 fix: possible null object
refactor: group widget currentindex logic
2023-06-22 21:30:30 +08:00
xiaoyifang ef594117c3
opt: group widget remove all tabs (#892)
* opt: remove all group widget tabs

* 🎨 apply clang-format changes

* opt: does not elide text on tab name

* 🎨 apply clang-format changes

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-22 17:17:57 +08:00
xiaoyifang 04a58d6418
opt: dsl remove useless method and refactor langcodes logic (#889)
* opt: dsl remove useless method and refactor langcodes logic

* 🎨 apply clang-format changes

* opt: remove useless code

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-21 20:47:49 +08:00
xiaoyifang 93d475cc32
Merge pull request #882 from xiaoyifang/opt/unify-windows-icon
opt: unify windows icon
2023-06-20 13:43:25 +08:00
xiaoyifang a0d8c50a52
Merge pull request #881 from shenlebantongying/macOS_slot
fix: macOS missing slot warning
2023-06-20 09:54:40 +08:00
YiFang Xiao 7f0cb26cda opt: unify windows icon 2023-06-20 08:31:44 +08:00
shenleban tongying ffe88499bb fix: macOS missing slot warning 2023-06-19 20:17:58 -04:00
shenleban tongying 4432de9d50
clean: remove duplicated exCantReadFile definitions
Obviously, it is a result of copy-paste programming
2023-06-19 18:54:17 -04:00
shenleban tongying a76ef3dfdd
guard against null img for ZIM 2023-06-19 05:01:27 -04:00
shenleban tongying 1589e14b70
clean: remove redundant dictionaryNativeIcon
`dictionaryNativeIcon` was intended to access the original icon before none-square icons were transformed into squares.

`dictionaryNativeIcon` is only used in dictionaryBar, but according to the intention, it shouldn't.

In reality, `dictionaryNativeIcon` is almost always equal to `dictionaryIcon`.
2023-06-18 22:37:07 -04:00
shenleban tongying feda879a30
feat: load and display ZIM dictionary icon
* Original GD never tries to load zim format's icon
* This leverage the capability provided by libzim
2023-06-18 05:25:38 -04:00
shenleban tongying 9d19ea1ebc
feat: add -v --version flag to CLI
* also abstract version info into a standalone namespace
2023-06-17 05:00:05 -04:00
YiFang Xiao b815f489d2 clean: remove config old code 2023-06-16 20:34:50 +08:00
xiaoyifang 16f853b68b
fix: qtimer release memory (#863)
* fix: memory leakage
2023-06-16 08:37:33 +08:00
shenleban tongying 35f39ea7a0
clean: convert a few trivial old SIGNAL/SLOT to new syntax 2023-06-11 11:27:49 -04:00
xiaoyifang 7e93d787b5
Merge pull request #852 from shenlebantongying/no_SIGNAL_scanpopup
clean: convert Scanpopup edictGroupRequested to new syntax
2023-06-11 23:20:16 +08:00
shenleban tongying b882ecb76c
clean: convert Scanpopup edictGroupRequested to new syntax
* old code has a SIGNAL and a SLOT both named editGroupRequested'
* rename the SIGNAL to editGroupRequest to avoid this ambiguity
2023-06-11 10:17:20 -04:00
YiFang Xiao 318e186215 fix: slob fullindex will freeze the preference dialog 2023-06-11 21:33:25 +08:00
shenleban tongying f14d28d193
clean: convert MainWindow::addGlobalAction SLOT to new syntax
Historical context: `MainWindow::addGlobalAction` was invented by

https://github.com/goldendict/goldendict/pull/482/files
2023-06-11 04:47:39 -04:00
xiaoyifang ca4664f209
fix: possible crash (#836)
* fix: possible crash when show statusbar message

* windows qt upgrade to qt6.5.1

* Update src/ui/mainstatusbar.cc

---------

Co-authored-by: YiFang Xiao <yifang.xiao@noreply.com>
2023-06-10 22:26:24 +08:00
xiaoyifang dfd3a86c7f
fix: fulltext remove query word size check (#845)
* fix: fulltext remove query word size check

* fix: remove unused methods

* 🎨 apply clang-format changes

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-10 21:02:22 +08:00
shenlebantongying ab7af55696 update initializing.ui & splash img 2023-06-10 07:40:17 -04:00
xiaoyifang a688a08eb1
Merge pull request #843 from xiaoyifang/feature/splash-2
feat: make initialize ui more human-friendly
2023-06-10 18:25:48 +08:00
YiFang Xiao 90b89acac0 feat: make initialize ui more human-friendly 2023-06-10 16:57:49 +08:00
YiFang Xiao 799370f5ef fix: adjust margin around dictionary group 2023-06-10 14:45:48 +08:00
xiaoyifang 9c1a77a3f8
fix regression: select translation line text when got focused (#841)
* fix: select translation line text when got focused

* 🎨 apply clang-format changes

* fix: code smells

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-10 10:36:59 +08:00
YiFang Xiao fc08c16479 fix: merge history items when import history items 2023-06-09 21:57:09 +08:00
YiFang Xiao 04ed15434e fix: remove duplicate logic 2023-06-09 21:36:12 +08:00
xiaoyifang 8ecf3b6cbc
Merge pull request #837 from xiaoyifang/opt/dsl-old-logic
fix: dsl remove too old code logic
2023-06-09 20:11:08 +08:00
xiaoyifang f02fc350f8
fix: keep the application name unchanged for now (#835)
fix: Windows autostart reg entry use GoldenDict as entry name
2023-06-09 19:56:51 +08:00
xiaoyifang 9d047fea61
fix: add an --reset-windows-state option to command line (#829)
* fix: add an --reset-windows-state option to command line

* add an option
2023-06-09 19:56:04 +08:00
YiFang Xiao 6a7dd65728 fix: remove too old code logic
reasons:
1. if the replacement is important ,then the code should not care about the length (size() < 70)
2.  ' ' has been replaced with uC2A0 which is incorrect.  u00A0 is expected.
2023-06-09 19:53:34 +08:00
xiaoyifang 67ed24c61c
fix: support dsl dictionary utf encoding detection (#830)
* fix: support dsl dictionary utf encoding detection

* fix: code smells

* fix: code smells

* 🎨 apply clang-format changes

* fix: adjust linefeed

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-09 08:01:45 +08:00
YiFang Xiao c56304a2b9 fix: remove toggle main windows extra parameter
the parameter has no use right now
2023-06-08 08:30:23 +08:00
YiFang Xiao 70cd2f937d fix: remove unused configuration 2023-06-07 23:49:27 +08:00
YiFang Xiao 47cc3ced1f fix: remove the context line parameter
in release mode, this parameters are empty
2023-06-07 21:58:59 +08:00
xiaoyifang f58eb43bd2
opt: use QFontCombox instead (#781)
* opt: use QFontCombox instead

* 🎨 apply clang-format changes

* remove comment code

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-07 21:53:21 +08:00
Ren Tatsumoto e6a2c4081b
fix global translateLineText not being updated when translate line changes 2023-06-07 09:34:25 +03:00
YiFang Xiao eccc3eaf0f Revert "opt: mdx video url"
This reverts commit 2bd5194c91.

accidently merged.
2023-06-06 23:45:04 +08:00
YiFang Xiao c2ff1e804f QDomDocument changed the implementation of setContent 2023-06-06 15:37:47 +08:00
xiaoyifang e0dba5ac3b
Merge pull request #818 from shenlebantongying/expose_timer
feat: expose linux's selection clipboard delay timer to user
2023-06-05 22:46:08 +08:00
xiaoyifang 671427803a
fix: replace suggestion list with QCompleter (#808)
* fix: replace suggestionList with QCompleter


* 🎨 apply clang-format changes


* fix: code smells

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-05 21:22:20 +08:00
YiFang Xiao dcfee63b22 fix: wikipedia query parameter is incorrect 2023-06-05 20:58:04 +08:00
shenleban tongying 6732f4630d
feat: expose linux's selection clipboard delay timer to user
* In certain programs like Chrome, the selection clipboard will update
even the user have not released mouse button.
2023-06-05 08:22:49 -04:00
shenleban tongying b06c01beeb
fix: xdxf2html converter failed to parser xml due to &nbsp;
* xml don't have &nbsp;
* in Qt5, this is not a problem because QDomDocument::setContent will
 somehow accept it.
* in Qt6, this will be rejected
2023-06-04 07:38:14 -04:00
shenleban tongying 41776d2b89
feat: add article-script.js
* like article-style.css but for javascript
2023-06-03 20:53:46 -04:00
shenleban tongying 849b1345e1
fix: define PROGRAM_DATA_DIR for cmake
* the PROGRAM_DATA_DIR is hardcoded path to /usr/share/goldendict
* Without it, resources cannot be loaded
2023-06-03 09:50:13 -04:00
xiaoyifang 87e2091214
fix: remove for loop with most one iteration (#804)
* fix: remove `for` loop with most one iteration

* 🎨 apply clang-format changes

* fix: remove `for` loop with most one iteration

* fix: code smells

* 🎨 apply clang-format changes

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-03 20:51:38 +08:00
YiFang Xiao d6009f0e8e fix: new release check ,download url is incorrect
fix #718
2023-06-03 17:49:37 +08:00
YiFang Xiao 29403f4263 fix: code smells
🎨 apply clang-format changes

fix: code smells

🎨 apply clang-format changes

🎨 apply clang-format changes
2023-06-03 14:07:41 +08:00
YiFang Xiao 1391a8fa7e fix: invalid data access of data field
bgl_babylon.cc

fix #770
2023-06-03 14:07:41 +08:00
YiFang Xiao 0c7d7ada21 fix: invalid data access of data field
bgl_babylon.cc

fix #768
2023-06-03 14:07:41 +08:00
YiFang Xiao 49c6ae7032 opt: iconv remove unused parameter
In GoldenDict, the application uses utf-8 as the default encoding. There should be no other use.
2023-06-03 14:07:18 +08:00
xiaoyifang 5899aa7c94
fix: highlight fts search result (#792)
* fix: highlight fts search result

* 🎨 apply clang-format changes

* remove accent/diacritic handler used in fts search

* header file adjustment

* fix: qt5.15 compile

* fix: code smell

use const reference variable

* fix: code smell

* fix: code smell

* fix: code smell

* fix: code smell

* 🎨 apply clang-format changes

* fix: code smells

🎨 apply clang-format changes

* opt: fix code smells

remove unused parameters from function `ftsIndexIsOldOrBad`

🎨 apply clang-format changes

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-06-03 08:29:19 +08:00
YiFang Xiao 2bd5194c91 opt: mdx video url 2023-06-02 21:47:48 +08:00
xiaoyifang ded97deb9a
Merge pull request #789 from xiaoyifang/fix/code-smells
fix: code smells
2023-06-01 21:15:43 +08:00
xiaoyifang b7edc8ed2d 🎨 apply clang-format changes 2023-06-01 11:53:45 +00:00
YiFang Xiao 002f7a02f7 fix: code smells
refactor the disabledType string build
2023-06-01 19:52:16 +08:00
xiaoyifang eefdba23ae
Merge pull request #787 from shenlebantongying/cmake_polish
cmake: polishments to be officially used
2023-06-01 14:07:58 +08:00
shenleban tongying 0c75d4f399
cmake: updates
* add USE_SYSTEM_FMT & USE_SYSTEM_TOML
* switch back to libeb
2023-06-01 01:28:45 -04:00
YiFang Xiao 978fd3ba81 opt: slob dictionary does not display goldendict headword 2023-06-01 10:55:40 +08:00
xiaoyifang c7f773c12b
Merge pull request #776 from shenlebantongying/better_defaults
Tweak some defaults
2023-05-31 18:42:55 +08:00
shenleban tongying 7f994112b7
fix: send to mainwindow got empty word
a regression due to Input Phase change: if word is sent to
mainwindow, then definition->getWord() would be empty
2023-05-31 04:17:16 -04:00
shenleban tongying d72a8540d4
feat: tweak some defaults
* enable DSL's alwaysExpandOptionalParts by default
* enable both wikipedia & wikitionary by default
* disable hotkey for macOS by default (they have troubles in new macOS)
* update default websites, remove ones that no long accessible
* add default DictD protocal server
2023-05-30 23:54:43 -04:00
shenleban tongying b7f0e5448b
fix: modern style's .gddictname 2023-05-30 21:22:08 -04:00
xiaoyifang 4147770f85
Opt: ftshelper refactor (#760)
* opt: remove useless ftshelper methods

🎨 apply clang-format changes

opt: slob use xapian as fulltext engine

🎨 apply clang-format changes

opt: refactor ftshelper

🎨 apply clang-format changes

* opt: refactor ftshelper

remove unused variabes and functions.

* 🎨 apply clang-format changes

* opt: refactor ftshelper

remove unused variabes and functions.

* opt: refactor ftshelper

remove unused variabes and functions.

🎨 apply clang-format changes

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-05-31 07:42:31 +08:00
shenleban tongying 6823254bac clean: solve a TODO about translateInputFinished 2023-05-31 07:26:43 +08:00
shenleban tongying 6c7bb05f35 clean: convert SLOT translateInputFinished to new syntax 2023-05-31 07:26:43 +08:00
shenleban tongying 0079cd2933 clean: remove unnecessary header includes
* remove all <QtGUI> which includes *everything* of Qt
* remove unused headers
2023-05-30 20:59:51 +08:00
YiFang Xiao 15e0fa087f opt: replace Mutex::Lock with QMutexLocker 2023-05-30 00:08:01 +08:00
shenleban tongying 0b746ef8eb
Revise how word is getting passed (#736)
* fix: remove InputPhrase

* opt: remove unnecessary InputPhrase

* fix: assignment issue

* fix: add handleInputWord back

* fix: does not need to trim punc

---------

Co-authored-by: YiFang Xiao <yifang.xiao@foxmail.com>
2023-05-29 00:01:54 +08:00
xiaoyifang 4eb8374a35
opt: mdx fulltext lock seperated with normal search (#759)
* opt: refactor mdx fullindex creation

* opt: incremental fulltext creation logic change

* opt: incremental fulltext creation logic change

* opt: progress of fulltext creation logic

* opt: code smell

* fix: code smell

* fix: code smell

* fix: code smell

* fix: code smell

* fix: code smell

* 🎨 apply clang-format changes

* fix: code smell

* fix: code smell

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
2023-05-29 00:01:21 +08:00
xiaoyifang 966b477b26 🎨 apply clang-format changes 2023-05-28 15:50:08 +08:00
YiFang Xiao cfec24f4bb opt: use auto and for range in building index 2023-05-28 15:50:08 +08:00
YiFang Xiao 2cbcab16ba fix: switch dictionary should change the headwords in the dialog
fix #752
2023-05-27 23:53:16 +08:00
xiaoyifang 3858932ec4
feat!: add libzim dependency (#725)
* feat!: add libzim dependency

* 🎨 apply clang-format changes

* action: add libzim dependency to action

* feat!: change dependency folder

* action: add zim support

* feat!: add libzim support

* action: fix sonarcloud check

* doc: add libzim readme

* action: cmake build

* action: cmake check

* fix: code smell

* action: cmake check

* action: cmake on Macos

* action: cmake on Macos

* feat: use libzim to read title and description

* 🎨 apply clang-format changes

* feat: split zim file support

* feat: loadArticle refactor

* 🎨 apply clang-format changes

* 🎨 apply clang-format changes

* feat: update library and goldendict.pro

* 🎨 apply clang-format changes

* fix:word count

* 🎨 apply clang-format changes

* fix: video src url subsititue

* 🎨 apply clang-format changes

* zim: headword is not usually a valid

it is from title and url.

* fix: remove nested try catch

* zim: fix resource loading issue.

* 🎨 apply clang-format changes

* action: remove libao

* zim: process url

some old zim dictionary url does not contain namespace such as
/C/url

make the old and new zim dictionary's url consistent without the leading
../C/  etc.

* 🎨 apply clang-format changes

* zim: process url

remove leading dot and slash
such as ../-/assets  ,remove ../

* 🎨 apply clang-format changes

* zim: remove resourceIndex creation

use libzim to read the resource directly.

* zim: only iterate all the articles

* 🎨 apply clang-format changes

* fix: code smell

* 🎨 apply clang-format changes

* zim: refactor method to convert url to wstring

* 🎨 apply clang-format changes

* fix:code smell

* 🎨 apply clang-format changes

* zim: update windows dependencies

* zim: add mutex lock

* 🎨 apply clang-format changes

* fix: code smell

* 🎨 apply clang-format changes

---------

Co-authored-by: xiaoyifang <xiaoyifang@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-27 12:12:16 +08:00
YiFang Xiao fe29fdddc1 opt: add command line option --no-tts
when specified, the speech tab in the sources dialog will be disabled.

close #747
2023-05-27 12:11:37 +08:00
xiaoyifang defc2447cf
opt: convert escape string to rawstring (#749)
* opt: convert escape string to rawstring

* 🎨 apply clang-format changes

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-27 00:27:50 +08:00
xiaoyifang 6567e1583f
fix: langcoder trigger a crash (#746)
* fix: langcoder trigger a crash

* 🎨 apply clang-format changes

* fix: move static delcaration into the class

* Update langcoder.hh

* fix: refactor code in langcoder

* 🎨 apply clang-format changes

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: YiFang Xiao <yifang.xiao@noreply.com>
2023-05-26 23:55:33 +08:00
YiFang Xiao d3cf46e469 clean code 2023-05-23 19:40:37 +08:00
YiFang Xiao 8b1b2a1628 fix: possible dsl languageForId issue
🎨 apply clang-format changes

action: restrict to current repositroy

other people's repository has no permission to commit fix

fix: refactor langcoder method

🎨 apply clang-format changes

🎨 apply clang-format changes

🎨 apply clang-format changes

fix: code smell

🎨 apply clang-format changes

fix: adjust zlib link on Windows

fix: refactor langcoder structure
2023-05-23 19:03:25 +08:00
YiFang Xiao a8b6fbc754 opt: make the searchPanel can resize to a smaller width
🎨 apply clang-format changes

opt: make the searchPanel can resize to a smaller width

🎨 apply clang-format changes

fix:remove group label in docker
2023-05-23 19:03:21 +08:00
YiFang Xiao 5188ebd646 opt: add extra check about the existence of metadata file 2023-05-21 18:18:46 +08:00