summaryrefslogtreecommitdiff
path: root/src/publishing/SuccessPaneWidget.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:17 +0200
committerJörg Frings-Fürst <debian@jff.email>2023-06-14 20:36:17 +0200
commit31804433d72460cbe0a39f9f8ea5e76058d84cda (patch)
tree2084a84c39f159c6aea254775dc0880d52579d45 /src/publishing/SuccessPaneWidget.vala
parenta9898fb3f39c44a85876930ef6b2558052569ae6 (diff)
parentd443a3c2509889533ca812c163056bace396b586 (diff)
Update upstream source from tag 'upstream/0.32.1'
Update to upstream version '0.32.1' with Debian dir c460ad6e13d3c39eaa2d5399059385e64e6fba4c
Diffstat (limited to 'src/publishing/SuccessPaneWidget.vala')
-rw-r--r--src/publishing/SuccessPaneWidget.vala39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/publishing/SuccessPaneWidget.vala b/src/publishing/SuccessPaneWidget.vala
new file mode 100644
index 0000000..05b0c16
--- /dev/null
+++ b/src/publishing/SuccessPaneWidget.vala
@@ -0,0 +1,39 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ * Copyright 2019 Jens Georg <mail@jensge.org>
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later). See the COPYING file in this distribution.
+ */
+
+namespace PublishingUI {
+
+public class SuccessPane : StaticMessagePane {
+ public SuccessPane(Spit.Publishing.Publisher.MediaType published_media, int num_uploaded = 1) {
+ string? message_string = null;
+
+ // Here, we check whether more than one item is being uploaded, and if so, display
+ // an alternate message.
+ if (published_media == Spit.Publishing.Publisher.MediaType.VIDEO) {
+ message_string = ngettext ("The selected video was successfully published.",
+ "The selected videos were successfully published.",
+ num_uploaded);
+ }
+ else if (published_media == Spit.Publishing.Publisher.MediaType.PHOTO) {
+ message_string = ngettext ("The selected photo was successfully published.",
+ "The selected photos were successfully published.",
+ num_uploaded);
+ }
+ else if (published_media == (Spit.Publishing.Publisher.MediaType.PHOTO
+ | Spit.Publishing.Publisher.MediaType.VIDEO)) {
+ message_string = _("The selected photos/videos were successfully published.");
+ }
+ else {
+ assert_not_reached ();
+ }
+
+ base(message_string);
+ }
+}
+}
+
+