Skip to content

Commit 7460c00

Browse files
committed
Added sounds for opening and closing info dialog.
1 parent 2ce49df commit 7460c00

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

ui/dialogs/info_dialog.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from PyQt6.QtGui import QKeySequence, QClipboard
55
from ui.widgets.qText_edit import ReadOnlyTextEdit
66
from utils.universal_speech import UniversalSpeech
7+
from utils.audio_player import SoundEffectPlayer
78

89

910
class InfoDialog(QDialog):
@@ -14,6 +15,9 @@ def __init__(self, title: str, label: str, text: str, is_html_content: bool = Fa
1415
self.text = text
1516
self.is_html_content = is_html_content
1617
self.init_ui()
18+
self.effects_manager = SoundEffectPlayer("Audio/sounds")
19+
self.effects_manager.play("open")
20+
1721

1822
def init_ui(self):
1923
self.setWindowTitle(self.title)
@@ -32,7 +36,7 @@ def init_ui(self):
3236
# Copy button
3337
copy_button = QPushButton('نسخ', self)
3438
copy_button.clicked.connect(self.copy_text)
35-
copy_button.setShortcut(QKeySequence("Ctrl+C"))
39+
copy_button.setShortcut(QKeySequence("Shift+C"))
3640
copy_button.setStyleSheet('background-color: red; color: white;')
3741

3842

@@ -56,4 +60,10 @@ def init_ui(self):
5660
def copy_text(self):
5761
clipboard = QApplication.clipboard()
5862
clipboard.setText(self.text_edit.toPlainText())
59-
UniversalSpeech.say("تم نسخ النص إلى الحافظة")
63+
UniversalSpeech.say("تم نسخ النص إلى الحافظة")
64+
65+
66+
def reject(self):
67+
self.effects_manager.play("clos")
68+
super(). reject()
69+

0 commit comments

Comments
 (0)