Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 11-14-2014, 05:54 PM   #1
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,572
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
[V2.10] Keyboard Shortcut stopped working

I have (had) one of the Views in View Manager PI assigned to ctrl/alt/p (Published date primary sort column) for some time (at least 2 years). In Windows 64bit version 2.10 its stopped working. It works fine in Windows 32bit version 2.9 on the same library using the same config data - its a view I use daily when I adding articles/papers etc.

Other similar kb shortcuts work - ctrl/alt/d for default view (Author primary sort column), ctrl/alt/u (Publisher primary sort column), ctrl/alt/m to toggle Mark Book etc.

If I change ctrl/alt/P to ctrl/alt/Z it works, I do NOT get a conflict message with ctrl/alt/P or ctrl/alt/Z.

I looked at %CALIBRE_CONFIG_DIRECTORY%\shortcuts\main.json - couldn't see anything 'out of order'. Given it works with 32 bit v2.9 says to me that its not 'interference' by a 3rd party program.

weird, what

Added 1 :Likewise I've had Open With configured to fire up Sigil with Shift/S for a long time, it's also stopped working in version 2.10, again its something I've been using most every day.

Added 2 :And now ctrl/alt/z has stopped working for View by Publisher - I think I'll go back to 2.9. I ran Check Library on my libraries - no errors reported.

Added 3 :Reinstalled 64bit 2.9 - all keyboard shortcuts appear to be working as expected - looks like something amiss in 2.10

BR

Last edited by BetterRed; 11-14-2014 at 09:46 PM. Reason: Added para about Sigil shortcut
BetterRed is offline  
Old 11-14-2014, 09:57 PM   #2
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont use the plugins you mention, but assigning Ctrl+Alt+P to a builtin action works fine for me.
kovidgoyal is offline  
Advert
Old 11-14-2014, 10:21 PM   #3
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,572
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by kovidgoyal View Post
I dont use the plugins you mention, but assigning Ctrl+Alt+P to a builtin action works fine for me.
When I noticed Shift/S stopped working for Open With->Sigil I changed it to ctrl/alt/p - and it worked - but then ctrl/alt/z stopped worked for the Published Date in View Manager

I considered deleting config\shortcuts\main.json but everything works fine in 2.9 - same libraries, same config data.

Its not a bad download, took one from github and it has same problem - besides problems arising from downloads are normally more serious.

I'll install a fresh 2.10 portable, redo PI installs, and keyboard customisations.

BR
BetterRed is offline  
Old 11-14-2014, 10:27 PM   #4
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There was one change in 2.10 namely, that all entries in submenus of actions are now registered globally, so there is more potential for conflicts, but I dont see how that could cause random keyboard shortcuts to stop working, unless there are actual conflicts.
kovidgoyal is offline  
Old 11-14-2014, 11:18 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,572
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Kovid, there were no conflicts reported for ctrl/alt/p or anything else - my shortcuts/main.json follows, I've not tested all my customisations. I'll do a thorough test when I do the 2.10 portable install as previously mentioned - that wont happen until tomorrow or Monday.

Spoiler:
Code:
{
  "map": {
    "Interface Action: Mark Books (Mark Books) : menu action : clear-all-marked": ["Alt+Shift+M"], 
    "Interface Action: Modify ePub (Modify ePub) - qaction": ["Alt+M"], 
    "Interface Action: Open With (Open With) : menu action : EPUBSigil (EPUB)": ["Shift+S"], 
    "Interface Action: Edit Metadata (Edit Metadata) : menu action : merge formats": ["Ctrl+Alt+9"], 
    "Interface Action: View Manager (View Manager) : menu action : default": ["Ctrl+Alt+D"], 
    "Interface Action: Edit Collections (Edit Collections) - qaction": ["Shift+C"], 
    "Interface Action: Edit Metadata (Edit Metadata) : menu action : merge keep": ["Ctrl+Alt+8"], 
    "highlight search results": ["Ctrl+Alt+H"], 
    "Interface Action: Find Duplicates (Find Duplicates) : menu action : &Previous result": ["Ctrl+Alt+Left"], 
    "clear virtual library": ["Ctrl+Alt+L"], 
    "Interface Action: View Manager (View Manager) : menu action : Published": ["Ctrl+Alt+P"], 
    "Interface Action: Remove Books (Remove Books) : menu action : delete-specific": ["Alt+Del"], 
    "Interface Action: Edit Metadata (Edit Metadata) - qaction": ["M"], 
    "Interface Action: Embed Metadata (Embed Metadata) : menu action : embed-specific": ["Ctrl+E"], 
    "Interface Action: Edit Metadata (Edit Metadata) : menu action : download": ["W"], 
    "Interface Action: Mark Books (Mark Books) - qaction": ["Ctrl+Alt+M"], 
    "Interface Action: Find Duplicates (Find Duplicates) : menu action : &Next result": ["Ctrl+Alt+Right"], 
    "Interface Action: Count Pages (Count Pages) - qaction": ["Alt+C"], 
    "Interface Action: View (View) - qaction": [],
    "focus book list": ["Ctrl+Alt+S"], 
    "Interface Action: View (View) : menu action : specific": ["V", "Alt+V"], 
    "Interface Action: Remove Books (Remove Books) : menu action : delete-all": [], 
    "Interface Action: Extract ISBN (Extract ISBN) - qaction": ["Alt+Y"], 
    "Interface Action: Find Duplicates (Find Duplicates) : menu action : &Clear duplicate results": ["Ctrl+Shift+C"], 
    "Interface Action: Remove Books (Remove Books) : menu action : delete-except": ["Ctrl+Del"], 
    "Interface Action: Tweak ePub (Tweak ePub) - qaction": ["E"], 
    "Interface Action: Help (Help) - qaction": [], 
    "Interface Action: Edit Metadata (Edit Metadata) : menu action : merge": [], 
    "Interface Action: Walk Search History (Walk Search History) : menu action : Clear search history": ["Ctrl+Shift+H"]
  }
}


