Skip to content

Commit

Permalink
Updated snap message dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
szczyglis-dev committed Jan 18, 2025
1 parent b3e8149 commit 1af56a2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
13 changes: 13 additions & 0 deletions src/pygpt_net/plugin/audio_input/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ def start_recording(self, force: bool = False):
:param force: True to force recording
"""
# display snap warning if not displayed yet
if (not self.plugin.window.core.config.get("audio.input.snap", False)
or not self.plugin.window.core.config.has("audio.input.snap")):
if self.plugin.window.core.platforms.is_snap():
self.plugin.window.ui.dialogs.open(
'snap_audio_input',
width=400,
height=200
)
self.plugin.window.core.config.set("audio.input.snap", True)
self.plugin.window.core.config.save()
return

# enable continuous mode if notepad tab is active
self.plugin.window.core.audio.capture.stop_callback = self.on_stop
continuous_enabled = self.plugin.window.core.config.get('audio.input.continuous', False)
Expand Down
9 changes: 5 additions & 4 deletions src/pygpt_net/ui/widget/dialog/snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, window=None):
# layout
self.layout = QVBoxLayout()
self.message = QLabel(
"Camera not connected? It must be connected in Snap environment.\n"
"Camera not connected? It must be connected in the Snap environment.\n"
"Run the following command to enable the camera and restart the application:")
self.message.setStyleSheet("margin: 10px 0px 10px 0px;")
self.layout.addWidget(self.message)
Expand Down Expand Up @@ -64,8 +64,9 @@ def __init__(self, window=None):
# layout
self.layout = QVBoxLayout()
self.message = QLabel(
"Microphone not connected? It must be connected in Snap environment.\n"
"Run the following command to enable the microphone and restart the application:")
"Tip: Microphone must be manually connected in the Snap environment.\n"
"If it is connected, click on the OK button, and this warning will not be displayed again.\n"
"If it is NOT connected yet, run the following command and restart the application:")
self.message.setStyleSheet("margin: 10px 0px 10px 0px;")
self.layout.addWidget(self.message)
self.layout.addWidget(self.cmd)
Expand Down Expand Up @@ -94,7 +95,7 @@ def __init__(self, window=None):
# layout
self.layout = QVBoxLayout()
self.message = QLabel(
"Audio Device not connected? It must be connected in Snap environment.\n"
"Audio Device not connected? It must be connected in the Snap environment.\n"
"Run the following command to enable the audio output and restart the application:")
self.message.setStyleSheet("margin: 10px 0px 10px 0px;")
self.layout.addWidget(self.message)
Expand Down

0 comments on commit 1af56a2

Please sign in to comment.