pygpt-net 2.6.21__py3-none-any.whl → 2.6.23__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pygpt_net/CHANGELOG.txt +12 -0
- pygpt_net/__init__.py +3 -3
- pygpt_net/app.py +3 -1
- pygpt_net/controller/__init__.py +4 -8
- pygpt_net/controller/access/voice.py +2 -2
- pygpt_net/controller/agent/llama.py +3 -0
- pygpt_net/controller/assistant/batch.py +2 -3
- pygpt_net/controller/assistant/editor.py +2 -2
- pygpt_net/controller/assistant/files.py +2 -3
- pygpt_net/controller/assistant/store.py +2 -2
- pygpt_net/controller/audio/audio.py +2 -2
- pygpt_net/controller/chat/response.py +4 -0
- pygpt_net/controller/ctx/ctx.py +2 -1
- pygpt_net/controller/files/files.py +24 -55
- pygpt_net/controller/idx/indexer.py +85 -76
- pygpt_net/controller/lang/lang.py +52 -34
- pygpt_net/controller/model/importer.py +2 -2
- pygpt_net/controller/notepad/notepad.py +86 -84
- pygpt_net/controller/plugins/settings.py +3 -4
- pygpt_net/controller/settings/profile.py +105 -124
- pygpt_net/controller/theme/menu.py +154 -57
- pygpt_net/controller/theme/nodes.py +51 -44
- pygpt_net/controller/theme/theme.py +33 -9
- pygpt_net/controller/tools/tools.py +2 -2
- pygpt_net/controller/ui/tabs.py +2 -3
- pygpt_net/core/agents/observer/evaluation.py +2 -2
- pygpt_net/core/agents/runners/loop.py +1 -0
- pygpt_net/core/bridge/bridge.py +2 -0
- pygpt_net/core/ctx/container.py +13 -12
- pygpt_net/core/ctx/output.py +7 -4
- pygpt_net/core/debug/console/console.py +2 -2
- pygpt_net/core/filesystem/actions.py +1 -2
- pygpt_net/core/filesystem/opener.py +261 -0
- pygpt_net/core/filesystem/url.py +13 -10
- pygpt_net/core/platforms/platforms.py +5 -4
- pygpt_net/core/render/plain/helpers.py +2 -5
- pygpt_net/core/render/plain/renderer.py +26 -30
- pygpt_net/core/render/web/body.py +1 -1
- pygpt_net/core/settings/settings.py +43 -13
- pygpt_net/core/tabs/tabs.py +20 -13
- pygpt_net/data/config/config.json +4 -4
- pygpt_net/data/config/models.json +3 -3
- pygpt_net/data/css/web-blocks.dark.css +7 -1
- pygpt_net/data/css/web-blocks.light.css +5 -2
- pygpt_net/data/css/web-chatgpt.dark.css +7 -1
- pygpt_net/data/css/web-chatgpt.light.css +3 -0
- pygpt_net/data/css/web-chatgpt_wide.dark.css +7 -1
- pygpt_net/data/css/web-chatgpt_wide.light.css +3 -0
- pygpt_net/data/locale/locale.de.ini +5 -1
- pygpt_net/data/locale/locale.en.ini +5 -1
- pygpt_net/data/locale/locale.es.ini +5 -1
- pygpt_net/data/locale/locale.fr.ini +5 -1
- pygpt_net/data/locale/locale.it.ini +5 -1
- pygpt_net/data/locale/locale.pl.ini +6 -4
- pygpt_net/data/locale/locale.uk.ini +5 -1
- pygpt_net/data/locale/locale.zh.ini +5 -1
- pygpt_net/plugin/twitter/plugin.py +2 -2
- pygpt_net/provider/core/config/patch.py +12 -1
- pygpt_net/tools/audio_transcriber/ui/dialogs.py +44 -54
- pygpt_net/tools/code_interpreter/body.py +1 -2
- pygpt_net/tools/code_interpreter/tool.py +7 -4
- pygpt_net/tools/code_interpreter/ui/html.py +1 -3
- pygpt_net/tools/code_interpreter/ui/widgets.py +2 -3
- pygpt_net/tools/html_canvas/ui/widgets.py +1 -3
- pygpt_net/tools/image_viewer/ui/dialogs.py +40 -37
- pygpt_net/tools/indexer/ui/widgets.py +2 -4
- pygpt_net/tools/media_player/tool.py +2 -5
- pygpt_net/tools/media_player/ui/widgets.py +60 -36
- pygpt_net/tools/text_editor/ui/widgets.py +18 -19
- pygpt_net/tools/translator/ui/widgets.py +39 -35
- pygpt_net/ui/base/context_menu.py +9 -4
- pygpt_net/ui/dialog/db.py +1 -3
- pygpt_net/ui/dialog/models.py +1 -3
- pygpt_net/ui/dialog/models_importer.py +2 -4
- pygpt_net/ui/dialogs.py +34 -30
- pygpt_net/ui/layout/chat/attachments.py +72 -84
- pygpt_net/ui/layout/chat/attachments_ctx.py +40 -44
- pygpt_net/ui/layout/chat/attachments_uploaded.py +36 -39
- pygpt_net/ui/layout/chat/calendar.py +100 -70
- pygpt_net/ui/layout/chat/chat.py +23 -17
- pygpt_net/ui/layout/chat/input.py +95 -118
- pygpt_net/ui/layout/chat/output.py +100 -162
- pygpt_net/ui/layout/chat/painter.py +89 -61
- pygpt_net/ui/layout/ctx/ctx_list.py +43 -52
- pygpt_net/ui/layout/status.py +23 -14
- pygpt_net/ui/layout/toolbox/agent.py +27 -38
- pygpt_net/ui/layout/toolbox/agent_llama.py +41 -45
- pygpt_net/ui/layout/toolbox/assistants.py +42 -38
- pygpt_net/ui/layout/toolbox/computer_env.py +32 -23
- pygpt_net/ui/layout/toolbox/footer.py +13 -16
- pygpt_net/ui/layout/toolbox/image.py +18 -21
- pygpt_net/ui/layout/toolbox/indexes.py +46 -89
- pygpt_net/ui/layout/toolbox/mode.py +20 -7
- pygpt_net/ui/layout/toolbox/model.py +12 -10
- pygpt_net/ui/layout/toolbox/presets.py +68 -52
- pygpt_net/ui/layout/toolbox/prompt.py +31 -58
- pygpt_net/ui/layout/toolbox/toolbox.py +25 -21
- pygpt_net/ui/layout/toolbox/vision.py +20 -22
- pygpt_net/ui/main.py +2 -4
- pygpt_net/ui/menu/about.py +64 -84
- pygpt_net/ui/menu/audio.py +87 -63
- pygpt_net/ui/menu/config.py +121 -127
- pygpt_net/ui/menu/debug.py +69 -76
- pygpt_net/ui/menu/file.py +32 -35
- pygpt_net/ui/menu/menu.py +2 -3
- pygpt_net/ui/menu/plugins.py +69 -33
- pygpt_net/ui/menu/theme.py +45 -46
- pygpt_net/ui/menu/tools.py +56 -60
- pygpt_net/ui/menu/video.py +20 -25
- pygpt_net/ui/tray.py +1 -2
- pygpt_net/ui/widget/audio/bar.py +1 -3
- pygpt_net/ui/widget/audio/input_button.py +3 -4
- pygpt_net/ui/widget/calendar/select.py +1 -2
- pygpt_net/ui/widget/dialog/base.py +12 -9
- pygpt_net/ui/widget/dialog/editor_file.py +20 -23
- pygpt_net/ui/widget/dialog/find.py +25 -24
- pygpt_net/ui/widget/dialog/profile.py +57 -53
- pygpt_net/ui/widget/draw/painter.py +62 -93
- pygpt_net/ui/widget/element/button.py +42 -30
- pygpt_net/ui/widget/element/checkbox.py +23 -15
- pygpt_net/ui/widget/element/group.py +6 -5
- pygpt_net/ui/widget/element/labels.py +1 -2
- pygpt_net/ui/widget/filesystem/explorer.py +93 -102
- pygpt_net/ui/widget/image/display.py +1 -2
- pygpt_net/ui/widget/lists/assistant.py +1 -2
- pygpt_net/ui/widget/lists/attachment.py +1 -2
- pygpt_net/ui/widget/lists/attachment_ctx.py +1 -2
- pygpt_net/ui/widget/lists/context.py +2 -4
- pygpt_net/ui/widget/lists/index.py +1 -2
- pygpt_net/ui/widget/lists/model.py +1 -2
- pygpt_net/ui/widget/lists/model_editor.py +1 -2
- pygpt_net/ui/widget/lists/model_importer.py +1 -2
- pygpt_net/ui/widget/lists/preset.py +1 -2
- pygpt_net/ui/widget/lists/preset_plugins.py +1 -2
- pygpt_net/ui/widget/lists/profile.py +1 -2
- pygpt_net/ui/widget/lists/uploaded.py +1 -2
- pygpt_net/ui/widget/option/checkbox.py +2 -4
- pygpt_net/ui/widget/option/checkbox_list.py +1 -4
- pygpt_net/ui/widget/option/cmd.py +1 -4
- pygpt_net/ui/widget/option/dictionary.py +25 -28
- pygpt_net/ui/widget/option/input.py +1 -3
- pygpt_net/ui/widget/tabs/Input.py +16 -12
- pygpt_net/ui/widget/tabs/body.py +5 -3
- pygpt_net/ui/widget/tabs/layout.py +41 -28
- pygpt_net/ui/widget/tabs/output.py +442 -85
- pygpt_net/ui/widget/textarea/calendar_note.py +1 -2
- pygpt_net/ui/widget/textarea/editor.py +41 -73
- pygpt_net/ui/widget/textarea/find.py +11 -10
- pygpt_net/ui/widget/textarea/html.py +3 -6
- pygpt_net/ui/widget/textarea/input.py +134 -69
- pygpt_net/ui/widget/textarea/notepad.py +54 -38
- pygpt_net/ui/widget/textarea/output.py +65 -54
- pygpt_net/ui/widget/textarea/search_input.py +5 -4
- pygpt_net/ui/widget/textarea/web.py +2 -4
- pygpt_net/ui/widget/vision/camera.py +2 -31
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/METADATA +38 -174
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/RECORD +160 -159
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/LICENSE +0 -0
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/WHEEL +0 -0
- {pygpt_net-2.6.21.dist-info → pygpt_net-2.6.23.dist-info}/entry_points.txt +0 -0
pygpt_net/ui/menu/debug.py
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date:
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtGui import QAction
|
|
@@ -25,83 +25,76 @@ class Debug:
|
|
|
25
25
|
|
|
26
26
|
def setup(self):
|
|
27
27
|
"""Setup debug menu"""
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
self.window.ui.menu['debug.plugins'] = QAction(trans("menu.debug.plugins"), self.window, checkable=True)
|
|
33
|
-
self.window.ui.menu['debug.attachments'] = QAction(trans("menu.debug.attachments"), self.window, checkable=True)
|
|
34
|
-
self.window.ui.menu['debug.assistants'] = QAction(trans("menu.debug.assistants"), self.window, checkable=True)
|
|
35
|
-
self.window.ui.menu['debug.agent'] = QAction(trans("menu.debug.agent"), self.window, checkable=True)
|
|
36
|
-
self.window.ui.menu['debug.events'] = QAction(trans("menu.debug.events"), self.window, checkable=True)
|
|
37
|
-
self.window.ui.menu['debug.indexes'] = QAction(trans("menu.debug.indexes"), self.window, checkable=True)
|
|
38
|
-
self.window.ui.menu['debug.ui'] = QAction(trans("menu.debug.ui"), self.window, checkable=True)
|
|
39
|
-
self.window.ui.menu['debug.tabs'] = QAction(trans("menu.debug.tabs"), self.window, checkable=True)
|
|
40
|
-
self.window.ui.menu['debug.db'] = QAction(trans("menu.debug.db"), self.window, checkable=True)
|
|
41
|
-
self.window.ui.menu['debug.logger'] = QAction(trans("menu.debug.logger"), self.window, checkable=True)
|
|
42
|
-
self.window.ui.menu['debug.app.log'] = QAction(trans("menu.debug.app.log"), self.window, checkable=True)
|
|
43
|
-
self.window.ui.menu['debug.kernel'] = QAction(trans("menu.debug.kernel"), self.window, checkable=True)
|
|
44
|
-
self.window.ui.menu['debug.render'] = QAction(trans("menu.debug.render"), self.window, checkable=True)
|
|
28
|
+
win = self.window
|
|
29
|
+
ui = win.ui
|
|
30
|
+
m = ui.menu
|
|
31
|
+
dbg = win.controller.debug
|
|
45
32
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
lambda: self.window.controller.debug.toggle_logger())
|
|
68
|
-
self.window.ui.menu['debug.ui'].triggered.connect(
|
|
69
|
-
lambda: self.window.controller.debug.toggle('ui'))
|
|
70
|
-
self.window.ui.menu['debug.tabs'].triggered.connect(
|
|
71
|
-
lambda: self.window.controller.debug.toggle('tabs'))
|
|
72
|
-
self.window.ui.menu['debug.app.log'].triggered.connect(
|
|
73
|
-
lambda: self.window.controller.debug.toggle_app_log())
|
|
74
|
-
self.window.ui.menu['debug.db'].triggered.connect(
|
|
75
|
-
lambda: self.window.controller.debug.toggle('db'))
|
|
76
|
-
self.window.ui.menu['debug.kernel'].triggered.connect(
|
|
77
|
-
lambda: self.window.controller.debug.toggle('kernel'))
|
|
78
|
-
self.window.ui.menu['debug.render'].triggered.connect(
|
|
79
|
-
lambda: self.window.controller.debug.toggle_render())
|
|
33
|
+
keys = (
|
|
34
|
+
'config',
|
|
35
|
+
'context',
|
|
36
|
+
'presets',
|
|
37
|
+
'models',
|
|
38
|
+
'plugins',
|
|
39
|
+
'attachments',
|
|
40
|
+
'assistants',
|
|
41
|
+
'agent',
|
|
42
|
+
'events',
|
|
43
|
+
'indexes',
|
|
44
|
+
'ui',
|
|
45
|
+
'tabs',
|
|
46
|
+
'db',
|
|
47
|
+
'logger',
|
|
48
|
+
'app.log',
|
|
49
|
+
'kernel',
|
|
50
|
+
'render'
|
|
51
|
+
)
|
|
52
|
+
for k in keys:
|
|
53
|
+
m[f'debug.{k}'] = QAction(trans(f"menu.debug.{k}"), win, checkable=True)
|
|
80
54
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
self.window.ui.menu['menu.debug'].addAction(self.window.ui.menu['debug.plugins'])
|
|
97
|
-
self.window.ui.menu['menu.debug'].addAction(self.window.ui.menu['debug.presets'])
|
|
98
|
-
self.window.ui.menu['menu.debug'].addAction(self.window.ui.menu['debug.tabs'])
|
|
99
|
-
self.window.ui.menu['menu.debug'].addAction(self.window.ui.menu['debug.ui'])
|
|
55
|
+
for k in ('config',
|
|
56
|
+
'context',
|
|
57
|
+
'presets',
|
|
58
|
+
'models',
|
|
59
|
+
'plugins',
|
|
60
|
+
'attachments',
|
|
61
|
+
'assistants',
|
|
62
|
+
'agent',
|
|
63
|
+
'events',
|
|
64
|
+
'indexes',
|
|
65
|
+
'ui',
|
|
66
|
+
'tabs',
|
|
67
|
+
'db',
|
|
68
|
+
'kernel'):
|
|
69
|
+
m[f'debug.{k}'].triggered.connect(lambda _=False, kk=k: dbg.toggle(kk))
|
|
100
70
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
else:
|
|
105
|
-
self.window.ui.menu['debug.render'].setChecked(False)
|
|
71
|
+
m['debug.logger'].triggered.connect(dbg.toggle_logger)
|
|
72
|
+
m['debug.app.log'].triggered.connect(dbg.toggle_app_log)
|
|
73
|
+
m['debug.render'].triggered.connect(dbg.toggle_render)
|
|
106
74
|
|
|
75
|
+
m['menu.debug'] = win.menuBar().addMenu(trans("menu.debug"))
|
|
76
|
+
menu = m['menu.debug']
|
|
77
|
+
menu.addActions(
|
|
78
|
+
[m['debug.logger'],
|
|
79
|
+
m['debug.render'],
|
|
80
|
+
m['debug.db'],
|
|
81
|
+
m['debug.app.log']]
|
|
82
|
+
)
|
|
83
|
+
menu.addSeparator()
|
|
84
|
+
menu.addActions([
|
|
85
|
+
m['debug.agent'],
|
|
86
|
+
m['debug.assistants'],
|
|
87
|
+
m['debug.attachments'],
|
|
88
|
+
m['debug.config'],
|
|
89
|
+
m['debug.context'],
|
|
90
|
+
m['debug.events'],
|
|
91
|
+
m['debug.indexes'],
|
|
92
|
+
m['debug.kernel'],
|
|
93
|
+
m['debug.models'],
|
|
94
|
+
m['debug.plugins'],
|
|
95
|
+
m['debug.presets'],
|
|
96
|
+
m['debug.tabs'],
|
|
97
|
+
m['debug.ui'],
|
|
98
|
+
])
|
|
107
99
|
|
|
100
|
+
m['debug.render'].setChecked(bool(win.core.config.get('debug.render')))
|
pygpt_net/ui/menu/file.py
CHANGED
|
@@ -6,13 +6,12 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date:
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtGui import QAction, QIcon
|
|
13
13
|
|
|
14
14
|
from pygpt_net.utils import trans
|
|
15
|
-
import pygpt_net.icons_rc
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
class File:
|
|
@@ -26,43 +25,41 @@ class File:
|
|
|
26
25
|
|
|
27
26
|
def setup(self):
|
|
28
27
|
"""Setup file menu"""
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
w = self.window
|
|
29
|
+
m = w.ui.menu
|
|
30
|
+
ctx = w.controller.ctx
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
icon_logout = QIcon(":/icons/logout.svg")
|
|
33
|
+
icon_delete = QIcon(":/icons/delete.svg")
|
|
34
|
+
icon_add = QIcon(":/icons/add.svg")
|
|
35
|
+
icon_folder = QIcon(":/icons/folder_filled.svg")
|
|
36
|
+
icon_fullscreen = QIcon(":/icons/fullscreen.svg")
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
trans("menu.file.group.new"), self.window)
|
|
41
|
-
self.window.ui.menu['app.ctx.current'] = QAction(QIcon(":/icons/fullscreen.svg"), trans("menu.file.current"), self.window)
|
|
38
|
+
m['app.exit'] = QAction(icon_logout, trans("menu.file.exit"), w, shortcut="Ctrl+Q", triggered=w.close)
|
|
39
|
+
m['app.exit'].setMenuRole(QAction.MenuRole.NoRole)
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
)
|
|
46
|
-
self.window.ui.menu['app.clear_history_groups'].triggered.connect(
|
|
47
|
-
lambda: self.window.controller.ctx.delete_history_groups()
|
|
48
|
-
)
|
|
41
|
+
m['app.clear_history'] = QAction(icon_delete, trans("menu.file_clear_history"), w)
|
|
42
|
+
m['app.clear_history_groups'] = QAction(icon_delete, trans("menu.file_clear_history_groups"), w)
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
self.window.ui.menu['app.ctx.group.new'].triggered.connect(
|
|
55
|
-
lambda: self.window.controller.ctx.new_group()
|
|
56
|
-
)
|
|
44
|
+
m['app.ctx.new'] = QAction(icon_add, trans("menu.file.new"), w)
|
|
45
|
+
m['app.ctx.group.new'] = QAction(icon_folder, trans("menu.file.group.new"), w)
|
|
46
|
+
m['app.ctx.current'] = QAction(icon_fullscreen, trans("menu.file.current"), w)
|
|
57
47
|
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
m['app.clear_history'].triggered.connect(ctx.delete_history)
|
|
49
|
+
m['app.clear_history_groups'].triggered.connect(ctx.delete_history_groups)
|
|
50
|
+
m['app.ctx.new'].triggered.connect(ctx.new_ungrouped) # new context without group
|
|
51
|
+
m['app.ctx.group.new'].triggered.connect(ctx.new_group)
|
|
52
|
+
m['app.ctx.current'].triggered.connect(
|
|
53
|
+
lambda checked=False: ctx.select_by_current(True)
|
|
60
54
|
) # new context without group
|
|
61
55
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
m['menu.app'] = w.menuBar().addMenu(trans("menu.file"))
|
|
57
|
+
m_app = m['menu.app']
|
|
58
|
+
m_app.addActions([
|
|
59
|
+
m['app.ctx.new'],
|
|
60
|
+
m['app.ctx.group.new'],
|
|
61
|
+
m['app.ctx.current'],
|
|
62
|
+
m['app.clear_history'],
|
|
63
|
+
m['app.clear_history_groups'],
|
|
64
|
+
m['app.exit'],
|
|
65
|
+
])
|
pygpt_net/ui/menu/menu.py
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date: 2025.
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from .about import About
|
|
@@ -56,6 +56,5 @@ class Menu:
|
|
|
56
56
|
self.about.setup()
|
|
57
57
|
|
|
58
58
|
# debug menu
|
|
59
|
-
show = self.window.core.config.get('debug')
|
|
60
59
|
self.debug.setup()
|
|
61
|
-
self.window.ui.menu['menu.debug'].menuAction().setVisible(
|
|
60
|
+
self.window.ui.menu['menu.debug'].menuAction().setVisible(self.window.core.config.get('debug'))
|
pygpt_net/ui/menu/plugins.py
CHANGED
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date:
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtGui import QAction, QIcon
|
|
13
13
|
from PySide6.QtWidgets import QMenu
|
|
14
14
|
|
|
15
15
|
from pygpt_net.utils import trans
|
|
16
|
-
import pygpt_net.icons_rc
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
class Plugins:
|
|
@@ -27,34 +26,71 @@ class Plugins:
|
|
|
27
26
|
|
|
28
27
|
def setup(self):
|
|
29
28
|
"""Setup plugins menu"""
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
QIcon(":/icons/
|
|
43
|
-
|
|
44
|
-
lambda
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
29
|
+
w = self.window
|
|
30
|
+
ui_menu = w.ui.menu
|
|
31
|
+
plugins_ctrl = w.controller.plugins
|
|
32
|
+
|
|
33
|
+
txt_plugins = trans("menu.plugins")
|
|
34
|
+
txt_settings = trans("menu.plugins.settings")
|
|
35
|
+
txt_presets = trans("menu.plugins.presets")
|
|
36
|
+
txt_presets_new = trans("menu.plugins.presets.new")
|
|
37
|
+
txt_presets_edit = trans("menu.plugins.presets.edit")
|
|
38
|
+
|
|
39
|
+
settings_action = ui_menu.get('plugins.settings')
|
|
40
|
+
if settings_action is None:
|
|
41
|
+
settings_action = QAction(QIcon(":/icons/settings_filled.svg"), txt_settings, w)
|
|
42
|
+
settings_action.setMenuRole(QAction.MenuRole.NoRole)
|
|
43
|
+
settings_action.triggered.connect(lambda _=False, f=plugins_ctrl.settings.toggle_editor: f())
|
|
44
|
+
ui_menu['plugins.settings'] = settings_action
|
|
45
|
+
else:
|
|
46
|
+
settings_action.setText(txt_settings)
|
|
47
|
+
settings_action.setIcon(QIcon(":/icons/settings_filled.svg"))
|
|
48
|
+
settings_action.setMenuRole(QAction.MenuRole.NoRole)
|
|
49
|
+
|
|
50
|
+
ui_menu.setdefault('plugins_presets', {})
|
|
51
|
+
presets_menu = ui_menu.get('menu.plugins.presets')
|
|
52
|
+
if presets_menu is None:
|
|
53
|
+
presets_menu = QMenu(txt_presets, w)
|
|
54
|
+
ui_menu['menu.plugins.presets'] = presets_menu
|
|
55
|
+
else:
|
|
56
|
+
presets_menu.setTitle(txt_presets)
|
|
57
|
+
|
|
58
|
+
new_action = ui_menu.get('plugins.presets.new')
|
|
59
|
+
if new_action is None:
|
|
60
|
+
new_action = QAction(QIcon(":/icons/add.svg"), txt_presets_new, w, checkable=False)
|
|
61
|
+
new_action.triggered.connect(lambda _=False, f=plugins_ctrl.presets.new: f())
|
|
62
|
+
new_action.setMenuRole(QAction.MenuRole.NoRole)
|
|
63
|
+
ui_menu['plugins.presets.new'] = new_action
|
|
64
|
+
else:
|
|
65
|
+
new_action.setText(txt_presets_new)
|
|
66
|
+
new_action.setIcon(QIcon(":/icons/add.svg"))
|
|
67
|
+
new_action.setMenuRole(QAction.MenuRole.NoRole)
|
|
68
|
+
if new_action not in presets_menu.actions():
|
|
69
|
+
presets_menu.addAction(new_action)
|
|
70
|
+
|
|
71
|
+
edit_action = ui_menu.get('plugins.presets.edit')
|
|
72
|
+
if edit_action is None:
|
|
73
|
+
edit_action = QAction(QIcon(":/icons/edit.svg"), txt_presets_edit, w, checkable=False)
|
|
74
|
+
edit_action.triggered.connect(lambda _=False, f=plugins_ctrl.presets.toggle_editor: f())
|
|
75
|
+
edit_action.setMenuRole(QAction.MenuRole.NoRole)
|
|
76
|
+
ui_menu['plugins.presets.edit'] = edit_action
|
|
77
|
+
else:
|
|
78
|
+
edit_action.setText(txt_presets_edit)
|
|
79
|
+
edit_action.setIcon(QIcon(":/icons/edit.svg"))
|
|
80
|
+
edit_action.setMenuRole(QAction.MenuRole.NoRole)
|
|
81
|
+
if edit_action not in presets_menu.actions():
|
|
82
|
+
presets_menu.addAction(edit_action)
|
|
83
|
+
|
|
84
|
+
ui_menu.setdefault('plugins', {})
|
|
85
|
+
plugins_menu = ui_menu.get('menu.plugins')
|
|
86
|
+
if plugins_menu is None:
|
|
87
|
+
plugins_menu = w.menuBar().addMenu(txt_plugins)
|
|
88
|
+
ui_menu['menu.plugins'] = plugins_menu
|
|
89
|
+
else:
|
|
90
|
+
plugins_menu.setTitle(txt_plugins)
|
|
91
|
+
|
|
92
|
+
if presets_menu.menuAction() not in plugins_menu.actions():
|
|
93
|
+
plugins_menu.addMenu(presets_menu)
|
|
94
|
+
if settings_action not in plugins_menu.actions():
|
|
95
|
+
plugins_menu.addAction(settings_action)
|
|
96
|
+
plugins_menu.setToolTipsVisible(True)
|
pygpt_net/ui/menu/theme.py
CHANGED
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
# GitHub: https://github.com/szczyglis-dev/py-gpt #
|
|
7
7
|
# MIT License #
|
|
8
8
|
# Created By : Marcin Szczygliński #
|
|
9
|
-
# Updated Date:
|
|
9
|
+
# Updated Date: 2025.08.24 23:00:00 #
|
|
10
10
|
# ================================================== #
|
|
11
11
|
|
|
12
12
|
from PySide6.QtGui import QAction, QIcon
|
|
13
13
|
from PySide6.QtWidgets import QMenu
|
|
14
14
|
|
|
15
15
|
from pygpt_net.utils import trans
|
|
16
|
-
import pygpt_net.icons_rc
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
class Theme:
|
|
@@ -24,55 +23,55 @@ class Theme:
|
|
|
24
23
|
:param window: Window instance
|
|
25
24
|
"""
|
|
26
25
|
self.window = window
|
|
26
|
+
self._loaded = False
|
|
27
|
+
|
|
28
|
+
def _on_toggle_tooltips(self, checked=False):
|
|
29
|
+
self.window.controller.theme.toggle_option('layout.tooltips')
|
|
30
|
+
|
|
31
|
+
def _open_settings(self, checked=False):
|
|
32
|
+
self.window.controller.settings.open_section('layout')
|
|
27
33
|
|
|
28
34
|
def setup(self):
|
|
29
35
|
"""Setup theme menu"""
|
|
30
|
-
self.window
|
|
31
|
-
|
|
32
|
-
self.window.ui.menu['theme_syntax'] = {}
|
|
33
|
-
self.window.ui.menu['theme.layout.density'] = {}
|
|
34
|
-
self.window.ui.menu['menu.theme'] = QMenu(trans("menu.theme"), self.window)
|
|
36
|
+
w = self.window
|
|
37
|
+
m = w.ui.menu
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
if self._loaded:
|
|
40
|
+
act = m.get('theme.tooltips')
|
|
41
|
+
if isinstance(act, QAction):
|
|
42
|
+
act.setChecked(w.core.config.get('layout.tooltips'))
|
|
43
|
+
return
|
|
38
44
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
m['theme'] = {}
|
|
46
|
+
m['theme_style'] = {}
|
|
47
|
+
m['theme_syntax'] = {}
|
|
48
|
+
m['theme.layout.density'] = {}
|
|
49
|
+
m['menu.theme'] = QMenu(trans("menu.theme"), w)
|
|
43
50
|
|
|
44
|
-
|
|
45
|
-
self.window.ui.menu['theme.density'] = QMenu(trans("menu.theme.density"), self.window)
|
|
51
|
+
m['theme.style'] = QMenu(trans("menu.theme.style"), w)
|
|
46
52
|
|
|
47
|
-
""
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
m['theme.dark'] = QMenu(trans("menu.theme.dark"), w)
|
|
54
|
+
m['theme.light'] = QMenu(trans("menu.theme.light"), w)
|
|
55
|
+
m['theme.syntax'] = QMenu(trans("menu.theme.syntax"), w)
|
|
56
|
+
|
|
57
|
+
m['theme.density'] = QMenu(trans("menu.theme.density"), w)
|
|
58
|
+
|
|
59
|
+
m['theme.tooltips'] = QAction(trans("menu.theme.tooltips"), w, checkable=True)
|
|
60
|
+
m['theme.tooltips'].triggered.connect(self._on_toggle_tooltips)
|
|
61
|
+
m['theme.tooltips'].setChecked(w.core.config.get('layout.tooltips'))
|
|
62
|
+
|
|
63
|
+
m['theme.settings'] = QAction(QIcon(":/icons/settings_filled.svg"),
|
|
64
|
+
trans("menu.theme.settings"), w)
|
|
65
|
+
m['theme.settings'].setMenuRole(QAction.MenuRole.NoRole)
|
|
66
|
+
m['theme.settings'].triggered.connect(self._open_settings)
|
|
67
|
+
|
|
68
|
+
menu_theme = m['menu.theme']
|
|
69
|
+
menu_theme.addMenu(m['theme.style'])
|
|
70
|
+
menu_theme.addMenu(m['theme.dark'])
|
|
71
|
+
menu_theme.addMenu(m['theme.light'])
|
|
72
|
+
menu_theme.addMenu(m['theme.syntax'])
|
|
73
|
+
menu_theme.addMenu(m['theme.density'])
|
|
74
|
+
menu_theme.addAction(m['theme.tooltips'])
|
|
75
|
+
menu_theme.addAction(m['theme.settings'])
|
|
55
76
|
|
|
56
|
-
|
|
57
|
-
self.window.ui.menu['theme.tooltips'] = QAction(trans("menu.theme.tooltips"), self.window, checkable=True)
|
|
58
|
-
self.window.ui.menu['theme.tooltips'].triggered.connect(
|
|
59
|
-
lambda: self.window.controller.theme.toggle_option('layout.tooltips'))
|
|
60
|
-
self.window.ui.menu['theme.tooltips'].setCheckable(True)
|
|
61
|
-
self.window.ui.menu['theme.tooltips'].setChecked(self.window.core.config.get('layout.tooltips'))
|
|
62
|
-
|
|
63
|
-
# settings
|
|
64
|
-
self.window.ui.menu['theme.settings'] = QAction(QIcon(":/icons/settings_filled.svg"),
|
|
65
|
-
trans("menu.theme.settings"), self.window)
|
|
66
|
-
self.window.ui.menu['theme.settings'].setMenuRole(QAction.MenuRole.NoRole)
|
|
67
|
-
|
|
68
|
-
self.window.ui.menu['theme.settings'].triggered.connect(
|
|
69
|
-
lambda: self.window.controller.settings.open_section('layout'))
|
|
70
|
-
|
|
71
|
-
self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.style'])
|
|
72
|
-
self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.dark'])
|
|
73
|
-
self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.light'])
|
|
74
|
-
self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.syntax'])
|
|
75
|
-
self.window.ui.menu['menu.theme'].addMenu(self.window.ui.menu['theme.density'])
|
|
76
|
-
# self.window.ui.menu['menu.theme'].addAction(self.window.ui.menu['theme.blocks'])
|
|
77
|
-
self.window.ui.menu['menu.theme'].addAction(self.window.ui.menu['theme.tooltips'])
|
|
78
|
-
self.window.ui.menu['menu.theme'].addAction(self.window.ui.menu['theme.settings'])
|
|
77
|
+
self._loaded = True
|