Minimal necessary to get things running on macos
This commit is contained in:

committed by
Sumner Evans

parent
4a55181b63
commit
0c8c080aab
@@ -7,8 +7,7 @@ from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple
|
|||||||
|
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('Gtk', '3.0')
|
gi.require_version('Gtk', '3.0')
|
||||||
gi.require_version('Notify', '0.7')
|
from gi.repository import Gdk, GdkPixbuf, Gio, GLib, Gtk
|
||||||
from gi.repository import Gdk, GdkPixbuf, Gio, GLib, Gtk, Notify
|
|
||||||
|
|
||||||
from .cache_manager import CacheManager
|
from .cache_manager import CacheManager
|
||||||
from .config import ReplayGainType
|
from .config import ReplayGainType
|
||||||
@@ -24,7 +23,7 @@ from .ui.settings import SettingsDialog
|
|||||||
class SublimeMusicApp(Gtk.Application):
|
class SublimeMusicApp(Gtk.Application):
|
||||||
def __init__(self, config_file: str):
|
def __init__(self, config_file: str):
|
||||||
super().__init__(application_id="com.sumnerevans.sublimemusic")
|
super().__init__(application_id="com.sumnerevans.sublimemusic")
|
||||||
Notify.init('Sublime Music')
|
# Notify.init('Sublime Music')
|
||||||
|
|
||||||
self.window: Optional[Gtk.Window] = None
|
self.window: Optional[Gtk.Window] = None
|
||||||
self.state = ApplicationState()
|
self.state = ApplicationState()
|
||||||
@@ -760,7 +759,7 @@ class SublimeMusicApp(Gtk.Application):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def on_app_shutdown(self, app: 'SublimeMusicApp'):
|
def on_app_shutdown(self, app: 'SublimeMusicApp'):
|
||||||
Notify.uninit()
|
# Notify.uninit()
|
||||||
|
|
||||||
if self.state.config.server is None:
|
if self.state.config.server is None:
|
||||||
return
|
return
|
||||||
@@ -874,7 +873,7 @@ class SublimeMusicApp(Gtk.Application):
|
|||||||
self.should_scrobble_song = True
|
self.should_scrobble_song = True
|
||||||
|
|
||||||
# Show a song play notification.
|
# Show a song play notification.
|
||||||
if self.state.config.song_play_notification:
|
if self.state.config.song_play_notification and False:
|
||||||
try:
|
try:
|
||||||
notification_lines = []
|
notification_lines = []
|
||||||
if song.album:
|
if song.album:
|
||||||
|
@@ -3,7 +3,7 @@ import os
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
import keyring
|
# import keyring
|
||||||
|
|
||||||
|
|
||||||
class ReplayGainType(Enum):
|
class ReplayGainType(Enum):
|
||||||
@@ -52,6 +52,7 @@ class ServerConfiguration:
|
|||||||
self.local_network_ssid = local_network_ssid
|
self.local_network_ssid = local_network_ssid
|
||||||
self.username = username
|
self.username = username
|
||||||
self.sync_enabled = sync_enabled
|
self.sync_enabled = sync_enabled
|
||||||
|
self._password = password
|
||||||
self.disable_cert_verify = disable_cert_verify
|
self.disable_cert_verify = disable_cert_verify
|
||||||
|
|
||||||
# Try to save the password in the keyring, but if we can't, then save
|
# Try to save the password in the keyring, but if we can't, then save
|
||||||
|
@@ -3,10 +3,8 @@ import os
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Dict, List, Optional, Set
|
from typing import Any, Dict, List, Optional, Set
|
||||||
|
|
||||||
import gi
|
|
||||||
gi.require_version('NM', '1.0')
|
gi.require_version('NM', '1.0')
|
||||||
from gi.repository import NM
|
from gi.repository import NM
|
||||||
|
|
||||||
from .cache_manager import CacheManager
|
from .cache_manager import CacheManager
|
||||||
from .config import AppConfiguration
|
from .config import AppConfiguration
|
||||||
from .from_json import from_json
|
from .from_json import from_json
|
||||||
@@ -188,6 +186,7 @@ class ApplicationState:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def current_ssids(self) -> Set[str]:
|
def current_ssids(self) -> Set[str]:
|
||||||
|
return set()
|
||||||
if not self.nmclient_initialized:
|
if not self.nmclient_initialized:
|
||||||
# Only look at the active WiFi connections.
|
# Only look at the active WiFi connections.
|
||||||
for ac in self.networkmanager_client.get_active_connections():
|
for ac in self.networkmanager_client.get_active_connections():
|
||||||
|
Reference in New Issue
Block a user