Skip to content

Commit 4cf9232

Browse files
committed
added open log item to tools menu.
1 parent 0a815ef commit 4cf9232

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ui/widgets/menu_bar.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from PyQt6.QtWidgets import QApplication, QMenuBar, QMenu, QMessageBox
23
from PyQt6.QtGui import QIcon, QAction, QKeySequence, QShortcut, QDesktopServices
34
from PyQt6.QtCore import Qt, QUrl
@@ -162,9 +163,13 @@ def create_menu(self):
162163
sura_player__action = QAction("مشغل القرآن", self)
163164
sura_player__action.setShortcut(QKeySequence("Shift+P"))
164165
sura_player__action.triggered.connect(self.OnSuraPlayer)
166+
open_log_action = QAction("فتح ملف السجل", self)
167+
open_log_action.setShortcut(QKeySequence("Shift+L"))
168+
open_log_action.triggered.connect(self.Onopen_log_file)
165169
tools_menu.addAction(athkar_action)
166170
tools_menu.addAction(bookmark_manager_action)
167171
tools_menu.addAction(sura_player__action)
172+
tools_menu.addAction(open_log_action)
168173

169174
preferences_menu = self.addMenu("التفضيلات(&R)")
170175
settings_action = QAction("الإعدادات", self)
@@ -309,6 +314,10 @@ def quit_application(self):
309314
self.parent.tray_manager.hide_icon()
310315
QApplication.quit()
311316
bass.BASS_Free()
312-
313-
314317

318+
def Onopen_log_file(self):
319+
appdata_path = os.path.expandvars('%appdata%')
320+
log_file_path = os.path.join(appdata_path, 'tecwindow', 'albayan', 'albayan.log')
321+
322+
# Open the log file with the default program for the file type
323+
os.startfile(log_file_path)

0 commit comments

Comments
 (0)