Skip to content

Commit 79823c2

Browse files
committed
Add re-edge-gpt tab
Add re-edge-gpt tab
1 parent da0f969 commit 79823c2

File tree

8 files changed

+25
-4
lines changed

8 files changed

+25
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,4 @@ dmypy.json
119119
.idea/misc.xml
120120
/.idea
121121
.idea/misc.xml
122+
/.idea

dev.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description = "JEditor is basic but powerful editor include GPT"
1414
requires-python = ">=3.9"
1515
license = { text = "MIT" }
1616
dependencies = [
17-
"PySide6", "qt-material", "yapf", "frontengine", "pycodestyle", "jedi", "qtconsole"
17+
"PySide6", "qt-material", "yapf", "frontengine", "pycodestyle", "jedi", "qtconsole", "re-edge-gpt[gui]"
1818
]
1919
classifiers = [
2020
"Programming Language :: Python :: 3.9",

exe/user_setting.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"language": "Traditional_Chinese"
2+
"language": "Traditional_Chinese",
3+
"theme": "dark_amber.xml"
34
}

je_editor/pyside_ui/main_ui/menu/tab_menu/build_tab_menu.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from je_editor.pyside_ui.browser.browser_widget import JEBrowser
88
from je_editor.pyside_ui.main_ui.editor.editor_widget import EditorWidget
99
from je_editor.pyside_ui.main_ui.ipython_widget.rich_jupyter import IpythonWidget
10+
from re_edge_gpt.ui.chat.main_ui import ChatMainUI
1011

1112
if TYPE_CHECKING:
1213
from je_editor.pyside_ui.main_ui.main_editor import EditorMain
@@ -53,6 +54,13 @@ def set_tab_menu(ui_we_want_to_set: EditorMain) -> None:
5354
lambda: add_ipython(ui_we_want_to_set)
5455
)
5556
ui_we_want_to_set.tab_menu.addAction(ui_we_want_to_set.tab_menu.add_ipython_action)
57+
# ReEdgeGPT
58+
ui_we_want_to_set.tab_menu.add_re_edge_gpt_action = QAction(
59+
language_wrapper.language_word_dict.get("tab_menu_re_re_edge_gpt_tab_name"))
60+
ui_we_want_to_set.tab_menu.add_re_edge_gpt_action.triggered.connect(
61+
lambda: add_re_edge_gpt(ui_we_want_to_set)
62+
)
63+
ui_we_want_to_set.tab_menu.addAction(ui_we_want_to_set.tab_menu.add_re_edge_gpt_action)
5664

5765

5866
def add_editor_tab(ui_we_want_to_set: EditorMain):
@@ -90,3 +98,10 @@ def add_ipython(ui_we_want_to_set: EditorMain):
9098
IpythonWidget(ui_we_want_to_set),
9199
f"{language_wrapper.language_word_dict.get('tab_menu_ipython_tab_name')} "
92100
f"{ui_we_want_to_set.tab_widget.count()}")
101+
102+
103+
def add_re_edge_gpt(ui_we_want_to_set: EditorMain):
104+
ui_we_want_to_set.tab_widget.addTab(
105+
ChatMainUI(),
106+
f"{language_wrapper.language_word_dict.get('tab_name_re_edge_gpt')} "
107+
f"{ui_we_want_to_set.tab_widget.count()}")

je_editor/start_editor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from je_editor.pyside_ui.main_ui.main_editor import EditorMain
88

99

10-
def start_editor(debug_mode: bool = False, ) -> None:
10+
def start_editor(debug_mode: bool = False) -> None:
1111
new_editor = QCoreApplication.instance()
1212
if new_editor is None:
1313
new_editor = QApplication(sys.argv)

je_editor/utils/multi_language/english.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"tab_name_editor": "Editor",
66
"tab_name_web_browser": "Web Browser",
77
"tab_name_frontengine": "FrontEngine",
8+
"tab_name_re_edge_gpt": "Re-EdgeGPT",
89
# Browser
910
"browser_download_detail": "Download Detail",
1011
"browser_find_text": "Find Text",
@@ -107,6 +108,7 @@
107108
"tab_menu_web_tab_name": "WEB Browser",
108109
"tab_menu_stackoverflow_tab_name": "Stackoverflow",
109110
"tab_menu_ipython_tab_name": "IPython(Jupyter)",
111+
"tab_menu_re_re_edge_gpt_tab_name": "ReEdgeGPT",
110112
# Text Menu
111113
"text_menu_label": "Text",
112114
"text_menu_label_font": "Font",

je_editor/utils/multi_language/traditional_chinese.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"tab_name_editor": "編輯器",
66
"tab_name_web_browser": "網頁瀏覽器",
77
"tab_name_frontengine": "前景引擎",
8+
"tab_name_re_edge_gpt": "Re-EdgeGPT",
89
# Browser
910
"browser_download_detail": "下載資訊",
1011
"browser_find_text": "搜尋文字",
@@ -105,6 +106,7 @@
105106
"tab_menu_web_tab_name": "瀏覽器",
106107
"tab_menu_stackoverflow_tab_name": "Stackoverflow",
107108
"tab_menu_ipython_tab_name": "IPython(Jupyter)",
109+
"tab_menu_re_re_edge_gpt_tab_name": "ReEdgeGPT",
108110
# Text Menu
109111
"text_menu_label": "文字",
110112
"text_menu_label_font": "字體",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description = "JEditor is basic but powerful editor include GPT"
1414
requires-python = ">=3.9"
1515
license = { text = "MIT" }
1616
dependencies = [
17-
"PySide6", "qt-material", "yapf", "frontengine", "pycodestyle", "jedi", "qtconsole"
17+
"PySide6", "qt-material", "yapf", "frontengine", "pycodestyle", "jedi", "qtconsole", "re-edge-gpt[gui]"
1818
]
1919
classifiers = [
2020
"Programming Language :: Python :: 3.9",

0 commit comments

Comments
 (0)