Commit graph

58 commits

Author SHA1 Message Date
shenleban tongying 0731253489 cleanup: simplify DSL's expand mode
Related code was related to DSL's [*][/*] tag.

One of the feature removed is Ctrl+8 to toggle current articleview's AlwaysExpand mode, because DSL is the only format that has this feature and User can turn on AlwaysExpand Mode on Preferences. There is no need to assign a shortcut for it.
2023-03-21 15:34:55 +08:00
shenleban tongying fac1247c10 refactor: properly modularize articleview's ui 2023-03-18 11:00:06 +08:00
Xiao YiFang 346986a3cd fix: fix conflict when merge upstream changes 2023-02-26 09:26:58 +08:00
shenleban tongying b3aac01f41 refactor: elimate makeScanPopup()
* Old code keep destory the scanpopup, then recreate it whenever the dict list or group list changed.
* New code keep a single instance of scanpopup, and only update necessary info.
2023-02-22 20:09:26 -05:00
Abs62 e43c0d2521 ScanPopup: Some more of save/restore position of the pinned popup window 2023-02-14 22:40:08 +03:00
Abs62 74aa95220d ScanPopup: Save/restore position of the pinned popup window after closing/reopening it 2023-02-14 17:51:03 +03:00
shenleban tongying 7fa87b6b42 fix: remove unused isScanningEnabled, the logic is handled in mainwindow::clipboardChanged() 2022-12-28 21:58:27 -05:00
shenleban tongying bdc43650bb fix: add a mini delay for selection clipboard 2022-12-28 21:36:02 -05:00
shenleban tongying 664a1e87e4 Remove ScanPopup Alt mode ("Keys may also be pressed afterwards").
The functionality of "select then press a key to get popup " has equivalent of using Ctrl+C+C on Hotkeys.
2022-11-20 04:12:58 -05:00
shenleban tongying 6e0a6cfa42 refactor & simplify ScanFlag:
All slots of ScanFlag are used just as functions calls.
2022-11-20 01:19:27 -05:00
shenleban tongying 79f8b05d40 Add showScanFlag condition to mainWindow's clipboardChange 2022-11-20 00:39:41 -05:00
Xiao YiFang cd5e5abe4d opt:scanpopup inspect element action optimization 2022-09-08 21:11:43 +08:00
xiaoyifang 23d833fbb8 6.2: currentIndexChanged signal is changed. 2022-03-11 22:00:53 +08:00
xiaoyifang 7b5511a7bd upgrade to qt6.2 2022-03-11 22:00:45 +08:00
yifang 23c41789de fix: popup link clicked 2022-02-15 20:22:43 +08:00
xiaoyifang 84175279ab fix: link click in popup windows ,translation should be in popup dialog too 2022-02-14 23:48:05 +08:00
Igor Kushnir 60bc05218f Add input phrase's punctuation suffix to alts
Preferences::sanitizeInputPhrase() transforms an input phrase by
removing its whitespace/punctuation prefix and suffix. Translating a
phrase from X11 primary selection or from clipboard, via mouse-over or
from the command line results in such sanitization. This is useful when
a punctuation mark or a space is selected accidentally alongside a word.
This sanitization can be undesirable, however, when an abbreviated word
is selected. For example: "etc.", "e.g.", "i.e.".

This commit implements searching for the input word with the punctuation
suffix preserved as an alternative form of the sanitized word to show
articles for both. For example, when the word "etc." is translated from
the clipboard, both "ETC" and "etc." articles are displayed.

The punctuation suffix is preserved when the word is passed from the
scan popup to the main window and when the translate line text is
refreshed (e.g. when the current group is changed). The suffix is not
stored in history and favorites (doing so would require file format
changes and possibly substantial code changes, this can be implemented
later if need be).

Trim the input phrase once in ArticleNetworkAccessManager::getResource()
instead of verbose trimming in multiple places in
ArticleMaker::makeDefinitionFor().

