adjusted action bars

This commit is contained in:
Martin Wagner 2020-08-18 11:54:15 +02:00
parent 40f0bb7511
commit 8853fdd311
3 changed files with 95 additions and 74 deletions

View File

@ -1086,6 +1086,7 @@ class SearchWindow(Gtk.Box):
hbox.set_property("border-width", 6) hbox.set_property("border-width", 6)
hbox.pack_start(self.search_entry, True, True, 0) hbox.pack_start(self.search_entry, True, True, 0)
hbox.pack_end(self.tags, False, False, 0) hbox.pack_end(self.tags, False, False, 0)
self.label.set_margin_end(6)
self.action_bar.pack_end(self.label) self.action_bar.pack_end(self.label)
self.pack_start(hbox, False, False, 0) self.pack_start(hbox, False, False, 0)
self.pack_start(Gtk.Separator.new(orientation=Gtk.Orientation.HORIZONTAL), False, False, 0) self.pack_start(Gtk.Separator.new(orientation=Gtk.Orientation.HORIZONTAL), False, False, 0)
@ -1124,7 +1125,7 @@ class SearchWindow(Gtk.Box):
for s in songs: for s in songs:
song=ClientHelper.extend_song_for_display(ClientHelper.song_to_str_dict(s)) song=ClientHelper.extend_song_for_display(ClientHelper.song_to_str_dict(s))
self.store.append([int(song["track"]), song["title"], song["artist"], song["album"], song["human_duration"], song["file"]]) self.store.append([int(song["track"]), song["title"], song["artist"], song["album"], song["human_duration"], song["file"]])
self.label.set_text(_("hits: %i") % (self.songs_view.count())) self.label.set_text(_("%i hits") % (self.songs_view.count()))
if self.songs_view.count() == 0: if self.songs_view.count() == 0:
self.action_bar.set_sensitive(False) self.action_bar.set_sensitive(False)
else: else:
@ -2203,8 +2204,11 @@ class PlaylistView(Gtk.Box):
self.back_to_song_button=Gtk.Button(image=Gtk.Image.new_from_icon_name("go-previous-symbolic", Gtk.IconSize.BUTTON)) self.back_to_song_button=Gtk.Button(image=Gtk.Image.new_from_icon_name("go-previous-symbolic", Gtk.IconSize.BUTTON))
self.back_to_song_button.set_tooltip_text(_("Scroll to current song")) self.back_to_song_button.set_tooltip_text(_("Scroll to current song"))
self.back_to_song_button.set_relief(Gtk.ReliefStyle.NONE) self.back_to_song_button.set_relief(Gtk.ReliefStyle.NONE)
style_context=self.back_to_song_button.get_style_context() self.clear_button=Gtk.Button(image=Gtk.Image.new_from_icon_name("edit-clear-symbolic", Gtk.IconSize.BUTTON))
style_context.add_class("circular") self.clear_button.set_tooltip_text(_("Clear playlist"))
self.clear_button.set_relief(Gtk.ReliefStyle.NONE)
style_context=self.clear_button.get_style_context()
style_context.add_class("destructive-action")
# Store # Store
# (track, disc, title, artist, album, duration, date, genre, file, weight) # (track, disc, title, artist, album, duration, date, genre, file, weight)
@ -2259,21 +2263,22 @@ class PlaylistView(Gtk.Box):
self.playlist_info.set_xalign(0) self.playlist_info.set_xalign(0)
self.playlist_info.set_ellipsize(Pango.EllipsizeMode.END) self.playlist_info.set_ellipsize(Pango.EllipsizeMode.END)
# status bar # action bar
status_bar=Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) action_bar=Gtk.ActionBar()
status_bar.set_property("border-width", 1) action_bar.pack_start(self.back_to_song_button)
status_bar.pack_start(self.back_to_song_button, False, False, 0)
self.playlist_info.set_margin_start(3) self.playlist_info.set_margin_start(3)
status_bar.pack_start(self.playlist_info, True, True, 0) action_bar.pack_start(self.playlist_info)
audio.set_margin_end(5) audio.set_margin_end(3)
audio.set_margin_start(12) audio.set_margin_start(12)
status_bar.pack_end(audio, False, False, 0) action_bar.pack_end(self.clear_button)
action_bar.pack_end(audio)
# connect # connect
self.treeview.connect("row-activated", self.on_row_activated) self.treeview.connect("row-activated", self.on_row_activated)
self.key_press_event=self.treeview.connect("key-press-event", self.on_key_press_event) self.key_press_event=self.treeview.connect("key-press-event", self.on_key_press_event)
self.treeview.connect("button-press-event", self.on_button_press_event) self.treeview.connect("button-press-event", self.on_button_press_event)
self.back_to_song_button.connect("clicked", self.scroll_to_selected_title) self.back_to_song_button.connect("clicked", self.scroll_to_selected_title)
self.clear_button.connect("clicked", self.on_clear_button_clicked)
self.client.emitter.connect("playlist_changed", self.on_playlist_changed) self.client.emitter.connect("playlist_changed", self.on_playlist_changed)
self.client.emitter.connect("current_song_changed", self.on_song_changed) self.client.emitter.connect("current_song_changed", self.on_song_changed)
@ -2285,8 +2290,7 @@ class PlaylistView(Gtk.Box):
# packing # packing
self.pack_start(frame, True, True, 0) self.pack_start(frame, True, True, 0)
self.pack_start(Gtk.Separator.new(orientation=Gtk.Orientation.HORIZONTAL), False, False, 0) self.pack_end(action_bar, False, False, 0)
self.pack_end(status_bar, False, False, 0)
def save_settings(self): # only saves the column sizes def save_settings(self): # only saves the column sizes
columns=self.treeview.get_columns() columns=self.treeview.get_columns()
@ -2414,12 +2418,17 @@ class PlaylistView(Gtk.Box):
else: else:
self.refresh_selection(False) self.refresh_selection(False)
def on_clear_button_clicked(self, *args):
self.client.clear()
def on_disconnected(self, *args): def on_disconnected(self, *args):
self.clear() self.clear()
self.back_to_song_button.set_sensitive(False) self.back_to_song_button.set_sensitive(False)
self.clear_button.set_sensitive(False)
def on_reconnected(self, *args): def on_reconnected(self, *args):
self.back_to_song_button.set_sensitive(True) self.back_to_song_button.set_sensitive(True)
self.clear_button.set_sensitive(True)
class CoverLyricsOSD(Gtk.Overlay): class CoverLyricsOSD(Gtk.Overlay):
def __init__(self, client, settings, window): def __init__(self, client, settings, window):

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-16 17:01+0200\n" "POT-Creation-Date: 2020-08-18 11:52+0200\n"
"PO-Revision-Date: 2020-08-16 20:46+0200\n" "PO-Revision-Date: 2020-08-18 11:53+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: de\n" "Language: de\n"
@ -38,52 +38,52 @@ msgstr "Unbekannter Interpret"
msgid "Unknown Album" msgid "Unknown Album"
msgstr "Unbekanntes Album" msgstr "Unbekanntes Album"
#: mpdevil.py:1044 mpdevil.py:1347 mpdevil.py:2225 mpdevil.py:2910 #: mpdevil.py:1044 mpdevil.py:1348 mpdevil.py:2231 mpdevil.py:2910
msgid "No" msgid "No"
msgstr "Nr." msgstr "Nr."
#: mpdevil.py:1049 mpdevil.py:1352 mpdevil.py:2231 mpdevil.py:2910 #: mpdevil.py:1049 mpdevil.py:1353 mpdevil.py:2233 mpdevil.py:2910
msgid "Title" msgid "Title"
msgstr "Titel" msgstr "Titel"
#: mpdevil.py:1055 mpdevil.py:1502 mpdevil.py:2234 mpdevil.py:2910 #: mpdevil.py:1055 mpdevil.py:1503 mpdevil.py:2234 mpdevil.py:2910
msgid "Artist" msgid "Artist"
msgstr "Interpret" msgstr "Interpret"
#: mpdevil.py:1061 mpdevil.py:2237 mpdevil.py:2910 #: mpdevil.py:1061 mpdevil.py:2235 mpdevil.py:2910
msgid "Album" msgid "Album"
msgstr "Album" msgstr "Album"
#: mpdevil.py:1067 mpdevil.py:1358 mpdevil.py:2240 mpdevil.py:2910 #: mpdevil.py:1067 mpdevil.py:1359 mpdevil.py:2236 mpdevil.py:2910
msgid "Length" msgid "Length"
msgstr "Länge" msgstr "Länge"
#: mpdevil.py:1127 #: mpdevil.py:1128
#, python-format #, python-format
msgid "hits: %i" msgid "%i hits"
msgstr "Treffer: %i" msgstr "%i Treffer"
#: mpdevil.py:1230 #: mpdevil.py:1231
msgid "Append" msgid "Append"
msgstr "Anhängen" msgstr "Anhängen"
#: mpdevil.py:1231 #: mpdevil.py:1232
msgid "Add all titles to playlist" msgid "Add all titles to playlist"
msgstr "Alle Titel der Wiedergabeliste anhängen" msgstr "Alle Titel der Wiedergabeliste anhängen"
#: mpdevil.py:1232 #: mpdevil.py:1233
msgid "Play" msgid "Play"
msgstr "Abspielen" msgstr "Abspielen"
#: mpdevil.py:1233 #: mpdevil.py:1234
msgid "Directly play all titles" msgid "Directly play all titles"
msgstr "Alle Titel sofort abspielen" msgstr "Alle Titel sofort abspielen"
#: mpdevil.py:1234 #: mpdevil.py:1235
msgid "Enqueue" msgid "Enqueue"
msgstr "Einreihen" msgstr "Einreihen"
#: mpdevil.py:1235 #: mpdevil.py:1236
msgid "" msgid ""
"Append all titles after the currently playing track and clear the playlist " "Append all titles after the currently playing track and clear the playlist "
"from all other songs" "from all other songs"
@ -91,49 +91,49 @@ msgstr ""
"Alle Titel hinter dem aktuellen Stück einreihen und die weitere " "Alle Titel hinter dem aktuellen Stück einreihen und die weitere "
"Wiedergabeliste leeren" "Wiedergabeliste leeren"
#: mpdevil.py:1364 #: mpdevil.py:1365
msgid "Close" msgid "Close"
msgstr "Schließen" msgstr "Schließen"
#: mpdevil.py:1403 #: mpdevil.py:1404
msgid "all genres" msgid "all genres"
msgstr "Alle Genres" msgstr "Alle Genres"
#: mpdevil.py:1500 #: mpdevil.py:1501
msgid "Album Artist" msgid "Album Artist"
msgstr "Albuminterpret" msgstr "Albuminterpret"
#: mpdevil.py:1503 #: mpdevil.py:1504
msgid "all artists" msgid "all artists"
msgstr "Alle Interpreten" msgstr "Alle Interpreten"
#: mpdevil.py:1665 #: mpdevil.py:1666
#, python-format #, python-format
msgid "%(total_tracks)i titles on %(discs)i discs (%(total_length)s)" msgid "%(total_tracks)i titles on %(discs)i discs (%(total_length)s)"
msgstr "%(total_tracks)i Titel auf %(discs)i CDs (%(total_length)s)" msgstr "%(total_tracks)i Titel auf %(discs)i CDs (%(total_length)s)"
#: mpdevil.py:1667 mpdevil.py:2330 #: mpdevil.py:1668 mpdevil.py:2325
#, python-format #, python-format
msgid "%(total_tracks)i titles (%(total_length)s)" msgid "%(total_tracks)i titles (%(total_length)s)"
msgstr "%(total_tracks)i Titel (%(total_length)s)" msgstr "%(total_tracks)i Titel (%(total_length)s)"
#: mpdevil.py:1848 #: mpdevil.py:1849
msgid "Back to current album" msgid "Back to current album"
msgstr "Zurück zu aktuellem Album" msgstr "Zurück zu aktuellem Album"
#: mpdevil.py:1850 #: mpdevil.py:1851
msgid "Search" msgid "Search"
msgstr "Suche" msgstr "Suche"
#: mpdevil.py:2018 #: mpdevil.py:2019
msgid "searching..." msgid "searching..."
msgstr "suche..." msgstr "suche..."
#: mpdevil.py:2022 #: mpdevil.py:2023
msgid "lyrics not found" msgid "lyrics not found"
msgstr "Liedtext nicht gefunden" msgstr "Liedtext nicht gefunden"
#: mpdevil.py:2090 #: mpdevil.py:2091
#, python-format #, python-format
msgid "" msgid ""
"%(bitrate)s kb/s, %(frequency)s kHz, %(resolution)i bit, %(channels)i " "%(bitrate)s kb/s, %(frequency)s kHz, %(resolution)i bit, %(channels)i "
@ -142,19 +142,23 @@ msgstr ""
"%(bitrate)s kb/s, %(frequency)s kHz, %(resolution)i bit, %(channels)i " "%(bitrate)s kb/s, %(frequency)s kHz, %(resolution)i bit, %(channels)i "
"Kanäle, %(file_type)s" "Kanäle, %(file_type)s"
#: mpdevil.py:2204 #: mpdevil.py:2205
msgid "Scroll to current song" msgid "Scroll to current song"
msgstr "Gehe zu aktuellem Lied" msgstr "Gehe zu aktuellem Lied"
#: mpdevil.py:2228 mpdevil.py:2910 #: mpdevil.py:2208
msgid "Clear playlist"
msgstr "Wiedergabeliste leeren"
#: mpdevil.py:2232 mpdevil.py:2910
msgid "Disc" msgid "Disc"
msgstr "CD" msgstr "CD"
#: mpdevil.py:2243 mpdevil.py:2910 #: mpdevil.py:2237 mpdevil.py:2910
msgid "Year" msgid "Year"
msgstr "Jahr" msgstr "Jahr"
#: mpdevil.py:2246 mpdevil.py:2910 #: mpdevil.py:2238 mpdevil.py:2910
msgid "Genre" msgid "Genre"
msgstr "Genre" msgstr "Genre"
@ -362,6 +366,10 @@ msgstr "Serverstatistik"
msgid "Menu" msgid "Menu"
msgstr "Menü" msgstr "Menü"
#, python-format
#~ msgid "hits: %i"
#~ msgstr "Treffer: %i"
#~ msgid "Add" #~ msgid "Add"
#~ msgstr "Hinzufügen" #~ msgstr "Hinzufügen"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-16 17:01+0200\n" "POT-Creation-Date: 2020-08-18 11:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -37,119 +37,123 @@ msgstr ""
msgid "Unknown Album" msgid "Unknown Album"
msgstr "" msgstr ""
#: mpdevil.py:1044 mpdevil.py:1347 mpdevil.py:2225 mpdevil.py:2910 #: mpdevil.py:1044 mpdevil.py:1348 mpdevil.py:2231 mpdevil.py:2910
msgid "No" msgid "No"
msgstr "" msgstr ""
#: mpdevil.py:1049 mpdevil.py:1352 mpdevil.py:2231 mpdevil.py:2910 #: mpdevil.py:1049 mpdevil.py:1353 mpdevil.py:2233 mpdevil.py:2910
msgid "Title" msgid "Title"
msgstr "" msgstr ""
#: mpdevil.py:1055 mpdevil.py:1502 mpdevil.py:2234 mpdevil.py:2910 #: mpdevil.py:1055 mpdevil.py:1503 mpdevil.py:2234 mpdevil.py:2910
msgid "Artist" msgid "Artist"
msgstr "" msgstr ""
#: mpdevil.py:1061 mpdevil.py:2237 mpdevil.py:2910 #: mpdevil.py:1061 mpdevil.py:2235 mpdevil.py:2910
msgid "Album" msgid "Album"
msgstr "" msgstr ""
#: mpdevil.py:1067 mpdevil.py:1358 mpdevil.py:2240 mpdevil.py:2910 #: mpdevil.py:1067 mpdevil.py:1359 mpdevil.py:2236 mpdevil.py:2910
msgid "Length" msgid "Length"
msgstr "" msgstr ""
#: mpdevil.py:1127 #: mpdevil.py:1128
#, python-format #, python-format
msgid "hits: %i" msgid "%i hits"
msgstr ""
#: mpdevil.py:1230
msgid "Append"
msgstr "" msgstr ""
#: mpdevil.py:1231 #: mpdevil.py:1231
msgid "Add all titles to playlist" msgid "Append"
msgstr "" msgstr ""
#: mpdevil.py:1232 #: mpdevil.py:1232
msgid "Play" msgid "Add all titles to playlist"
msgstr "" msgstr ""
#: mpdevil.py:1233 #: mpdevil.py:1233
msgid "Directly play all titles" msgid "Play"
msgstr "" msgstr ""
#: mpdevil.py:1234 #: mpdevil.py:1234
msgid "Enqueue" msgid "Directly play all titles"
msgstr "" msgstr ""
#: mpdevil.py:1235 #: mpdevil.py:1235
msgid "Enqueue"
msgstr ""
#: mpdevil.py:1236
msgid "" msgid ""
"Append all titles after the currently playing track and clear the playlist " "Append all titles after the currently playing track and clear the playlist "
"from all other songs" "from all other songs"
msgstr "" msgstr ""
#: mpdevil.py:1364 #: mpdevil.py:1365
msgid "Close" msgid "Close"
msgstr "" msgstr ""
#: mpdevil.py:1403 #: mpdevil.py:1404
msgid "all genres" msgid "all genres"
msgstr "" msgstr ""
#: mpdevil.py:1500 #: mpdevil.py:1501
msgid "Album Artist" msgid "Album Artist"
msgstr "" msgstr ""
#: mpdevil.py:1503 #: mpdevil.py:1504
msgid "all artists" msgid "all artists"
msgstr "" msgstr ""
#: mpdevil.py:1665 #: mpdevil.py:1666
#, python-format #, python-format
msgid "%(total_tracks)i titles on %(discs)i discs (%(total_length)s)" msgid "%(total_tracks)i titles on %(discs)i discs (%(total_length)s)"
msgstr "" msgstr ""
#: mpdevil.py:1667 mpdevil.py:2330 #: mpdevil.py:1668 mpdevil.py:2325
#, python-format #, python-format
msgid "%(total_tracks)i titles (%(total_length)s)" msgid "%(total_tracks)i titles (%(total_length)s)"
msgstr "" msgstr ""
#: mpdevil.py:1848 #: mpdevil.py:1849
msgid "Back to current album" msgid "Back to current album"
msgstr "" msgstr ""
#: mpdevil.py:1850 #: mpdevil.py:1851
msgid "Search" msgid "Search"
msgstr "" msgstr ""
#: mpdevil.py:2018 #: mpdevil.py:2019
msgid "searching..." msgid "searching..."
msgstr "" msgstr ""
#: mpdevil.py:2022 #: mpdevil.py:2023
msgid "lyrics not found" msgid "lyrics not found"
msgstr "" msgstr ""
#: mpdevil.py:2090 #: mpdevil.py:2091
#, python-format #, python-format
msgid "" msgid ""
"%(bitrate)s kb/s, %(frequency)s kHz, %(resolution)i bit, %(channels)i " "%(bitrate)s kb/s, %(frequency)s kHz, %(resolution)i bit, %(channels)i "
"channels, %(file_type)s" "channels, %(file_type)s"
msgstr "" msgstr ""
#: mpdevil.py:2204 #: mpdevil.py:2205
msgid "Scroll to current song" msgid "Scroll to current song"
msgstr "" msgstr ""
#: mpdevil.py:2228 mpdevil.py:2910 #: mpdevil.py:2208
msgid "Clear playlist"
msgstr ""
#: mpdevil.py:2232 mpdevil.py:2910
msgid "Disc" msgid "Disc"
msgstr "" msgstr ""
#: mpdevil.py:2243 mpdevil.py:2910 #: mpdevil.py:2237 mpdevil.py:2910
msgid "Year" msgid "Year"
msgstr "" msgstr ""
#: mpdevil.py:2246 mpdevil.py:2910 #: mpdevil.py:2238 mpdevil.py:2910
msgid "Genre" msgid "Genre"
msgstr "" msgstr ""