Skip to content

Commit

Permalink
Merge pull request #139 from Integration-Automation/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
JE-Chen authored Jun 20, 2024
2 parents 7df478f + 79823c2 commit e5896ed
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,7 @@ dmypy.json
# User setting
**/.jeditor

.idea/misc.xml
/.idea
.idea/misc.xml
/.idea
2 changes: 1 addition & 1 deletion dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description = "JEditor is basic but powerful editor include GPT"
requires-python = ">=3.9"
license = { text = "MIT" }
dependencies = [
"PySide6", "qt-material", "yapf", "frontengine", "pycodestyle", "jedi", "qtconsole"
"PySide6", "qt-material", "yapf", "frontengine", "pycodestyle", "jedi", "qtconsole", "re-edge-gpt[gui]"
]
classifiers = [
"Programming Language :: Python :: 3.9",
Expand Down
2 changes: 1 addition & 1 deletion exe/a.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
print("你好")
print("你好")
3 changes: 2 additions & 1 deletion exe/user_setting.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"language": "Traditional_Chinese"
"language": "Traditional_Chinese",
"theme": "dark_amber.xml"
}
2 changes: 1 addition & 1 deletion je_editor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
from je_editor.utils.exception.exceptions import JEditorOpenFileException
from je_editor.utils.exception.exceptions import JEditorRunOnShellException
from je_editor.utils.exception.exceptions import JEditorSaveFileException
from je_editor.utils.multi_language.traditional_chinese import traditional_chinese_word_dict
from je_editor.utils.multi_language.english import english_word_dict
from je_editor.utils.multi_language.multi_language_wrapper import language_wrapper
from je_editor.utils.multi_language.traditional_chinese import traditional_chinese_word_dict

__all__ = [
"start_editor", "EditorMain", "EDITOR_EXTEND_TAB",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pathlib import Path
from typing import TYPE_CHECKING


if TYPE_CHECKING:
from je_editor.pyside_ui.main_ui.editor.editor_widget import EditorWidget
from je_editor.pyside_ui.main_ui.editor.editor_widget_dock import FullEditorWidget
Expand Down
15 changes: 15 additions & 0 deletions je_editor/pyside_ui/main_ui/menu/tab_menu/build_tab_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from je_editor.pyside_ui.browser.browser_widget import JEBrowser
from je_editor.pyside_ui.main_ui.editor.editor_widget import EditorWidget
from je_editor.pyside_ui.main_ui.ipython_widget.rich_jupyter import IpythonWidget
from re_edge_gpt.ui.chat.main_ui import ChatMainUI

if TYPE_CHECKING:
from je_editor.pyside_ui.main_ui.main_editor import EditorMain
Expand Down Expand Up @@ -53,6 +54,13 @@ def set_tab_menu(ui_we_want_to_set: EditorMain) -> None:
lambda: add_ipython(ui_we_want_to_set)
)
ui_we_want_to_set.tab_menu.addAction(ui_we_want_to_set.tab_menu.add_ipython_action)
# ReEdgeGPT
ui_we_want_to_set.tab_menu.add_re_edge_gpt_action = QAction(
language_wrapper.language_word_dict.get("tab_menu_re_re_edge_gpt_tab_name"))
ui_we_want_to_set.tab_menu.add_re_edge_gpt_action.triggered.connect(
lambda: add_re_edge_gpt(ui_we_want_to_set)
)
ui_we_want_to_set.tab_menu.addAction(ui_we_want_to_set.tab_menu.add_re_edge_gpt_action)


def add_editor_tab(ui_we_want_to_set: EditorMain):
Expand Down Expand Up @@ -90,3 +98,10 @@ def add_ipython(ui_we_want_to_set: EditorMain):
IpythonWidget(ui_we_want_to_set),
f"{language_wrapper.language_word_dict.get('tab_menu_ipython_tab_name')} "
f"{ui_we_want_to_set.tab_widget.count()}")


def add_re_edge_gpt(ui_we_want_to_set: EditorMain):
ui_we_want_to_set.tab_widget.addTab(
ChatMainUI(),
f"{language_wrapper.language_word_dict.get('tab_name_re_edge_gpt')} "
f"{ui_we_want_to_set.tab_widget.count()}")
2 changes: 1 addition & 1 deletion je_editor/start_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from je_editor.pyside_ui.main_ui.main_editor import EditorMain


def start_editor(debug_mode: bool = False, ) -> None:
def start_editor(debug_mode: bool = False) -> None:
new_editor = QCoreApplication.instance()
if new_editor is None:
new_editor = QApplication(sys.argv)
Expand Down
2 changes: 2 additions & 0 deletions je_editor/utils/multi_language/english.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"tab_name_editor": "Editor",
"tab_name_web_browser": "Web Browser",
"tab_name_frontengine": "FrontEngine",
"tab_name_re_edge_gpt": "Re-EdgeGPT",
# Browser
"browser_download_detail": "Download Detail",
"browser_find_text": "Find Text",
Expand Down Expand Up @@ -107,6 +108,7 @@
"tab_menu_web_tab_name": "WEB Browser",
"tab_menu_stackoverflow_tab_name": "Stackoverflow",
"tab_menu_ipython_tab_name": "IPython(Jupyter)",
"tab_menu_re_re_edge_gpt_tab_name": "ReEdgeGPT",
# Text Menu
"text_menu_label": "Text",
"text_menu_label_font": "Font",
Expand Down
2 changes: 2 additions & 0 deletions je_editor/utils/multi_language/traditional_chinese.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"tab_name_editor": "編輯器",
"tab_name_web_browser": "網頁瀏覽器",
"tab_name_frontengine": "前景引擎",
"tab_name_re_edge_gpt": "Re-EdgeGPT",
# Browser
"browser_download_detail": "下載資訊",
"browser_find_text": "搜尋文字",
Expand Down Expand Up @@ -105,6 +106,7 @@
"tab_menu_web_tab_name": "瀏覽器",
"tab_menu_stackoverflow_tab_name": "Stackoverflow",
"tab_menu_ipython_tab_name": "IPython(Jupyter)",
"tab_menu_re_re_edge_gpt_tab_name": "ReEdgeGPT",
# Text Menu
"text_menu_label": "文字",
"text_menu_label_font": "字體",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description = "JEditor is basic but powerful editor include GPT"
requires-python = ">=3.9"
license = { text = "MIT" }
dependencies = [
"PySide6", "qt-material", "yapf", "frontengine", "pycodestyle", "jedi", "qtconsole"
"PySide6", "qt-material", "yapf", "frontengine", "pycodestyle", "jedi", "qtconsole", "re-edge-gpt[gui]"
]
classifiers = [
"Programming Language :: Python :: 3.9",
Expand Down

0 comments on commit e5896ed

Please sign in to comment.