mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Fixed taskbar icon not appearing correctly in Windows
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
- Fixed folder and filename sanitization to properly handle OS-specific illegal characters (Windows, Linux, macOS), ensuring compatibility across all platforms when creating chapter folders and files.
|
- Fixed folder and filename sanitization to properly handle OS-specific illegal characters (Windows, Linux, macOS), ensuring compatibility across all platforms when creating chapter folders and files.
|
||||||
- Fixed `/` and `\` path display by normalizing paths.
|
- Fixed `/` and `\` path display by normalizing paths.
|
||||||
- Fixed book reprocessing issue where books were being processed every time the chapters window was opened, improving performance when reopening the same book.
|
- Fixed book reprocessing issue where books were being processed every time the chapters window was opened, improving performance when reopening the same book.
|
||||||
|
- Fixed taskbar icon not appearing correctly in Windows.
|
||||||
- Improvements in code and documentation.
|
- Improvements in code and documentation.
|
||||||
|
|
||||||
# 1.1.9
|
# 1.1.9
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ Here’s Abogen in action: in this demo, it processes ∼3,000 characters of tex
|
|||||||
|
|
||||||
> Special thanks to [@jborza](https://github.com/jborza) for chapter support in PR [#10](https://github.com/denizsafak/abogen/pull/10)
|
> Special thanks to [@jborza](https://github.com/jborza) for chapter support in PR [#10](https://github.com/denizsafak/abogen/pull/10)
|
||||||
|
|
||||||
|
> Special thanks to [@mleg](https://github.com/mleg) for adding `Line` option in subtitle generation in PR [#94](https://github.com/denizsafak/abogen/pull/94)
|
||||||
|
|
||||||
| Book handler options | Description |
|
| Book handler options | Description |
|
||||||
|---------|-------------|
|
|---------|-------------|
|
||||||
| **Chapter Control** | Select specific `chapters` from ePUBs or markdown files or `chapters + pages` from PDFs. |
|
| **Chapter Control** | Select specific `chapters` from ePUBs or markdown files or `chapters + pages` from PDFs. |
|
||||||
|
|||||||
+10
-7
@@ -18,6 +18,16 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
print("PyQt5 not installed.")
|
print("PyQt5 not installed.")
|
||||||
|
|
||||||
|
# Set application ID for Windows taskbar icon
|
||||||
|
if platform.system() == "Windows":
|
||||||
|
try:
|
||||||
|
from abogen.constants import PROGRAM_NAME, VERSION
|
||||||
|
import ctypes
|
||||||
|
app_id = f"{PROGRAM_NAME}.{VERSION}"
|
||||||
|
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id)
|
||||||
|
except Exception as e:
|
||||||
|
print("Warning: failed to set AppUserModelID:", e)
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QApplication
|
from PyQt5.QtWidgets import QApplication
|
||||||
from PyQt5.QtGui import QIcon
|
from PyQt5.QtGui import QIcon
|
||||||
from PyQt5.QtCore import qInstallMessageHandler, QtMsgType
|
from PyQt5.QtCore import qInstallMessageHandler, QtMsgType
|
||||||
@@ -86,13 +96,6 @@ def qt_message_handler(mode, context, message):
|
|||||||
# Install the custom message handler
|
# Install the custom message handler
|
||||||
qInstallMessageHandler(qt_message_handler)
|
qInstallMessageHandler(qt_message_handler)
|
||||||
|
|
||||||
# Set application ID for Windows taskbar icon
|
|
||||||
if platform.system() == "Windows":
|
|
||||||
import ctypes
|
|
||||||
|
|
||||||
app_id = f"{PROGRAM_NAME}.{VERSION}"
|
|
||||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id)
|
|
||||||
|
|
||||||
# Handle Wayland on Linux GNOME
|
# Handle Wayland on Linux GNOME
|
||||||
if platform.system() == "Linux":
|
if platform.system() == "Linux":
|
||||||
xdg_session = os.environ.get("XDG_SESSION_TYPE", "").lower()
|
xdg_session = os.environ.get("XDG_SESSION_TYPE", "").lower()
|
||||||
|
|||||||
Reference in New Issue
Block a user