Beispiel #1
0
def registerActions(application):
    """
    Зарегистрировать действия
    """
    # Действия, связанные с разными типами страниц
    from outwiker.pages.html.htmlpage import HtmlPageFactory
    HtmlPageFactory.registerActions(application)

    from outwiker.pages.wiki.wikipage import WikiPageFactory
    WikiPageFactory.registerActions(application)

    actionController = application.actionController
    from outwiker.gui.actionslist import actionsList, polyactionsList

    # Register the normal actions
    [
        actionController.register(item[0](application), item[1])
        for item in actionsList
    ]

    # Register the polyactions
    [
        actionController.register(
            PolyAction(application, item[0], item[1], item[2]), item[3])
        for item in polyactionsList
    ]
Beispiel #2
0
    def _registerActions(self, application):
        """
        Зарегистрировать действия
        """
        # Действия, связанные с разными типами страниц
        from outwiker.pages.html.htmlpage import HtmlPageFactory
        HtmlPageFactory.registerActions(application)

        from outwiker.pages.wiki.wikipage import WikiPageFactory
        WikiPageFactory.registerActions(application)

        actionController = application.actionController
        from outwiker.gui.actionslist import actionsList, polyactionsList

        # Register the normal actions
        [actionController.register(item.action_type(application),
                                   item.hotkey,
                                   item.area,
                                   item.hidden)
         for item in actionsList]

        # Register the polyactions
        [actionController.register(PolyAction(application,
                                              item.stringId,
                                              item.title,
                                              item.description),
                                   item.hotkey) for item in polyactionsList]
Beispiel #3
0
def registerActions (application):
    """
    Зарегистрировать действия
    """
    # Действия, связанные с разными типами страниц
    from outwiker.pages.html.htmlpage import HtmlPageFactory
    HtmlPageFactory.registerActions (application)

    from outwiker.pages.wiki.wikipage import WikiPageFactory
    WikiPageFactory.registerActions (application)

    actionController = application.actionController
    from outwiker.gui.actionslist import actionsList, polyactionsList

    # Register the normal actions
    map(lambda item: actionController.register(item[0](application),
                                               item[1]),
        actionsList)

    # Register the polyactions
    map(lambda item: actionController.register(PolyAction(application,
                                                          item[0],
                                                          item[1],
                                                          item[2]),
                                               item[3]),
        polyactionsList)
