コード例 #1
0
ファイル: CategoryList.py プロジェクト: Alex-ZL/ljn
    def __init__(self, parent):
        QListWidget.__init__(self, parent)

        self.update_categories()
        self.addAction(create_widget_action(self, "F2", self._rename_category))
        self.addAction(create_widget_action(self, "Del", self._del_category))
        self.addAction(create_widget_action(self, "CTRL+N", self._new_category))
コード例 #2
0
ファイル: ArticleList.py プロジェクト: Alex-ZL/ljn
    def __init__(self, parent):
        QListWidget.__init__(self, parent)

        self.category_id = None
        self.update_articles()
        self.addAction(create_widget_action(self, "F2", self._rename_article))
        self.addAction(create_widget_action(self, "Del", self._del_article))
        self.addAction(create_widget_action(self, "CTRL+N", self._new_article))
コード例 #3
0
ファイル: WordList.py プロジェクト: Alex-ZL/ljn
    def __init__(self, parent):
        QListWidget.__init__(self, parent)

        self.article_id = None
        self.update_words()

        self.itemDoubleClicked.connect(self._select_item)
        self.addAction(create_widget_action(self, "Return", self._select_item))
        self.addAction(create_widget_action(self, "Delete", self._delete_item))
コード例 #4
0
ファイル: MainWindow.py プロジェクト: Alex-ZL/ljn
    def window_init(self, window):
        ab = window.article_browser
        if hasattr(window, 'word_director'):
            ab.onArticleLoaded.connect(partial(window.word_director._update_word_list, window))

        if hasattr(window, 'list_director'):
            ab.addAction(create_widget_action(ab, "ESC", partial(window.list_director._set_focus_to_list, window)))
コード例 #5
0
    def __init__(self, parent):
        QTextEdit.__init__(self, parent)

        self.setStyleSheet(STYLE_SHEET)
        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(self._on_context_menu)

        self.addAction(create_widget_action(self, "Alt+Return", self._show_article_property))

        self.article_id = None
        self.new_words = []
        self.highlight = ArticleHighlight(self)
コード例 #6
0
ファイル: MainWindow.py プロジェクト: Alex-ZL/ljn
    def window_init(self, window):
        cl = window.category_list
        cl.itemDoubleClicked.connect(partial(self._open_category, window))
        cl.addAction(create_widget_action(cl, "Return", partial(self._open_category, window)))

        al = window.article_list
        al.addAction(create_widget_action(al, "Backspace", partial(self._show_category_list, window)))

        if hasattr(window, 'article_browser_director'):
            action = create_widget_action(window, "ESC", window.article_browser.setFocus)
            al.addAction(action)
            cl.addAction(action)

            al.itemDoubleClicked.connect(partial(self._open_article, window))
            al.onArticleCreated.connect(partial(self._open_new_article, window))
            al.addAction(create_widget_action(al, "Return", partial(self._open_article, window)))

        window.addAction(create_app_action(window, 'CTRL+L', partial(self._toggle_dock_pane_view, window)))

        cl.setFocus()
        if cl.count() > 0:
            cl.setCurrentRow(0)