-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00be181
commit a5639e2
Showing
2 changed files
with
131 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
net/gajim/files/0001-Avoid-non-existing-unsupported-AppKit-module.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
From 0927997834d8e0e715afa685b287e47ee39709ba Mon Sep 17 00:00:00 2001 | ||
From: Sergey Fedorov <[email protected]> | ||
Date: Thu, 29 Aug 2024 00:34:41 +0800 | ||
Subject: [PATCH] Avoid non-existing / unsupported AppKit module | ||
|
||
--- | ||
gajim/common/i18n.py | 13 +++++++------ | ||
gajim/common/sound.py | 35 ++++++++++++++++++----------------- | ||
2 files changed, 25 insertions(+), 23 deletions(-) | ||
|
||
diff --git gajim/common/i18n.py gajim/common/i18n.py | ||
index 0c46f7e10..1d57c6cda 100644 | ||
--- gajim/common/i18n.py | ||
+++ gajim/common/i18n.py | ||
@@ -96,20 +96,21 @@ def _get_win32_default_lang() -> str: | ||
windll = ctypes.windll.kernel32 | ||
return locale.windows_locale[windll.GetUserDefaultUILanguage()] | ||
|
||
- @staticmethod | ||
- def _get_darwin_default_lang() -> str: | ||
- from AppKit import NSLocale | ||
+# This invoked a non-existing module. Disable it. | ||
+# @staticmethod | ||
+# def _get_darwin_default_lang() -> str: | ||
+# from AppKit import NSLocale | ||
|
||
# FIXME: This returns a two letter language code (en, de, fr) | ||
# We need a way to get en_US, de_DE etc. | ||
- return NSLocale.currentLocale().languageCode() | ||
+# return NSLocale.currentLocale().languageCode() | ||
|
||
def _get_default_lang(self) -> str: | ||
if sys.platform == 'win32': | ||
return self._get_win32_default_lang() | ||
|
||
- if sys.platform == 'darwin': | ||
- return self._get_darwin_default_lang() | ||
+# if sys.platform == 'darwin': | ||
+# return self._get_darwin_default_lang() | ||
|
||
return locale.getdefaultlocale()[0] or 'en' | ||
|
||
diff --git gajim/common/sound.py gajim/common/sound.py | ||
index e1cbce1a4..fe332ee8e 100644 | ||
--- gajim/common/sound.py | ||
+++ gajim/common/sound.py | ||
@@ -19,8 +19,9 @@ | ||
if sys.platform == 'win32' or typing.TYPE_CHECKING: | ||
import winsound | ||
|
||
-if sys.platform == 'darwin' or typing.TYPE_CHECKING: | ||
- from AppKit import NSSound | ||
+# This invoked a non-existing module. Disable it. | ||
+# if sys.platform == 'darwin' or typing.TYPE_CHECKING: | ||
+# from AppKit import NSSound | ||
|
||
log = logging.getLogger('gajim.c.sound') | ||
|
||
@@ -71,19 +72,19 @@ def loop_in_progress(self) -> bool: | ||
return self._loop_in_progress | ||
|
||
|
||
-class PlatformMacOS(PlaySound): | ||
- | ||
- def play(self, path: Path, loop: bool = False) -> None: | ||
- assert NSSound is not None | ||
- sound = NSSound.alloc() | ||
- sound.initWithContentsOfFile_byReference_(str(path), True) | ||
- sound.play() | ||
- | ||
- def stop(self) -> None: | ||
- pass | ||
- | ||
- def loop_in_progress(self) -> bool: | ||
- return False | ||
+# class PlatformMacOS(PlaySound): | ||
+# | ||
+# def play(self, path: Path, loop: bool = False) -> None: | ||
+# assert NSSound is not None | ||
+# sound = NSSound.alloc() | ||
+# sound.initWithContentsOfFile_byReference_(str(path), True) | ||
+# sound.play() | ||
+# | ||
+# def stop(self) -> None: | ||
+# pass | ||
+# | ||
+# def loop_in_progress(self) -> bool: | ||
+# return False | ||
|
||
|
||
class PlatformUnix(PlaySound): | ||
@@ -149,8 +150,8 @@ def _init_platform() -> PlaySound: | ||
if sys.platform == 'win32': | ||
return PlatformWindows() | ||
|
||
- if sys.platform == 'darwin': | ||
- return PlatformMacOS() | ||
+# if sys.platform == 'darwin': | ||
+# return PlatformMacOS() | ||
|
||
return PlatformUnix() | ||
|