Toolbar buttons: Instead of needing to click the small arrow next to a button to bring up the list of other actions you can now either right click the button or click-and-hold it.

This commit is contained in:
Kovid Goyal 2011-09-23 17:59:20 -06:00
parent 42879405c8
commit 703216b795
5 changed files with 29 additions and 22 deletions

View File

@ -18,7 +18,6 @@ class ToolBar(QToolBar): # {{{
def __init__(self, donate, location_manager, parent):
QToolBar.__init__(self, parent)
self.setContextMenuPolicy(Qt.PreventContextMenu)
self.setMovable(False)
self.setFloatable(False)
self.setOrientation(Qt.Horizontal)
@ -53,8 +52,14 @@ class ToolBar(QToolBar): # {{{
style = Qt.ToolButtonIconOnly
return style
def contextMenuEvent(self, *args):
pass
def contextMenuEvent(self, ev):
ac = self.actionAt(ev.pos())
if ac is None: return
ch = self.widgetForAction(ac)
sm = getattr(ch, 'showMenu', None)
if callable(sm):
ev.accept()
sm()
def update_lm_actions(self):
for ac in self.added_actions:
@ -108,6 +113,8 @@ class ToolBar(QToolBar): # {{{
ch.setCursor(Qt.PointingHandCursor)
ch.setAutoRaise(True)
if ac.menu() is not None and menu_mode is not None:
if menu_mode == QToolButton.MenuButtonPopup:
menu_mode = QToolButton.DelayedPopup
ch.setPopupMode(menu_mode)
return ch

View File

@ -185,7 +185,7 @@ The first, most important step is to run |app| in debug mode. You can do this fr
calibre-debug -g
Or from within calibre by clicking the arrow next to the preferences button or using the `Ctrl+Shift+R` keyboard shortcut.
Or from within calibre by clicking-and-holding the preferences button or using the `Ctrl+Shift+R` keyboard shortcut.
When running from the command line, debug output will be printed to the console, when running from within |app| the output will go to a txt file.

View File

