|
| 1 | +import os |
1 | 2 | from PyQt6.QtWidgets import QApplication, QMenuBar, QMenu, QMessageBox |
2 | 3 | from PyQt6.QtGui import QIcon, QAction, QKeySequence, QShortcut, QDesktopServices |
3 | 4 | from PyQt6.QtCore import Qt, QUrl |
@@ -162,9 +163,13 @@ def create_menu(self): |
162 | 163 | sura_player__action = QAction("مشغل القرآن", self) |
163 | 164 | sura_player__action.setShortcut(QKeySequence("Shift+P")) |
164 | 165 | 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) |
165 | 169 | tools_menu.addAction(athkar_action) |
166 | 170 | tools_menu.addAction(bookmark_manager_action) |
167 | 171 | tools_menu.addAction(sura_player__action) |
| 172 | + tools_menu.addAction(open_log_action) |
168 | 173 |
|
169 | 174 | preferences_menu = self.addMenu("التفضيلات(&R)") |
170 | 175 | settings_action = QAction("الإعدادات", self) |
@@ -309,6 +314,10 @@ def quit_application(self): |
309 | 314 | self.parent.tray_manager.hide_icon() |
310 | 315 | QApplication.quit() |
311 | 316 | bass.BASS_Free() |
312 | | - |
313 | | - |
314 | 317 |
|
| 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