Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-22-2014, 04:40 AM   #136
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As I thought it is caused by the combination of hyphenation+font. Turn off hyphenation in the viewer preferences (it defaults to off) and you will be fine. Of change the font in the book from PT Serif to just serif.
kovidgoyal is offline   Reply With Quote
Old 08-22-2014, 04:47 AM   #137
beedaddy
Zealot
beedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoonbeedaddy knows that there *is* no spoon
 
Posts: 146
Karma: 131606
Join Date: Oct 2011
Location: Germany (south-west)
Device: Kobo Clara 2E, Tolino shine 4
Quote:
Originally Posted by kovidgoyal View Post
As I thought it is caused by the combination of hyphenation+font. Turn off hyphenation in the viewer preferences (it defaults to off) and you will be fine. Of change the font in the book from PT Serif to just serif.
Thanks! So, it was never problem with Qt4-based calibre because due to Qt-limitations, the viewer never used the embedded font?
beedaddy is offline   Reply With Quote
Advert
Old 08-22-2014, 05:00 AM   #138
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Who knows, Qt WebKit's font handling has always been fairly severely broken. In any case, here is the bug report against Qt 5: https://bugreports.qt-project.org/browse/QTBUG-40912
kovidgoyal is offline   Reply With Quote
Old 08-22-2014, 12:39 PM   #139
NSGod
Junior Member
NSGod began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2014
Device: iPad
I'm seeing a bug here in the Edit Book application when dismissing panels/windows that are being shown in an application-modal fashion. (I'm on OS X 10.9.4, running calibre 1.206.1).

For example, I'll choose Tools > Remove unused CSS rules, which brings up the "Remove unused CSS" dialog box with a Cancel and OK button, where I click OK. Then after doing its work, it opens up a window (no title) that shows the results of process, and this window is shown in an application-modal fashion (meaning, I can do nothing else in the application until this window is dismissed). There is a Close button and a See what changed button. If I click on the "See what changed" button, it brings up the "Differences between books" diff window. Clicking "Revert changes" in that window dismisses the window (closes it), but the rest of the application now still behaves as if it's showing a modal dialog: clicking anywhere on the main window results in an NSBeep, and the menu items are all grayed out. The only way to recover from this is to Press Command-Q or choose Quit from the application icon in the Dock, where you're prompted to save changes or discard.
NSGod is offline   Reply With Quote
Old 08-22-2014, 02:24 PM   #140
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That should fix it: https://github.com/kovidgoyal/calibr...566e918ff9599f
kovidgoyal is offline   Reply With Quote
Advert
Old 08-22-2014, 05:37 PM   #141
NSGod
Junior Member
NSGod began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2014
Device: iPad
Cool.

Another bug I noticed when I have a tab open in the editor (in the Edit Book app), and I try to save changes (by pressing the Command-S keyboard combination), but there are none to save (and if I go to the File menu, Save is grayed out), instead of ignoring it or beeping at me (to signify that it's not available), it, instead, inserts an 's' into the editor window.

I routinely hit Command-S frequently out of habit, and have ended up trying to save changes even when there weren't any to save, and this led to stray 's's showing up in the code, which caused parsing errors.

I'm guessing I would expect it to behave like the other grayed out menu commands, like Copy, Cut, etc., where if they're grayed out, and you hit the keyboard combination, they're simply ignored, rather than inserting the character into the window (for example, 'c' for Copy, 'x' for Paste, etc.)
NSGod is offline   Reply With Quote
Old 08-22-2014, 10:12 PM   #142
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's an odd one. Does typing arbitrary letters with the Cmd key pressed translate into text? Say for example, Cmd+k

EDIT: https://github.com/kovidgoyal/calibr...1853396132b5bd

Last edited by kovidgoyal; 08-22-2014 at 11:08 PM.
kovidgoyal is offline   Reply With Quote
Old 05-08-2015, 04:44 AM   #143
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,450
Karma: 10484861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by BetterRed View Post
Quote:
Originally Posted by kacir View Post
I use AutoKey program for automating certain tasks.
One example is searching for author in Calibre in such a way that it doesn't matter whether I have firstname lastname or lastname, firstname.

Program that is run when I press F2 in my AutoKey is:
Code:
#### Beginning of the Script for F2 hotkey ####
import re

contents = clipboard.get_clipboard()

# re.sub(pattern, repl, string, count=0, flags=0)
output = re.sub(r'([^ ,]*),? (.*)', r'authors:"\1" and authors:"\2"', contents)

keyboard.send_keys(output)
#### End of the Script for F2 hotkey ####
It works in a simple way:
I find somewhere (Calibre itself, or Internet or any text) name of the author, I copy the name such as:
Hugo, Victor
to the clipboard, then I go to Calibre, position cursor to the Search bar and press F2. I get the following
authors:"Hugo" and authors:"Victor"
Well, I *used* to get that. In Beta when I use this script, I get
authors.;hugo; and authors.;victor;
In any other program where I can enter text this works OK.

My system:
Spoiler:

kacir@Petra:~ > calibre-debug -g
calibre 1.205 isfrozen: True is64bit: True
Linux-3.11.0-12-generic-x86_64-with-debian-wheezy-sid Linux ('64bit', 'ELF')
('Linux', '3.11.0-12-generic', '#19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013')
Python 2.7.8
Linux: ('debian', 'wheezy/sid', '')


I can (and probably will) find a workaround by extending my script from four lines to eight ;-), but this behavior might indicate some problem.

