Logo Search packages:      
Sourcecode: rabbitvcs version File versions  Download package

rabbitvcs::lib::contextmenuitems::MenuItem Class Reference

Inherited by rabbitvcs-plugin::MenuIgnoreByFileExtension, rabbitvcs-plugin::MenuIgnoreByFilename, rabbitvcs::lib::contextmenuitems::MenuAbout, rabbitvcs::lib::contextmenuitems::MenuAdd, rabbitvcs::lib::contextmenuitems::MenuAddToIgnoreList, rabbitvcs::lib::contextmenuitems::MenuAnnotate, rabbitvcs::lib::contextmenuitems::MenuApplyPatch, rabbitvcs::lib::contextmenuitems::MenuBranchTag, rabbitvcs::lib::contextmenuitems::MenuBrowseTo, rabbitvcs::lib::contextmenuitems::MenuBugs, rabbitvcs::lib::contextmenuitems::MenuCheckForModifications, rabbitvcs::lib::contextmenuitems::MenuCheckout, rabbitvcs::lib::contextmenuitems::MenuCleanup, rabbitvcs::lib::contextmenuitems::MenuCommit, rabbitvcs::lib::contextmenuitems::MenuCompareTool, rabbitvcs::lib::contextmenuitems::MenuCompareToolMultiple, rabbitvcs::lib::contextmenuitems::MenuCompareToolPrevRev, rabbitvcs::lib::contextmenuitems::MenuCreatePatch, rabbitvcs::lib::contextmenuitems::MenuCreateRepository, rabbitvcs::lib::contextmenuitems::MenuDebug, rabbitvcs::lib::contextmenuitems::MenuDebugAddEmblem, rabbitvcs::lib::contextmenuitems::MenuDebugInvalidate, rabbitvcs::lib::contextmenuitems::MenuDebugRevert, rabbitvcs::lib::contextmenuitems::MenuDebugShell, rabbitvcs::lib::contextmenuitems::MenuDelete, rabbitvcs::lib::contextmenuitems::MenuDiff, rabbitvcs::lib::contextmenuitems::MenuDiffMenu, rabbitvcs::lib::contextmenuitems::MenuDiffMultiple, rabbitvcs::lib::contextmenuitems::MenuDiffPrevRev, rabbitvcs::lib::contextmenuitems::MenuExport, rabbitvcs::lib::contextmenuitems::MenuGetLock, rabbitvcs::lib::contextmenuitems::MenuHelp, rabbitvcs::lib::contextmenuitems::MenuImport, rabbitvcs::lib::contextmenuitems::MenuMerge, rabbitvcs::lib::contextmenuitems::MenuOpen, rabbitvcs::lib::contextmenuitems::MenuProperties, rabbitvcs::lib::contextmenuitems::MenuRabbitVCS, rabbitvcs::lib::contextmenuitems::MenuRefreshStatus, rabbitvcs::lib::contextmenuitems::MenuRelocate, rabbitvcs::lib::contextmenuitems::MenuRename, rabbitvcs::lib::contextmenuitems::MenuRepoBrowser, rabbitvcs::lib::contextmenuitems::MenuResolve, rabbitvcs::lib::contextmenuitems::MenuRestore, rabbitvcs::lib::contextmenuitems::MenuRevert, rabbitvcs::lib::contextmenuitems::MenuSeparator, rabbitvcs::lib::contextmenuitems::MenuSettings, rabbitvcs::lib::contextmenuitems::MenuShowChanges, rabbitvcs::lib::contextmenuitems::MenuShowLog, rabbitvcs::lib::contextmenuitems::MenuSwitch, rabbitvcs::lib::contextmenuitems::MenuUnlock, rabbitvcs::lib::contextmenuitems::MenuUpdate, rabbitvcs::lib::contextmenuitems::MenuUpdateToRevision, rabbitvcs::lib::contextmenuitems::PropMenuDelete, rabbitvcs::lib::contextmenuitems::PropMenuDeleteRecursive, rabbitvcs::lib::contextmenuitems::PropMenuEdit, rabbitvcs::lib::contextmenuitems::PropMenuRevert, rabbitvcs::lib::contextmenuitems::PropMenuRevertRecursive, rabbitvcs::ui::browser::MenuBrowserCopyTo, rabbitvcs::ui::browser::MenuBrowserCopyUrlToClipboard, rabbitvcs::ui::browser::MenuBrowserMoveTo, rabbitvcs::ui::browser::MenuCreateRepositoryFolder, rabbitvcs::ui::changes::MenuCompare, rabbitvcs::ui::changes::MenuOpenFirst, rabbitvcs::ui::changes::MenuOpenSecond, rabbitvcs::ui::changes::MenuViewDiff, rabbitvcs::ui::checkmods::MenuCompare, rabbitvcs::ui::checkmods::MenuViewDiff, rabbitvcs::ui::log::MenuComparePreviousRevision, rabbitvcs::ui::log::MenuCompareRevisions, rabbitvcs::ui::log::MenuCompareWorkingCopy, rabbitvcs::ui::log::MenuEditAuthor, rabbitvcs::ui::log::MenuEditAuthor, rabbitvcs::ui::log::MenuEditLogMessage, rabbitvcs::ui::log::MenuEditRevisionProperties, rabbitvcs::ui::log::MenuShowChangesPreviousRevision, rabbitvcs::ui::log::MenuShowChangesRevisions, rabbitvcs::ui::log::MenuViewDiffPreviousRevision, rabbitvcs::ui::log::MenuViewDiffRevisions, and rabbitvcs::ui::log::MenuViewDiffWorkingCopy.

List of all members.


Detailed Description

This is the base class for a definition of a menu item. Consider this
"abstract" (in the language of Java) - it makes no sense to instantiate it
directly. If you want to define a new kind of menu item, you need to
subclass it like so:

class MenuPerformMagic:
    identifier = "RabbitVCS::Perform_Magic"
    label = _("Perform Magic")
    tooltip = _("Put on your robe and wizard hat")
    icon = "rabbitvcs-wand" # or, say, gtk.STOCK_OPEN

There is some introspection magic that goes on to associate the items
themselves with certain methods of a ContextMenuCondition object or a
ContextMenuCallback object. This is done by looking at the identifier - the
part of the identifier after "::" is converted to lowercase and the item
looks for a method of that name (eg. in the example above,
"perform_magic").

It is easy to override this, just define condition_name and callback_name
to be what you need. If the item cannot find anything, it defaults to not
assigning the callback and having the condition return False.

There a few ways to organise this (and maybe it would be better to have the
GtkContextMenu class do it), but this is it for the moment.

Definition at line 38 of file contextmenuitems.py.


Public Member Functions

def __init__
def default_condition
def make_action
def make_default_name
def make_gtk_menu_item
def make_magic_id
def make_nautilus_menu_item
def make_thunar_action
def show

Public Attributes

 callback
 condition
 found_callback
 found_condition
 signals

Static Public Attributes

tuple callback_args = ()
 callback_name = None
tuple condition_args = ()
 condition_name = None
 icon = None
 identifier = None
string IDENTIFIER_SEPARATOR = "::"
 label = None
string tooltip = ""

Private Member Functions

def _get_function

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index