Fixed alignment issues with labels
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
from os import environ
|
||||
import math
|
||||
import random
|
||||
|
||||
@@ -50,8 +51,9 @@ class LibremsonicApp(Gtk.Application):
|
||||
config_file = config_file.get_bytestring().decode('utf-8')
|
||||
else:
|
||||
# Default to ~/.config/libremsonic.
|
||||
config_folder = (os.environ.get('XDG_CONFIG_HOME')
|
||||
or os.path.expanduser('~/.config'))
|
||||
config_folder = (environ.get('XDG_CONFIG_HOME')
|
||||
or environ.get('APPDATA')
|
||||
or os.path.join(environ.get('HOME'), '.config'))
|
||||
config_folder = os.path.join(config_folder, 'libremsonic')
|
||||
config_file = os.path.join(config_folder, 'config.json')
|
||||
|
||||
@@ -376,10 +378,10 @@ class LibremsonicApp(Gtk.Application):
|
||||
self.player.pause()
|
||||
self.chromecast_player.shutdown()
|
||||
self.mpv_player.shutdown()
|
||||
CacheManager.should_exit = True
|
||||
|
||||
self.state.save()
|
||||
self.save_play_queue()
|
||||
CacheManager.shutdown()
|
||||
|
||||
# ########## HELPER METHODS ########## #
|
||||
def show_configure_servers_dialog(self):
|
||||
|
@@ -71,6 +71,14 @@ class CacheManager(metaclass=Singleton):
|
||||
executor: ThreadPoolExecutor = ThreadPoolExecutor(max_workers=50)
|
||||
should_exit: bool = False
|
||||
|
||||
@staticmethod
|
||||
def shutdown():
|
||||
# TODO fix this shutdown
|
||||
CacheManager.should_exit = True
|
||||
print('Shutdown start')
|
||||
CacheManager.executor.shutdown()
|
||||
print('Shutdown complete')
|
||||
|
||||
class CacheEncoder(json.JSONEncoder):
|
||||
def default(self, obj):
|
||||
if type(obj) == datetime:
|
||||
|
@@ -323,6 +323,7 @@ class ArtistDetailPanel(Gtk.Box):
|
||||
label=text,
|
||||
name=name,
|
||||
halign=Gtk.Align.START,
|
||||
xalign=0,
|
||||
**params,
|
||||
)
|
||||
|
||||
@@ -531,7 +532,7 @@ class AlbumWithSongs(Gtk.Box):
|
||||
allow_deselect = False
|
||||
|
||||
def on_download_state_change(song_id=None):
|
||||
GLib.idle_add(self.update_album_songs, self.album.id)
|
||||
self.update_album_songs(self.album.id)
|
||||
|
||||
# Use the new selection instead of the old one for calculating what
|
||||
# to do the right click on.
|
||||
|
@@ -238,6 +238,7 @@ class PlayerControls(Gtk.ActionBar):
|
||||
return Gtk.Label(
|
||||
name=name,
|
||||
halign=Gtk.Align.START,
|
||||
xalign=0,
|
||||
use_markup=True,
|
||||
ellipsize=Pango.EllipsizeMode.END,
|
||||
)
|
||||
|
@@ -157,8 +157,8 @@ def show_song_popover(
|
||||
# Determine if we should enable the download button.
|
||||
download_sensitive, remove_download_sensitive = False, False
|
||||
for song_id in song_ids:
|
||||
details = CacheManager.get_song_details(song_id)
|
||||
status = CacheManager.get_cached_status(details.result())
|
||||
details = CacheManager.get_song_details(song_id).result()
|
||||
status = CacheManager.get_cached_status(details)
|
||||
if download_sensitive or status == SongCacheStatus.NOT_CACHED:
|
||||
download_sensitive = True
|
||||
|
||||
|
Reference in New Issue
Block a user