Skip to content

Commit 3d84983

Browse files
authored
Merge branch 'main' into fix798
2 parents 7eb7ad1 + 98587d8 commit 3d84983

File tree

3 files changed

+60
-7
lines changed

3 files changed

+60
-7
lines changed

po/ru.po

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ msgstr ""
88
"Project-Id-Version: beat-box\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-03-19 22:54+0000\n"
11-
"PO-Revision-Date: 2024-08-09 19:16+0000\n"
11+
"PO-Revision-Date: 2025-03-25 16:55+0000\n"
1212
"Last-Translator: кубик круглый <[email protected]>\n"
13-
"Language-Team: Russian <https://l10n.elementary.io/projects/music/music/ru/"
14-
">\n"
13+
"Language-Team: Russian <https://l10n.elementaryos.org/projects/music/music/"
14+
"ru/>\n"
1515
"Language: ru\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
2020
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
21-
"X-Generator: Weblate 5.6.2\n"
21+
"X-Generator: Weblate 5.10.4\n"
2222
"X-Launchpad-Export-Date: 2017-03-07 05:54+0000\n"
2323

2424
#: src/Application.vala:97 src/Views/NowPlayingView.vala:18
@@ -47,10 +47,8 @@ msgid "Open Files…"
4747
msgstr "Открыть файлы…"
4848

4949
#: src/MainWindow.vala:76
50-
#, fuzzy
51-
#| msgid "Queue"
5250
msgid "Clear Queue"
53-
msgstr "Добавить в очередь"
51+
msgstr "Очистить очередь"
5452

5553
#: src/MainWindow.vala:187
5654
#, c-format

src/PlaybackManager.vala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,17 @@ public class Music.PlaybackManager : Object {
151151
queue_liststore.remove_all ();
152152
}
153153

154+
public void remove (AudioObject song) {
155+
if (song == current_audio) {
156+
playbin.set_state (Gst.State.NULL);
157+
current_audio = null;
158+
}
159+
160+
uint position;
161+
queue_liststore.find (song, out position);
162+
queue_liststore.remove (position);
163+
}
164+
154165
private void update_metadata (Gst.PbUtils.DiscovererInfo info, Error? err) {
155166
string uri = info.get_uri ();
156167
switch (info.get_result ()) {

src/Widgets/TrackRow.vala

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,50 @@ public class Music.TrackRow : Gtk.ListBoxRow {
7777
}
7878
});
7979

80+
var action_remove = new SimpleAction ("remove", null);
81+
action_remove.activate.connect (() => {
82+
playback_manager.remove (this.audio_object);
83+
});
84+
85+
var row_action_group = new SimpleActionGroup ();
86+
row_action_group.add_action (action_remove);
87+
88+
insert_action_group ("trackrow", row_action_group);
89+
add_binding_action (Gdk.Key.Delete, Gdk.ModifierType.NO_MODIFIER_MASK, "trackrow.remove", null);
90+
91+
var menu = new Menu ();
92+
menu.append (_("Remove"), "trackrow.remove");
93+
94+
var context_menu = new Gtk.PopoverMenu.from_model (menu) {
95+
halign = Gtk.Align.START,
96+
has_arrow = false,
97+
position = Gtk.PositionType.BOTTOM
98+
};
99+
context_menu.set_parent (this);
100+
101+
var right_click = new Gtk.GestureClick () {
102+
button = Gdk.BUTTON_SECONDARY
103+
};
104+
right_click.pressed.connect ((n_press, x, y) => {
105+
menu_popup_at_pointer (context_menu, x, y);
106+
});
107+
108+
var long_press = new Gtk.GestureLongPress ();
109+
long_press.pressed.connect ((x, y) => {
110+
menu_popup_at_pointer (context_menu, x, y);
111+
});
112+
113+
add_controller (right_click);
114+
add_controller (long_press);
115+
}
116+
117+
private void menu_popup_at_pointer (Gtk.PopoverMenu popover, double x, double y) {
118+
var rect = Gdk.Rectangle () {
119+
x = (int) x,
120+
y = (int) y
121+
};
122+
popover.pointing_to = rect;
123+
popover.popup ();
80124
}
81125

82126
private void update_playing (bool playing) {

0 commit comments

Comments
 (0)