BR
BetterRed is offline  
Advert
Old 11-15-2014, 10:04 AM   #6
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,322
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
I'm seeing the same problem.

All of the shortcuts I have configured to go to my FFDL plugin are failing with debug log:
Code:
QAction::eventFilter: Ambiguous shortcut overload: 0
QAction::eventFilter: Ambiguous shortcut overload: 1
QAction::eventFilter: Ambiguous shortcut overload: 3
QAction::eventFilter: Ambiguous shortcut overload: Ctrl+L
QAction::eventFilter: Ambiguous shortcut overload: L
I've used most of these for literally years without conflict and the Keyboard settings under config does not indicate that they are conflicting with anything.

Returning to calibre 2.9, they all work again.
JimmXinu is offline  
Old 11-15-2014, 10:19 AM   #7
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Like I said, in 2.10 all keyboard shortcuts from all the popup menus of all plugins/builtin actions are registered globally. This is necessary to make them work on desktops such as OS X and Ubuntu Unity that use global menu bars. So some plugin will likely be using those shortcuts. I suggest disabling your plugins one by one till you find the culprit. Then that plugin should be fixed to make its shortcuts customizable via Preferences->Keyboard.
kovidgoyal is offline  
Old 11-15-2014, 12:12 PM   #8
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,322
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Cutting to the chase, I removed all the plugin zip files except for my own FFDL from the plugin dir (I assume that will work the same as removing via Prefs and let me put them all back easier).

