def get_actions(self): def BothAction(name1, *args): return [Action(name1, *args), ToggleAction(name1 + " Tool", *args)] return (map( lambda x: Action(*x), [ # finding ("Find In Page", gtk.STOCK_FIND, _("_Find In Page..."), "<control>F", None, lambda w: self._editor.find_dialog.on_find(False)), ("Find Next In Page", gtk.STOCK_FIND, _("Find _Next In Page..."), "<control>G", None, lambda w: self ._editor.find_dialog.on_find(False, forward=True)), ("Find Previous In Page", gtk.STOCK_FIND, _("Find Pre_vious In Page..."), "<control><shift>G", None, lambda w: self._editor.find_dialog.on_find(False, forward=False)), ("Replace In Page", gtk.STOCK_FIND_AND_REPLACE, _("_Replace In Page..."), "<control>R", None, lambda w: self._editor.find_dialog.on_find(True)), ]) + [ ToggleAction("Spell Check", None, _("_Spell Check"), "", None, self.on_spell_check_toggle) ])
def _get_actions(self): actions = map( lambda x: Action(*x), [("New Tab", None, _("New _Tab"), "<shift><control>T", _("Open a new tab"), lambda w: self.new_tab()), ("Close Tab", None, _("Close _Tab"), "<shift><control>W", _("Close a tab"), lambda w: self.close_tab()), ("Next Tab", None, _("_Next Tab"), "<control>Page_Down", _("Switch to next tab"), lambda w: self.switch_tab(1)), ("Previous Tab", None, _("_Previous Tab"), "<control>Page_Up", _("Switch to previous tab"), lambda w: self.switch_tab(-1))]) return actions
def BothAction(name1, *args): return [Action(name1, *args), ToggleAction(name1 + " Tool", *args)]
def _get_actions(self): """Returns actions for view's UI""" return map(lambda x: Action(*x), [ ("treeview_popup", None, "", "", None, lambda w: None), ("listview_popup", None, "", "", None, lambda w: None), ("Copy Tree", gtk.STOCK_COPY, _("Copy _Tree"), "<control><shift>C", _("Copy entire tree"), lambda w: self.on_copy_tree()), ("New Page", gtk.STOCK_NEW, _("New _Page"), "<control>N", _("Create a new page"), lambda w: self.on_new_page(), "note-new.png"), ("New Child Page", gtk.STOCK_NEW, _("New _Child Page"), "<control><shift>N", _("Create a new child page"), lambda w: self.on_new_child_page(), "note-new.png"), ("New Folder", gtk.STOCK_DIRECTORY, _("New _Folder"), "<control><shift>M", _("Create a new folder"), lambda w: self.on_new_dir(), "folder-new.png"), ("Attach File", gtk.STOCK_ADD, _("_Attach File..."), "", _("Attach a file to the notebook"), lambda w: self._on_attach_file_menu()), ("Back", gtk.STOCK_GO_BACK, _("_Back"), "", None, lambda w: self.visit_history(-1)), ("Forward", gtk.STOCK_GO_FORWARD, _("_Forward"), "", None, lambda w: self.visit_history(1)), ("Go to Note", gtk.STOCK_JUMP_TO, _("Go to _Note"), "", None, lambda w: self.on_goto_node(None, None)), ("Go to Parent Note", gtk.STOCK_GO_BACK, _("Go to _Parent Note"), "<shift><alt>Left", None, lambda w: self.on_goto_parent_node()), ("Go to Next Note", gtk.STOCK_GO_DOWN, _("Go to Next N_ote"), "<alt>Down", None, lambda w: self.goto_next_node()), ("Go to Previous Note", gtk.STOCK_GO_UP, _("Go to _Previous Note"), "<alt>Up", None, lambda w: self.goto_prev_node()), ("Expand Note", gtk.STOCK_ADD, _("E_xpand Note"), "<alt>Right", None, lambda w: self.expand_node()), ("Collapse Note", gtk.STOCK_REMOVE, _("_Collapse Note"), "<alt>Left", None, lambda w: self.collapse_node()), ("Expand All Child Notes", gtk.STOCK_ADD, _("Expand _All Child Notes"), "<shift><alt>Right", None, lambda w: self.expand_node(True)), ("Collapse All Child Notes", gtk.STOCK_REMOVE, _("Collapse A_ll Child Notes"), "<shift><alt>Left", None, lambda w: self.collapse_node(True)), ("Go to Tree View", None, _("Go to _Tree View"), "<control>T", None, lambda w: self.goto_treeview()), ("Go to List View", None, _("Go to _List View"), "<control>Y", None, lambda w: self.goto_listview()), ("Go to Editor", None, _("Go to _Editor"), "<control>D", None, lambda w: self.goto_editor()), ("Delete Note", gtk.STOCK_DELETE, _("_Delete"), "", None, self.on_delete_node), ("Rename Note", gtk.STOCK_EDIT, _("_Rename"), "", None, lambda w: self._on_rename_node()), ("Change Note Icon", None, _("_Change Note Icon"), "", None, lambda w: None, lookup_icon_filename(None, u"folder-red.png")), ("Change Fg Color", None, _("Change _Fg Color")), ("Change Bg Color", None, _("Change _Bg Color")), ])