Beispiel #4
0
def registerActions (application):
    """
    Зарегистрировать действия
    """
    # Действия, связанные с разными типами страниц
    from outwiker.pages.html.htmlpage import HtmlPageFactory
    HtmlPageFactory.registerActions (application)

    from outwiker.pages.wiki.wikipage import WikiPageFactory
    WikiPageFactory.registerActions (application)


    # Открыть...
    from outwiker.actions.open import OpenAction
    application.actionController.register (
        OpenAction (application),
        HotKey ("O", ctrl=True))

    # Создать...
    from outwiker.actions.new import NewAction
    application.actionController.register (
        NewAction (application),
        HotKey ("N", ctrl=True))

    # Открыть только для чтения
    from outwiker.actions.openreadonly import OpenReadOnlyAction
    application.actionController.register (
        OpenReadOnlyAction (application),
        HotKey ("O", ctrl=True, shift=True))

    # Закрыть
    from outwiker.actions.close import CloseAction
    application.actionController.register (
        CloseAction (application),
        HotKey ("W", ctrl=True, shift=True))

    # Сохранить
    from outwiker.actions.save import SaveAction
    application.actionController.register (
        SaveAction (application),
        HotKey ("S", ctrl=True))

    # Печать
    from outwiker.actions.printaction import PrintAction
    application.actionController.register (
        PrintAction (application),
        HotKey ("P", ctrl=True))

    # Выход
    from outwiker.actions.exit import ExitAction
    application.actionController.register (
        ExitAction (application),
        HotKey ("F4", alt=True))

    # Показать / скрыть панель с прикрепленными файлами
    from outwiker.actions.showhideattaches import ShowHideAttachesAction
    application.actionController.register (
        ShowHideAttachesAction (application))

    # Показать / скрыть панель с деревом заметок
    from outwiker.actions.showhidetree import ShowHideTreeAction
    application.actionController.register (
        ShowHideTreeAction (application))

    # Показать / скрыть панель с тегами
    from outwiker.actions.showhidetags import ShowHideTagsAction
    application.actionController.register (
        ShowHideTagsAction (application))

    # Полноэкранный режим
    from outwiker.actions.fullscreen import FullScreenAction
    application.actionController.register (
        FullScreenAction (application),
        HotKey ("F11"))

    # Поиск
    from outwiker.actions.search import SearchAction, SearchNextAction, SearchPrevAction, SearchAndReplaceAction
    application.actionController.register (
        SearchAction (application),
        HotKey ("F", ctrl=True))

    application.actionController.register (
        SearchNextAction (application),
        HotKey ("F3"))

    application.actionController.register (
        SearchPrevAction (application),
        HotKey ("F3", shift=True))

    application.actionController.register (
        SearchAndReplaceAction (application),
        HotKey ("H", ctrl=True))


    # Вызов настроек
    from outwiker.actions.preferences import PreferencesAction
    application.actionController.register (
        PreferencesAction (application),
        HotKey ("F8", ctrl=True))


    # Добавить страницу того же уровня
    from outwiker.actions.addsiblingpage import AddSiblingPageAction
    application.actionController.register (
        AddSiblingPageAction (application),
        HotKey ("T", ctrl=True, alt=True))


    # Добавить дочернюю страницу
    from outwiker.actions.addchildpage import AddChildPageAction
    application.actionController.register (
        AddChildPageAction (application),
        HotKey ("T", ctrl=True, shift=True))


    # Переместить страницу на одну позицию вверх
    from outwiker.actions.movepageup import MovePageUpAction
    application.actionController.register (
        MovePageUpAction (application),
        HotKey ("Up", ctrl=True, shift=True))


    # Переместить страницу на одну позицию вниз
    from outwiker.actions.movepagedown import MovePageDownAction
    application.actionController.register (
        MovePageDownAction (application),
        HotKey ("Down", ctrl=True, shift=True))

    # Сортировка дочерних страниц по алфавиту
    from outwiker.actions.sortchildalpha import SortChildAlphabeticalAction
    application.actionController.register (
        SortChildAlphabeticalAction (application),
        None)


    # Сортировка страниц того же уровня, что и выбранная, по алфавиту
    from outwiker.actions.sortsiblingsalpha import SortSiblingsAlphabeticalAction
    application.actionController.register (
        SortSiblingsAlphabeticalAction (application),
        None)


    # Переименование текущей страницы
    from outwiker.actions.renamepage import RenamePageAction
    application.actionController.register (
        RenamePageAction (application),
        HotKey ("F2"))


    # Удаление текущей страницы
    from outwiker.actions.removepage import RemovePageAction
    application.actionController.register (
        RemovePageAction (application),
        HotKey ("Delete", ctrl=True, shift=True))


    # Редактирование свойств страницы
    from outwiker.actions.editpageprop import EditPagePropertiesAction
    application.actionController.register (
        EditPagePropertiesAction (application),
        HotKey ("E", ctrl=True))


    # Добавление закладки
    from outwiker.actions.addbookmark import AddBookmarkAction
    application.actionController.register (
        AddBookmarkAction (application),
        HotKey ("D", ctrl=True))


    # Добавление вкладки
    from outwiker.actions.tabs import AddTabAction
    application.actionController.register (
        AddTabAction (application),
        HotKey ("T", ctrl=True))


    # Закрытие вкладки
    from outwiker.actions.tabs import CloseTabAction
    application.actionController.register (
        CloseTabAction (application),
        HotKey ("W", ctrl=True))


    # Перейти на предыдущую вкладку
    from outwiker.actions.tabs import PreviousTabAction
    application.actionController.register (
        PreviousTabAction (application),
        HotKey ("PageUp", ctrl=True, shift=True))


    # Перейти на следующую вкладку
    from outwiker.actions.tabs import NextTabAction
    application.actionController.register (
        NextTabAction (application),
        HotKey ("PageDown", ctrl=True, shift=True))


    # Открыть или создать страницу глобального поиска
    from outwiker.actions.globalsearch import GlobalSearchAction
    application.actionController.register (
        GlobalSearchAction (application),
        HotKey ("F", ctrl=True, shift=True))


    # Прикрепить файлы к странице
    from outwiker.actions.attachfiles import AttachFilesAction
    application.actionController.register (
        AttachFilesAction (application),
        HotKey ("A", ctrl=True, alt=True))


    # Открыть папку с прикрепленными файлами
    from outwiker.actions.openattachfolder import OpenAttachFolderAction
    application.actionController.register (
        OpenAttachFolderAction (application),
        HotKey ("A", ctrl=True, shift=True, alt=True))


    import outwiker.actions.clipboard as clipboard

    # Копировать заголовок текущей страницы
    application.actionController.register (
        clipboard.CopyPageTitleAction (application),
        HotKey ("D", ctrl=True, shift=True))


    # Копировать путь до текущей страницы
    application.actionController.register (
        clipboard.CopyPagePathAction (application),
        HotKey ("P", ctrl=True, shift=True))


    # Копировать путь до прикрепленных файлов
    application.actionController.register (
        clipboard.CopyAttachPathAction (application),
        HotKey ("A", ctrl=True, shift=True))


    # Копировать ссылку на текущую страницу
    application.actionController.register (
        clipboard.CopyPageLinkAction (application),
        HotKey ("L", ctrl=True, shift=True))

    import outwiker.actions.tags as tags

    # Добавить метки к ветке
    application.actionController.register (
        tags.AddTagsToBranchAction (application),
        None)

    # Удалить метки из ветки
    application.actionController.register (
        tags.RemoveTagsFromBranchAction (application),
        None)

    # Переименовать метку
    application.actionController.register (
        tags.RenameTagAction (application),
        None)

    # Перезагрузить вики
    from outwiker.actions.reloadwiki import ReloadWikiAction
    application.actionController.register (
        ReloadWikiAction (application),
        HotKey ("R", ctrl=True))

    # Вызов справки
    from outwiker.actions.openhelp import OpenHelpAction
    application.actionController.register (
        OpenHelpAction (application),
        HotKey ("F1"))

    # "О программе"
    from outwiker.actions.about import AboutAction
    application.actionController.register (
        AboutAction (application),
        HotKey ("F1", ctrl=True))

    # Назад
    from outwiker.actions.history import HistoryBackAction, HistoryForwardAction
    application.actionController.register (
        HistoryBackAction (application),
        HotKey ("Left", ctrl=True))

    application.actionController.register (
        HistoryForwardAction (application),
        HotKey ("Right", ctrl=True))


    # Применить стиль страницы ко всей ветке
    from outwiker.actions.applystyle import SetStyleToBranchAction
    application.actionController.register (
        SetStyleToBranchAction (application),
        None)


    from outwiker.actions.openpluginsfolder import OpenPluginsFolderAction
    application.actionController.register (
        OpenPluginsFolderAction (application),
        None)


    _registerPolyActions (application)