(Many of the plugins I have installed can't be disabled--including my own. Is there some additional part of the plugin API that needs to be implemented for that? I was able to disable Device, File and Metadata plugins, but not UI plugins.)

FFDL does configure keyboard shortcuts by connecting a button to InterfaceActionBase.actual_plugin_.edit_shortcuts. I assume that part is correct.

My short cuts worked until I changed libraries, then they stopped working. Also if I pull up the FFDL menu--both cases where FFDL rebuilds its menu list. The same function is called when the plugin is first initialized.

FFDL can change its menus depending on library settings. At the end of rebuilding its menus, it spins through all it's menu items unregistering them and then calling self.gui.keyboard.finalize() to re-register the ones that need to be:
Code:
            for menu_id, unique_name in self.old_actions_unique_map.iteritems():
                if menu_id not in self.actions_unique_map:
                    self.gui.keyboard.unregister_shortcut(unique_name)
            self.old_actions_unique_map = self.actions_unique_map
            self.gui.keyboard.finalize()
Commenting that block out keeps the short cuts when menus are rebuilt. But without self.gui.keyboard.finalize(), the shortcuts don't appear (visually) on the menu.

I believe I copied that pattern from one of kiwidude's plugins (like everybody else).

Kovid, can you suggest a better way to handle this case--menus and shortcuts that can change by library/settings? Or a pointer to a place in calibre's code that does it better?

I appreciate any guidance you can give me, thanks.
JimmXinu is offline  
Old 11-15-2014, 02:27 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,572
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by JimmXinu View Post
My short cuts worked until I changed libraries, then they stopped working.
That probably explains why my ctrl/alt/z stopped working, I set that sequence to replace ctrl/alt/p in View Manager - I frequently switch back and forth between a handful of physical libraries.

I have often wondered 'how come' it was that a PI such as View Manager could have library specific configurations, whereas its keyboard shortcuts were global. But hey, it worked so my wondering whilst long was also shallow.

Of the 18 optional PI's I have installed, 16 are by kiwidude.

I'll put my investigation with Portable on hold, as a PI Developer JimmXinu is in a much better position that yours truly to help solve the problem.

BR
BetterRed is offline  
Old 11-15-2014, 04:58 PM   #10
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,322
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Quote:
Originally Posted by BetterRed View Post
That probably explains why my ctrl/alt/z stopped working, I set that sequence to replace ctrl/alt/p in View Manager - I frequently switch back and forth between a handful of physical libraries.
...

Of the 18 optional PI's I have installed, 16 are by kiwidude.

I'll put my investigation with Portable on hold, as a PI Developer JimmXinu is in a much better position that yours truly to help solve the problem.
I appreciate the vote of confidence, but this is not a part of QT that I know anything about--I just copied it from kiwidude.

But I have proven that kiwidude's Reading List plugin has the same problem, so it's not just my plugin. I suspect that at least FFDL, Reading List, View Manager and Open With will have this problem.

I'm hoping somebody who understands the shortcuts mechanism better can tell us what we're doing wrong.
JimmXinu is offline  
Old 11-15-2014, 10:41 PM   #11
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'm not clear as to why it needs to register/unregister actions. Why not simply register all possible actions at the start (in genesis), then based on settings enable/disable/show/hide the appropriate actions? That would be the way I would handle it.
kovidgoyal is offline  
Old 11-15-2014, 10:44 PM   #12
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,322
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Quote:
Originally Posted by kovidgoyal View Post
I'm not clear as to why it needs to register/unregister actions. Why not simply register all possible actions at the start (in genesis), then based on settings enable/disable/show/hide the appropriate actions? That would be the way I would handle it.
That is an option for FFDL.

But Reading List, View Manager and Open With all add menu items that can be assigned shortcuts based on what you configure--IE, what Reading Lists you have, what programs you configure to Open With, etc.
JimmXinu is offline  
Old 11-15-2014, 10:52 PM   #13
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes but those will change only in response to configuration, correct? You can just have the plugin ask the user to restart calibre to have the config changes take effect.

Otherwise, if you really want to continue with adding/removing actions dynamically, the only additional wrinkle is that now you have to do

self.gui.removeAction(action_to_be_removed)

in addition to unregistering the shortcut from the keyboard manager.
kovidgoyal is offline  
Old 11-15-2014, 11:19 PM   #14
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,572
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by JimmXinu View Post
That is an option for FFDL.

But Reading List, View Manager and Open With all add menu items that can be assigned shortcuts based on what you configure--IE, what Reading Lists you have, what programs you configure to Open With, etc.
With View Manager the shortcuts are library dependent - see attachment

BR
Attached Thumbnails
Click image for larger version

Name:	Clipboard.jpg
Views:	235
Size:	26.3 KB
ID:	131156  
BetterRed is offline  
Old 11-15-2014, 11:49 PM   #15
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,322
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Okay, I might have a handle on this (maybe). What I think is happening, is:

First, the plugins clear their menu object. Then they recreate and add all the menu items they want to have. And call InterfaceAction.create_menu_action() to create the menu items. Which now calls self.gui.addAction(ac) on each action created to make it available .

So the next time the menu is rebuild, it's adding additional actions to self.gui that are overlapping.

Reading List has (and I lifted) some code to call self.gui.keyboard.unregister_shortcut(unique_name) after menu rebuild, but only on menu items that have been 'removed', IE, not recreated. I honestly don't know why.

But replacing that with a brute force approach appears to work after limited testing: save the menu actions in a list and call unregister_shortcut and removeAction on all of them before rebuilding the menus.
Code:
            for action in self.menu_actions:
                self.gui.keyboard.unregister_shortcut(action.calibre_shortcut_unique_name)
                self.gui.removeAction(action)

            # rebuild menus...

            self.gui.keyboard.finalize()
Are there any obvious reasons not to use this approach?
JimmXinu is offline  
Closed Thread


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard Shortcut: Rename CRB_Clive General Discussions 1 04-01-2014 01:32 PM
Keyboard Shortcut for user created columns dredwerker Calibre 2 07-03-2012 02:44 AM
Replace/customize keyboard shortcut? eosrose Calibre 2 11-10-2011 07:17 PM
Keyboard Shortcut Issue in viewer bigpallooka Calibre 2 10-21-2010 01:32 AM
Add keyboard shortcut? Chris Edwards Amazon Kindle 0 09-25-2010 01:58 PM


All times are GMT -4. The time now is 02:40 PM.


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