Skip to content

Commit

Permalink
Show toast message after copying an URL
Browse files Browse the repository at this point in the history
  • Loading branch information
d-k-bo committed Apr 26, 2024
1 parent c91b700 commit 6da1374
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
14 changes: 11 additions & 3 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Televido main\n"
"Report-Msgid-Bugs-To: https://github.com/d-k-bo/televido/issues\n"
"POT-Creation-Date: 2024-04-26 17:05+0200\n"
"PO-Revision-Date: 2024-04-26 17:05+0200\n"
"POT-Creation-Date: 2024-04-26 17:13+0200\n"
"PO-Revision-Date: 2024-04-26 17:14+0200\n"
"Last-Translator: David Cabot <d-k-bo@mailbox.org>\n"
"Language-Team: \n"
"Language: de\n"
Expand Down Expand Up @@ -226,7 +226,15 @@ msgstr "Niedrige Qualität"
msgid "Subtitles"
msgstr "Untertitel"

#: src/mediathek/card.rs:198
#: src/mediathek/card.rs:107
msgid "Copied video URL to clipboard"
msgstr "Video-URL wurde in Zwischenablage kopiert"

#: src/mediathek/card.rs:120
msgid "Copied subtitles URL to clipboard"
msgstr "Untertitel-URL wurde in Zwischenablage kopiert"

#: src/mediathek/card.rs:209
msgid "Failed to open website in browser"
msgstr "Website konnte nicht im Browser geöffnet werden"

Expand Down
12 changes: 10 additions & 2 deletions po/televido.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: televido\n"
"Report-Msgid-Bugs-To: https://github.com/d-k-bo/televido/issues\n"
"POT-Creation-Date: 2024-04-26 17:05+0200\n"
"POT-Creation-Date: 2024-04-26 17:13+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -203,7 +203,15 @@ msgstr ""
msgid "Subtitles"
msgstr ""

#: src/mediathek/card.rs:198
#: src/mediathek/card.rs:107
msgid "Copied video URL to clipboard"
msgstr ""

#: src/mediathek/card.rs:120
msgid "Copied subtitles URL to clipboard"
msgstr ""

#: src/mediathek/card.rs:209
msgid "Failed to open website in browser"
msgstr ""

Expand Down
11 changes: 11 additions & 0 deletions src/mediathek/card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use adw::{gio, glib, gtk, prelude::*, subclass::prelude::*};
use gettextrs::gettext;

use crate::{
application::TvApplication,
channel_icons::load_channel_icon,
settings::{TvSettings, VideoQuality},
utils::{show_error, spawn},
Expand Down Expand Up @@ -100,6 +101,10 @@ impl TvMediathekCard {
.and_then(|show| show.video_url(quality))
.expect("action must only be enabled if url is not None"),
);

TvApplication::get()
.window()
.add_toast(adw::Toast::new(&gettext("Copied video URL to clipboard")));
}
fn copy_subtitles_url(&self) {
self.clipboard().set(
Expand All @@ -108,6 +113,12 @@ impl TvMediathekCard {
.and_then(|show| show.subtitle_url())
.expect("action must only be enabled if url is not None"),
);

TvApplication::get()
.window()
.add_toast(adw::Toast::new(&gettext(
"Copied subtitles URL to clipboard",
)));
}
fn download(&self) {
self.activate_action(
Expand Down

0 comments on commit 6da1374

Please sign in to comment.