Skip to content

add faster option to export text selections via qr codes#12746

Merged
Frenzie merged 1 commit intokoreader:masterfrom
Commodore64user:qr-code
Nov 20, 2024
Merged

add faster option to export text selections via qr codes#12746
Frenzie merged 1 commit intokoreader:masterfrom
Commodore64user:qr-code

Conversation

@Commodore64user
Copy link
Copy Markdown
Member

@Commodore64user Commodore64user commented Nov 17, 2024

what's new:

This pull request introduces a new method to add the QR code generation option to the highlight dialogue, to allow users to generate a QR code from selected text. No longer do users need to make a selection, copy it and then go through menus with multiple taps or key presses to generate a QR code.

implementation:

  • plugins/qrclipboard.koplugin/main.lua: Introduced addToHighlightDialog method to add the "Generate QR code" option to the highlight dialogue. This method copies selected text to the clipboard (automatically) and then displays the QR code.

screenshots:


This change is Reviewable

@Frenzie Frenzie added the Plugin label Nov 17, 2024
@Frenzie Frenzie added this to the 2025.01 milestone Nov 20, 2024
@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Nov 20, 2024

It looks a bit silly when you select an entire page in a small font, but apparently it still works.

@Frenzie Frenzie merged commit 9aa327a into koreader:master Nov 20, 2024
@mergen3107
Copy link
Copy Markdown
Contributor

by the way, what happens if you QR a whole page, but it has an image?
Does the image gets ignored?

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Nov 20, 2024

Text only, text over 2953 characters is truncated. I don't know where that number came from; it seems like slightly more shouldn't be an issue (at least on devices with a higher resolution/larger screen).

if #text > 2953 then
local truncated = _("... (truncated...)")
text = text:sub(1, 2953 - #truncated) .. truncated
end

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Nov 20, 2024

Apparently 177 rows by 177 columns is simply the maximum it can do.
https://scanova.io/blog/qr-code-capacity/

@mergen3107
Copy link
Copy Markdown
Contributor

That's impressive in any case :D

@mergen3107
Copy link
Copy Markdown
Contributor

I was able to read your one page from my phone xD a French book, right?)

@mergen3107
Copy link
Copy Markdown
Contributor

Da Vinci Code in French?

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Nov 20, 2024

I don't know why I have that, possibly something to do with @poire? It's the 2018 version of https://fr.wikipedia.org/wiki/Da_Vinci_Code through our Wikipedia save as EPUB feature.
Da Vinci Code.FR.zip

@Commodore64user Commodore64user deleted the qr-code branch November 21, 2024 10:50
@Commodore64user
Copy link
Copy Markdown
Member Author

Text only, text over 2953 characters is truncated.

I too was wondering why it was such a specific number. good to know, anyway that should be around 450-600 words more or less so, plenty good.

@Commodore64user
Copy link
Copy Markdown
Member Author

I was able to read your one page from my phone xD a French book, right?)

this is the same reason, producers don't put real phone numbers on tv anymore, people will call any number they see. I was originally going to add a qr screenshot but then thought better of it. ;)

@mergen3107
Copy link
Copy Markdown
Contributor

I was just checking if QR works OK :D

@hius07
Copy link
Copy Markdown
Member

hius07 commented Dec 2, 2024

Failed to init the plugin when Start with: or switch to the file browser (definitely, no self.ui.highlight called in line 27 then).

@Commodore64user
Copy link
Copy Markdown
Member Author

Sorry, could you clarify what you mean?, i am using start with: file browser and have no issues, as far as i can see. Moving from reader to file browser yields expected behaviour (e.g qr plugin still visible in both top menu and plugin manager)

@hius07
Copy link
Copy Markdown
Member

hius07 commented Dec 2, 2024

Anything in the crash.log?

@Commodore64user
Copy link
Copy Markdown
Member Author

I can’t see logs at the moment, and probably not until the evening; what are you getting?

@Commodore64user
Copy link
Copy Markdown
Member Author

Commodore64user commented Dec 2, 2024

yeah, you are right @hius07

12/02/24-20:54:04 ERROR Failed to initialize qrclipboard plugin: plugins/qrclipboard.koplugin/main.lua:27: attempt to index field 'highlight' (a nil value) 
if self.ui.highlight then
    self:addToHighlightDialog()
end

that should take care of it, right?

12/02/24-21:04:33 DEBUG FM loaded plugin qrclipboard at plugins/qrclipboard.koplugin 

why is that kindle (K4) still using BST (British summer time)?

@mergen3107
Copy link
Copy Markdown
Contributor

why is that kindle (K4) still using BST (British summer time)?

Because Kindles are stupid and have archaic tz timezone files :D

Grab a sane one from current Linux distro and then replace a binary /var/local/system/tz with it.

I just copied full /usr/share/zoneinfo from Linux Mint Debian Edition 6 :D

There is also a link /etc/localtime that points to the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: QR code on text selection popup

4 participants