Closes #1350.
2021-06-17 12:06:36 +03:00
Abs62 92e8c85eec Fix behavior while words list font resizing (issue #1109) 2019-01-26 22:11:27 +03:00
Igor Kushnir 15dfdee49f Allow customizing unpinned scan popup window flags on X11 with Qt5
My tests in many desktop environments and window managers indicate that
no single configuration works perfectly in all environments. There are
also behavior differences between Qt::Popup and Qt::Tool flags, which
are not exactly bugs, so I suppose users might subjectively prefer
different options.

Customizing the flags allows the user to prevent unpinned scan popup
window flickering with Qt5 on Linux. In a way adding these options fixes
issue #645, which is: the scan popup window blinks rapidly, barely
noticeably in some applications, such as Calibre ebook-viewer
and Chromium. In this case the scan popup window usually ends up hidden
when selection ends, unless it was finished with a jerk.

I have tested the new options in 9 desktop environments and window
managers: at least one configuration for each eliminates #645 and makes
the scan popup window work the same as with Qt4 in this regard:
the popup window remains visible, text in the popup's translation line
keeps up with the text selection in the external application,
and the selected text is being translated on the fly.

Moreover, for each tested DE/WM, at least one configuration makes
the scan popup window work perfectly as far as I am concerned.

This issue was partially worked around with a 200ms scan popup delay
timer in the recent commit 58e41fe3ce
for the duplicate issue #854. However the timer solution is incomplete
because it requires the user to select text quickly and without delays.
If global mouse selection does not change for 200ms while the left mouse
button is held down, the user will likely not see the scan popup when
(s)he finishes selection, and will have to try selecting again -
hopefully faster this time.

The 200ms delay is no longer critically important after this commit,
but it is still beneficial: the lookup query changes less often,
which in turn reduces article definition update frequency.
So the delay improves the UI (perhaps subjectively) and performance.
2018-04-15 19:46:35 +03:00
Abs62 d65a1f7869 Save popup window configuration without it destroying 2018-03-27 21:23:48 +03:00
Igor Kushnir e5045860ef Make adding new audio player implementations easy
* add a new interface class AudioPlayerInterface;
* inherit a new proxy class Ffmpeg::AudioPlayer from it;
* partially switch ArlticleView to using the interface;
* expose MainWindow's AudioPlayerInterface instance to all ArticleView
  instances;
* add a new AudioPlayerFactory class responsible for creating instances
  of concrete classes derived from AudioPlayerInterface depending on
  relevant Config::Preferences values;
* increase minimum supported Qt version from 4.5 to 4.6 in README
  in order to use QScopedPointer introduced in Qt 4.6.
2018-03-24 21:31:48 +02:00
Abs62 77c9a4c3e2 Fix "Add to Favorites" icon changing 2017-11-07 17:46:59 +03:00
Abs62 1824d9ab02 Change "Add to Favorites" icon if headword is already presented in Favorites 2017-10-23 17:21:43 +03:00
Boyuan Yang 2c80aa4c67 Fix typos found by codespell 2017-09-16 21:18:42 +08:00
Abs62 ecddc321b2 ScanPopup: Change font size for translate line and word list synchronously with main window 2017-07-14 16:02:21 +03:00
Abs62 a75dcfb7c5 ScanPopup: Add button to stay over all other windows (issue #659) 2017-07-13 18:00:19 +03:00
Abs62 58e41fe3ce Linux-specific: Small delay for show of popup window when selection changed (by Sun Wang) (issue #854) 2017-06-13 18:00:16 +03:00
Abs62 0999c86038 Linux-specific: Hide scan flag window when popup window is shown (by Ctrl+C+C) 2017-06-06 18:00:48 +03:00
sunwxg ad8008c37b Add scan popup flag
After select a word, show a flag window, click the flag to show
popup window.
2017-06-05 21:15:38 +08:00
Abs62 a6e51afa64 Add "Add to Favorites" button to scan popup window 2017-05-15 18:08:06 +03:00
Abs62 e982b69216 Add command line parameters "--group-name" and "--popup-group-name" 2017-03-10 17:15:10 +03:00
Abs62 9ad0d5f985 Implement full-text search 2014-04-16 20:18:28 +04:00
Abs62 3bd82ef752 "Open dictionary folder" action in context menu (issue #344) 2013-06-09 17:31:57 +04:00
Abs62 13eb3fa503 Synchronize dicionary icons size in popup and main windows (issue #168) 2013-02-27 17:12:46 +04:00
Tvangeste 3b7326e3be Fixed #194: Scan Popup window doesn't get the keyboard focus on Linux.
Tested and verified on recent Unity, Gnome, KDE, LXDE systems.
2013-01-29 22:30:24 +01:00
Tvangeste ffa9f5778b Fixed #192: Dynamically adjust the suggestion list in the new UI. 2013-01-27 23:12:00 +01:00
Tvangeste 3258ad89f5 Fixed #191: New UI in the scan popup, replace 3 separate widgets with the translate box. 2013-01-25 16:42:44 +01:00
Abs62 4c8b12b9af "Back" and "Forward" buttons in scan popup window 2012-12-24 16:59:46 +04:00
Abs62 259efae81c Update history when clicking links on page (issue #120) 2012-11-12 17:52:54 +04:00
Abs62 4c5e79c2b2 Add "Dictionary info" item to dictionary bar context menu 2012-09-25 17:13:35 +04:00
Abs62 09b9e9aa46 Win-specific: Show translation in popup window istead of sending word to GD main window while scanning GD main window 2012-09-24 17:20:58 +04:00
Abs62 44247c04c9 Add word to history via context menu from ScapPopup window 2012-09-16 14:30:14 +04:00
Abs62 305c9ed1b8 Show/hide optional parts of articles (DSL dictionaries only) 2012-09-16 14:19:47 +04:00
Abs62 e00415e4d2 Close popup menus when ScanPopup window closes 2012-09-12 18:18:16 +04:00
Abs62 535fe0d3e0 Update year in copyright notices. 2012-02-21 01:47:14 +04:00
Abs62 bd90b5368b Add translation of the word from command line 2011-11-16 17:02:56 +04:00
Abs62 9a1ceff5d8 1. Add button to scan popup window to send translated word into main window
2. Add option to use main window instead of scan popup window
2011-11-16 16:52:25 +04:00
Konstantin Isakov f65c98c8e1 Merge pull request #26 from Abs62/master
Improvements in scan popup functionality. Now it can work with Internet Explorer 9.
2011-07-29 19:47:54 -07:00
Abs62 a11774483d Move some checks from ScanPopup into MouseOver 2011-07-28 17:04:06 +04:00
Abs62 68c80f48b2 Some simplification and cleanup 2011-07-27 16:47:29 +04:00