Beispiel #5
0
def registerActions(application):
    """
    Зарегистрировать действия
    """
    # Действия, связанные с разными типами страниц
    from outwiker.pages.html.htmlpage import HtmlPageFactory
    HtmlPageFactory.registerActions(application)

    from outwiker.pages.wiki.wikipage import WikiPageFactory
    WikiPageFactory.registerActions(application)

    # Открыть...
    from outwiker.actions.open import OpenAction
    application.actionController.register(OpenAction(application),
                                          HotKey("O", ctrl=True))

    # Создать...
    from outwiker.actions.new import NewAction
    application.actionController.register(NewAction(application),
                                          HotKey("N", ctrl=True))

    # Открыть только для чтения
    from outwiker.actions.openreadonly import OpenReadOnlyAction
    application.actionController.register(OpenReadOnlyAction(application),
                                          HotKey("O", ctrl=True, shift=True))

    # Закрыть
    from outwiker.actions.close import CloseAction
    application.actionController.register(CloseAction(application),
                                          HotKey("W", ctrl=True, shift=True))

    # Сохранить
    from outwiker.actions.save import SaveAction
    application.actionController.register(SaveAction(application),
                                          HotKey("S", ctrl=True))

    # Печать
    from outwiker.actions.printaction import PrintAction
    application.actionController.register(PrintAction(application),
                                          HotKey("P", ctrl=True))

    # Выход
    from outwiker.actions.exit import ExitAction
    application.actionController.register(ExitAction(application),
                                          HotKey("F4", alt=True))

    # Показать / скрыть панель с прикрепленными файлами
    from outwiker.actions.showhideattaches import ShowHideAttachesAction
    application.actionController.register(ShowHideAttachesAction(application))

    # Показать / скрыть панель с деревом заметок
    from outwiker.actions.showhidetree import ShowHideTreeAction
    application.actionController.register(ShowHideTreeAction(application))

    # Показать / скрыть панель с тегами
    from outwiker.actions.showhidetags import ShowHideTagsAction
    application.actionController.register(ShowHideTagsAction(application))

    # Полноэкранный режим
    from outwiker.actions.fullscreen import FullScreenAction
    application.actionController.register(FullScreenAction(application),
                                          HotKey("F11"))

    # Поиск
    from outwiker.actions.search import SearchAction, SearchNextAction, SearchPrevAction, SearchAndReplaceAction
    application.actionController.register(SearchAction(application),
                                          HotKey("F", ctrl=True))

    application.actionController.register(SearchNextAction(application),
                                          HotKey("F3"))

    application.actionController.register(SearchPrevAction(application),
                                          HotKey("F3", shift=True))

    application.actionController.register(SearchAndReplaceAction(application),
                                          HotKey("H", ctrl=True))

    # Вызов настроек
    from outwiker.actions.preferences import PreferencesAction
    application.actionController.register(PreferencesAction(application),
                                          HotKey("F8", ctrl=True))

    # Добавить страницу того же уровня
    from outwiker.actions.addsiblingpage import AddSiblingPageAction
    application.actionController.register(AddSiblingPageAction(application),
                                          HotKey("T", ctrl=True, alt=True))

    # Добавить дочернюю страницу
    from outwiker.actions.addchildpage import AddChildPageAction
    application.actionController.register(AddChildPageAction(application),
                                          HotKey("T", ctrl=True, shift=True))

    # Переместить страницу на одну позицию вверх
    from outwiker.actions.movepageup import MovePageUpAction
    application.actionController.register(MovePageUpAction(application),
                                          HotKey("Up", ctrl=True, shift=True))

    # Переместить страницу на одну позицию вниз
    from outwiker.actions.movepagedown import MovePageDownAction
    application.actionController.register(
        MovePageDownAction(application), HotKey("Down", ctrl=True, shift=True))

    # Сортировка дочерних страниц по алфавиту
    from outwiker.actions.sortchildalpha import SortChildAlphabeticalAction
    application.actionController.register(
        SortChildAlphabeticalAction(application), None)

    # Сортировка страниц того же уровня, что и выбранная, по алфавиту
    from outwiker.actions.sortsiblingsalpha import SortSiblingsAlphabeticalAction
    application.actionController.register(
        SortSiblingsAlphabeticalAction(application), None)

    # Переименование текущей страницы
    from outwiker.actions.renamepage import RenamePageAction
    application.actionController.register(RenamePageAction(application),
                                          HotKey("F2"))

    # Удаление текущей страницы
    from outwiker.actions.removepage import RemovePageAction
    application.actionController.register(
        RemovePageAction(application), HotKey("Delete", ctrl=True, shift=True))

    # Редактирование свойств страницы
    from outwiker.actions.editpageprop import EditPagePropertiesAction
    application.actionController.register(
        EditPagePropertiesAction(application), HotKey("E", ctrl=True))

    # Добавление закладки
    from outwiker.actions.addbookmark import AddBookmarkAction
    application.actionController.register(AddBookmarkAction(application),
                                          HotKey("D", ctrl=True))

    # Добавление вкладки
    from outwiker.actions.tabs import AddTabAction
    application.actionController.register(AddTabAction(application),
                                          HotKey("T", ctrl=True))

    # Закрытие вкладки
    from outwiker.actions.tabs import CloseTabAction
    application.actionController.register(CloseTabAction(application),
                                          HotKey("W", ctrl=True))

    # Перейти на предыдущую вкладку
    from outwiker.actions.tabs import PreviousTabAction
    application.actionController.register(
        PreviousTabAction(application), HotKey("PageUp", ctrl=True,
                                               shift=True))

    # Перейти на следующую вкладку
    from outwiker.actions.tabs import NextTabAction
    application.actionController.register(
        NextTabAction(application), HotKey("PageDown", ctrl=True, shift=True))

    # Открыть или создать страницу глобального поиска
    from outwiker.actions.globalsearch import GlobalSearchAction
    application.actionController.register(GlobalSearchAction(application),
                                          HotKey("F", ctrl=True, shift=True))

    # Прикрепить файлы к странице
    from outwiker.actions.attachfiles import AttachFilesAction
    application.actionController.register(AttachFilesAction(application),
                                          HotKey("A", ctrl=True, alt=True))

    # Открыть папку с прикрепленными файлами
    from outwiker.actions.openattachfolder import OpenAttachFolderAction
    application.actionController.register(
        OpenAttachFolderAction(application),
        HotKey("A", ctrl=True, shift=True, alt=True))

    import outwiker.actions.clipboard as clipboard

    # Копировать заголовок текущей страницы
    application.actionController.register(
        clipboard.CopyPageTitleAction(application),
        HotKey("D", ctrl=True, shift=True))

    # Копировать путь до текущей страницы
    application.actionController.register(
        clipboard.CopyPagePathAction(application),
        HotKey("P", ctrl=True, shift=True))

    # Копировать путь до прикрепленных файлов
    application.actionController.register(
        clipboard.CopyAttachPathAction(application),
        HotKey("A", ctrl=True, shift=True))

    # Копировать ссылку на текущую страницу
    application.actionController.register(
        clipboard.CopyPageLinkAction(application),
        HotKey("L", ctrl=True, shift=True))

    import outwiker.actions.tags as tags

    # Добавить метки к ветке
    application.actionController.register(
        tags.AddTagsToBranchAction(application), None)

    # Удалить метки из ветки
    application.actionController.register(
        tags.RemoveTagsFromBranchAction(application), None)

    # Переименовать метку
    application.actionController.register(tags.RenameTagAction(application),
                                          None)

    # Перезагрузить вики
    from outwiker.actions.reloadwiki import ReloadWikiAction
    application.actionController.register(ReloadWikiAction(application),
                                          HotKey("R", ctrl=True))

    # Вызов справки
    from outwiker.actions.openhelp import OpenHelpAction
    application.actionController.register(OpenHelpAction(application),
                                          HotKey("F1"))

    # "О программе"
    from outwiker.actions.about import AboutAction
    application.actionController.register(AboutAction(application),
                                          HotKey("F1", ctrl=True))

    # Назад
    from outwiker.actions.history import HistoryBackAction, HistoryForwardAction
    application.actionController.register(HistoryBackAction(application),
                                          HotKey("Left", ctrl=True, alt=True))

    application.actionController.register(HistoryForwardAction(application),
                                          HotKey("Right", ctrl=True, alt=True))

    # Применить стиль страницы ко всей ветке
    from outwiker.actions.applystyle import SetStyleToBranchAction
    application.actionController.register(SetStyleToBranchAction(application),
                                          None)

    from outwiker.actions.openpluginsfolder import OpenPluginsFolderAction
    application.actionController.register(OpenPluginsFolderAction(application),
                                          None)

    # Moving on pages
    from outwiker.actions.moving import (GoToParentAction,
                                         GoToFirstChildAction,
                                         GoToNextSiblingAction,
                                         GoToPrevSiblingAction)
    application.actionController.register(GoToParentAction(application),
                                          HotKey("Left", ctrl=True))

    application.actionController.register(GoToFirstChildAction(application),
                                          HotKey("Right", ctrl=True))

    application.actionController.register(GoToNextSiblingAction(application),
                                          HotKey("Down", ctrl=True))

    application.actionController.register(GoToPrevSiblingAction(application),
                                          HotKey("Up", ctrl=True))

    _registerPolyActions(application)