I used to have this tiny hack built into Calibre as modification to the "find similar books" function, and I have even tried to persuade you to put it into main trunk.
@kacir - there's a plug-in that does something like that ==>> [GUI Plugin] Clipboard Search

I did a few tests on the Qt5'd version the other day on Windows 7, under calibre 1.48 64-bit & calibre 1.205 portable, seems to work as advertised. The Qt5d version is released, so you can install via Prefs->Plug-ins->Get New.

BR
The Clipboard Search doesn't have the functionality I was looking for.
BUT!
I finally got pisse^H^H^H^H^Hmotivated enough to sit down and do something to solve my problem, because it looks like AutoKey is unlikely to resolve the problem with QT5 and I won't be able to make it work the way I want.
So ... I installed the plugin and had a look inside.

It took me 5 minutes to modify the functionality of the code that in original plugin just surrounds the text in quotes.

Code:
I have replaced code:
#######################
    def search_using_clipboard_text(self, is_exact_search=False):
        cb = QApplication.instance().clipboard()
        txt = unicode(cb.text()).strip()
        if txt:
            if is_exact_search:
                # Surround search text with quotes if it does not have any already
                if not txt.startswith('"'):
                    txt = '"' + txt
                if not txt.endswith('"'):
                    txt += '"'
            self.gui.search.set_search_string(txt, store_in_history=True)
#######################

With the following
#######################
import re ## - put at the beginning of the file after other import statements
#######################
    def search_using_clipboard_text(self, is_exact_search=False):
        cb = QApplication.instance().clipboard()
        txt = unicode(cb.text()).strip()
        if txt:
            if is_exact_search:
            self.gui.search.set_search_string(txt, store_in_history=True)
#######################
Thank you for the inspiration.

This is even better - I do not need the AutoKey third-party program AND I do not have to do a private fork of the Calibre (as I used to do in the past) to make this work.

Thank you Kovid for an absolutely wonderful easily-user-extensible framework
Thank you KiwiDude for those fantastic plugins
kacir is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Arc Updated Jelly Bean release - Beta testers needed kobo-adrian Kobo Tablets 19 05-23-2013 09:32 PM
Invitation for Beta testers KoboJW Kobo Tablets 30 11-29-2011 02:16 PM
Classic G:RSS: Optimized Google Reader (RSS) for the Nook [BETA Testers needed] Fmstrat Barnes & Noble NOOK 24 12-28-2010 12:22 PM
calibre ereader output testers needed user_none Other formats 24 05-11-2009 12:00 AM
Web Browsing from the Ebw-1150 - BETA Testers needed Nate the great Fictionwise eBookwise 26 09-21-2008 11:52 PM


All times are GMT -4. The time now is 01:23 PM.


MobileRead.com is a privately owned, operated and funded community.