@ -466,9 +466,9 @@ How do I move my |app| library from one computer to another?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Simply copy the |app| library folder from the old to the new computer. You can find out what the library folder is by clicking the calibre icon in the toolbar. The very first item is the path to the library folder. Now on the new computer, start |app| for the first time. It will run the Welcome Wizard asking you for the location of the |app| library. Point it to the previously copied folder. If the computer you are transferring to already has a calibre installation, then the Welcome wizard wont run. In that case, click the calibre icon in the tooolbar and point it to the newly copied directory. You will now have two calibre libraries on your computer and you can switch between them by clicking the calibre icon on the toolbar.
Note that if you are transferring between different types of computers (for example Windows to OS X) then after doing the above you should also click the arrow next to the calibre icon on the tool bar, select Library Maintenance and run the Check Library action. It will warn you about any problems in your library, which you should fix by hand.
Note that if you are transferring between different types of computers (for example Windows to OS X) then after doing the above you should also click-and-hold the calibre icon on the tool bar, select Library Maintenance and run the Check Library action. It will warn you about any problems in your library, which you should fix by hand.
.. note:: A |app| library is just a folder which contains all the book files and their metadata. All the metadata is stored in a single file called metadata.db, in the top level folder. If this file gets corrupted, you may see an empty list of books in |app|. In this case you can ask |app| to restore your books by clicking the arrow next to the |app| icon on the toolbar and selecting Library Maintenance->Restore Library.
.. note:: A |app| library is just a folder which contains all the book files and their metadata. All the metadata is stored in a single file called metadata.db, in the top level folder. If this file gets corrupted, you may see an empty list of books in |app|. In this case you can ask |app| to restore your books by doing a click-and-hold on the |app| icon in the toolbar and selecting Library Maintenance->Restore Library.
The list of books in |app| is blank!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -477,9 +477,9 @@ In order to understand why that happened, you have to understand what a |app| li
There can be two reasons why |app| is showing a empty list of books:
* Your |app| library folder changed its location. This can happen if it was on an external disk and the drive letter for that disk changed. Or if you accidentally moved the folder. In this case, |app| cannot find its library and so starts up with an empty library instead. To remedy this, simply click the arrow next to the |app| icon in the |app| toolbar (it will say 0 books underneath it) and select Switch/create library. Click the little blue icon to select the new location of your |app| library and click OK.
* Your |app| library folder changed its location. This can happen if it was on an external disk and the drive letter for that disk changed. Or if you accidentally moved the folder. In this case, |app| cannot find its library and so starts up with an empty library instead. To remedy this, do a click-and-hold on the |app| icon in the |app| toolbar (it will say 0 books underneath it) and select Switch/create library. Click the little blue icon to select the new location of your |app| library and click OK.
* Your metadata.db file was deleted/corrupted. In this case, you can ask |app| to rebuild the metadata.db from its backups. Click the arrow next to the |app| icon in the |app| toolbar (it will say 0 books underneath it) and select Library maintenance->Restore database. |app| will automatically rebuild metadata.db.
* Your metadata.db file was deleted/corrupted. In this case, you can ask |app| to rebuild the metadata.db from its backups. Click-and-hold the |app| icon in the |app| toolbar (it will say 0 books underneath it) and select Library maintenance->Restore database. |app| will automatically rebuild metadata.db.
Content From The Web
@ -632,7 +632,7 @@ Can I have the comment metadata show up on my reader?
Most readers do not support this. You should complain to the manufacturer about it and hopefully if enough people complain, things will change. In the meantime, you can insert the metadata, including comments into a "Jacket page" at the start of the ebook, by using the option to "Insert metadata as page at start of book" during conversion. The option is found in the :guilabel:`Structure Detection` section of the conversion settings. Note that for this to have effect you have to *convert* the book. If your book is already in a format that does not need conversion, you can convert from that format to the same format.
Another alternative is to create a catalog in ebook form containing a listing of all the books in your calibre library, with their metadata. Click the arrow next to the convert button to access the catalog creation tool. And before you ask, no you cannot have the catalog "link directly to" books on your reader.
Another alternative is to create a catalog in ebook form containing a listing of all the books in your calibre library, with their metadata. Click-and-hold the convert button to access the catalog creation tool. And before you ask, no you cannot have the catalog "link directly to" books on your reader.
How do I get |app| to use my HTTP proxy?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -30,7 +30,8 @@ Actions
:alt: The Actions Toolbar
:align: center
The actions toolbar provides convenient shortcuts to commonly used actions. Most of the action buttons have little arrows next to them. By clicking the arrows, you can perform variations on the default action. Please note that the actions toolbar will look slightly different depending on whether you have an ebook reader attached to your computer.
The actions toolbar provides convenient shortcuts to commonly used actions. If you click and hold the buttons, you can perform variations on the default action.
Please note that the actions toolbar will look slightly different depending on whether you have an ebook reader attached to your computer.
.. contents::
:depth: 1
@ -43,7 +44,7 @@ Add books
.. |adbi| image:: images/add_books.png
:class: float-right-img
|adbi| The :guilabel:`Add books` action has six variations accessed by the clicking the down arrow on the right side of the button.
|adbi| The :guilabel:`Add books` action has six variations accessed by doing a click-and-hold on the button.
1. **Add books from a single directory**: Opens a file chooser dialog and allows you to specify which books in a directory should be added. This action is *context sensitive*, i.e. it depends on which :ref:`catalog <catalogs>` you have selected. If you have selected the :guilabel:`Library`, books will be added to the library. If you have selected the ebook reader device, the books will be uploaded to the device, and so on.
@ -70,7 +71,7 @@ Edit metadata
.. |emii| image:: images/edit_meta_information.png
:class: float-right-img
|emii| The :guilabel:`Edit metadata` action has four variations which can be accessed by clicking the down arrow on the right side of the button.
|emii| The :guilabel:`Edit metadata` action has four variations which can be accessed by doing a click-and-hold on the button.
1. **Edit metadata individually**: Allows you to edit the metadata of books one-by-one with the option of fetching metadata, including covers, from the Internet. It also allows you to add or remove particular ebook formats from a book.
2. **Edit metadata in bulk**: Allows you to edit common metadata fields for large numbers of books simulataneously. It operates on all the books you have selected in the :ref:`Library view <search_sort>`.
@ -93,7 +94,7 @@ you will have to find tools to liberate your books yourself and then use |app| t
For most people, conversion should be a simple one-click affair. If you want to learn more about the conversion process, see :ref:`conversion`.
The :guilabel:`Convert books` action has three variations, accessed by the arrow next to the button.
The :guilabel:`Convert books` action has three variations, accessed by doing a click-and-hold on the button.
1. **Convert individually**: Allows you to specify conversion options to customize the conversion of each selected ebook.
@ -116,8 +117,7 @@ View
|vi| The :guilabel:`View` action displays the book in an ebook viewer program. |app| has a built-in viewer for many ebook formats.
For other formats it uses the default operating system application. You can configure which formats should open with the internal viewer via
Preferences->Behavior. If a book has more than one format, you can view a particular format by clicking the down arrow
on the right of the :guilabel:`View` button.
Preferences->Behavior. If a book has more than one format, you can view a particular format by doing a click-and-hold on the button.
.. _send_to_device:
@ -127,7 +127,7 @@ Send to device
.. |stdi| image:: images/send_to_device.png
:class: float-right-img
|stdi| The :guilabel:`Send to device` action has eight variations, accessed by clicking the down arrow on the right of the button.
|stdi| The :guilabel:`Send to device` action has eight variations, accessed by doing a click-and-hold on the button.
1. **Send to main memory**: The selected books are transferred to the main memory of the ebook reader.
2. **Send to card (A)**: The selected books are transferred to the storage card (A) on the ebook reader.
@ -152,7 +152,7 @@ Fetch news
The :guilabel:`Fetch news` action uses simple recipes (10-15 lines of code) for each news site. To learn how to create recipes for your own news sources, see :ref:`news`.
The :guilabel:`Fetch news` action has three variations, accessed by clicking the down arrow on the right of the button.
The :guilabel:`Fetch news` action has three variations, accessed by doing a click and hold on the button.
1. **Schedule news download**: Allows you to schedule the download of of your selected news sources from a list of hundreds available. Scheduling can be set individually for each news source you select and the scheduling is flexible allowing you to select specific days of the week or a frequency of days between downloads.
2. **Add a custom news source**: Allows you to create a simple recipe for downloading news from a custom news site that you wish to access. Creating the recipe can be as simple as specifying an RSS news feed URL, or you can be more prescriptive by creating Python-based code for the task. For more information see :ref:`news`.
@ -197,7 +197,7 @@ Save to disk
.. |svdi| image:: images/save_to_disk.png
:class: float-right-img
|svdi| The :guilabel:`Save to disk` action has five variations, accessed by the arrow next to the button.
|svdi| The :guilabel:`Save to disk` action has five variations, accessed by doing a click-and-hold on the button.
.. _save_to_disk_multiple:
@ -231,7 +231,7 @@ Connect/Share
|csi| The :guilabel:`Connect/Share` action allows you to manually connect to a device or folder on your computer. It also allows you to set up you |app| library for access via a web browser or email.
The :guilabel:`Connect/Share` action has four variations, accessed by clicking the down arrow on the right of the button.
The :guilabel:`Connect/Share` action has four variations, accessed by doing a click-and-hold on the button.
1. **Connect to folder**: Allows you to connect to any folder on your computer as though it were a device and use all the facilities |app| has for devices with that folder. Useful if your device cannot be supported by |app| but is available as a USB disk.
@ -248,7 +248,7 @@ Remove books
.. |rbi| image:: images/remove_books.png
:class: float-right-img
|rbi| The :guilabel:`Remove books` action **deletes books permanently**, so use it with care. It is *context sensitive*, i.e. it depends on which :ref:`catalog <catalogs>` you have selected. If you have selected the :guilabel:`Library`, books will be removed from the library. If you have selected the ebook reader device, books will be removed from the device. To remove only a particular format for a given book use the :ref:`edit_meta_information` action. Remove books also has five variations which can be accessed by clicking the down arrow on the right side of the button.
|rbi| The :guilabel:`Remove books` action **deletes books permanently**, so use it with care. It is *context sensitive*, i.e. it depends on which :ref:`catalog <catalogs>` you have selected. If you have selected the :guilabel:`Library`, books will be removed from the library. If you have selected the ebook reader device, books will be removed from the device. To remove only a particular format for a given book use the :ref:`edit_meta_information` action. Remove books also has five variations which can be accessed by doing a click-and-hold on the button.
1. **Remove selected books**: Allows you to **permanently** remove all books that are selected in the book list.
@ -272,7 +272,7 @@ Preferences
.. |cbi| image:: images/preferences.png
:class: float-right-img
|cbi| The :guilabel:`Preferences` action allows you to change the way various aspects of |app| work. It has four variations, accessed by clicking the down arrow on the right of the button.
|cbi| The :guilabel:`Preferences` action allows you to change the way various aspects of |app| work. It has four variations, accessed by doing a click-and-hold on the button.
1. **Preferences**: Allows you to change the way various aspects of |app| work. Clicking the button also performs this action.
2. **Run welcome wizard**: Allows you to start the Welcome Wizard which appeared the first time you started |app|.

View File

@ -83,6 +83,6 @@ Search and replace is done after all the other metadata changes in the other tab
Bulk downloading of metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you want to download the metadata for multiple books at once, click the arrow next to the :guilabel:`Edit metadata` button and select :guilabel:`Download metadata and covers`. You can choose to download only metadata, only covers, both or only social metadata (tags/rating/series).
If you want to download the metadata for multiple books at once, click and hold the :guilabel:`Edit metadata` button and select :guilabel:`Download metadata`. You can choose to download only metadata, only covers, or both.