summaryrefslogtreecommitdiff
path: root/src/publishing/PublishingUI.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-11-25 04:11:58 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-11-25 04:11:58 +0100
commitccff5442184e84d511c2bd25ed3da53e4336a272 (patch)
tree8402a0ba68852e0aec5841ed4519ccfe88352223 /src/publishing/PublishingUI.vala
parenta1e1833f48ed618273dab9198b547148a89832a7 (diff)
parent4a3f1fdfe1eb3743564adcee35d5513224339260 (diff)
Merge tag 'upstream/0.25.1'
Upstream version 0.25.1
Diffstat (limited to 'src/publishing/PublishingUI.vala')
-rw-r--r--src/publishing/PublishingUI.vala69
1 files changed, 41 insertions, 28 deletions
diff --git a/src/publishing/PublishingUI.vala b/src/publishing/PublishingUI.vala
index c0c3a34..8303f40 100644
--- a/src/publishing/PublishingUI.vala
+++ b/src/publishing/PublishingUI.vala
@@ -100,19 +100,24 @@ public class SuccessPane : StaticMessagePane {
// Here, we check whether more than one item is being uploaded, and if so, display
// an alternate message.
- if(num_uploaded > 1) {
- if (published_media == (Spit.Publishing.Publisher.MediaType.PHOTO | Spit.Publishing.Publisher.MediaType.VIDEO))
- message_string = _("The selected photos/videos were successfully published.");
- else if (published_media == Spit.Publishing.Publisher.MediaType.VIDEO)
- message_string = _("The selected videos were successfully published.");
- else
- message_string = _("The selected photos were successfully published.");
- } else {
- if (published_media == Spit.Publishing.Publisher.MediaType.VIDEO)
- message_string = _("The selected video was successfully published.");
- else
- message_string = _("The selected photo was successfully published.");
+ 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 video was successfully published.",
+ "The selected videos 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);
}
}
@@ -156,15 +161,15 @@ public class PublishingDialog : Gtk.Dialog {
protected PublishingDialog(Gee.Collection<MediaSource> to_publish) {
assert(to_publish.size > 0);
- bool use_header;
+ bool use_header = false;
Gtk.Settings.get_default ().get ("gtk-dialogs-use-header", out use_header);
Object(use_header_bar: use_header ? 1 : 0);
if (use_header)
((Gtk.HeaderBar) get_header_bar()).set_show_close_button(false);
-
+
resizable = false;
delete_event.connect(on_window_close);
-
+
publishables = new Spit.Publishing.Publishable[0];
bool has_photos = false;
bool has_videos = false;
@@ -250,45 +255,53 @@ public class PublishingDialog : Gtk.Dialog {
{
var service_selector_box_label = new Gtk.Label.with_mnemonic(label);
service_selector_box_label.set_mnemonic_widget(service_selector_box);
- service_selector_box_label.set_alignment(0.0f, 0.5f);
+ service_selector_box_label.halign = Gtk.Align.START;
+ service_selector_box_label.valign = Gtk.Align.CENTER;
/* the wrapper is not an extraneous widget -- it's necessary to prevent the service
selection box from growing and shrinking whenever its parent's size changes.
When wrapped inside a Gtk.Alignment, the Alignment grows and shrinks instead of
the service selection box. */
- Gtk.Alignment service_selector_box_wrapper = new Gtk.Alignment(1.0f, 0.5f, 0.0f, 0.0f);
- service_selector_box_wrapper.add(service_selector_box);
+ service_selector_box.halign = Gtk.Align.END;
+ service_selector_box.valign = Gtk.Align.CENTER;
+ service_selector_box.hexpand = false;
+ service_selector_box.vexpand = false;
Gtk.Box service_selector_layouter = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 8);
service_selector_layouter.set_border_width(12);
+ service_selector_layouter.hexpand = true;
service_selector_layouter.add(service_selector_box_label);
- service_selector_layouter.pack_start(service_selector_box_wrapper, true, true, 0);
+ service_selector_layouter.pack_start(service_selector_box, true, true, 0);
/* 'service area' is the selector assembly plus the horizontal rule dividing it from the
rest of the dialog */
Gtk.Box service_area_layouter = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
service_area_layouter.add(service_selector_layouter);
service_area_layouter.add(new Gtk.Separator(Gtk.Orientation.HORIZONTAL));
+ service_area_layouter.halign = Gtk.Align.FILL;
+ service_area_layouter.valign = Gtk.Align.START;
+ service_area_layouter.hexpand = true;
+ service_area_layouter.vexpand = false;
- Gtk.Alignment service_area_wrapper = new Gtk.Alignment(0.0f, 0.0f, 1.0f, 0.0f);
- service_area_wrapper.add(service_area_layouter);
-
- get_content_area().pack_start(service_area_wrapper, false, false, 0);
+ get_content_area().pack_start(service_area_layouter, false, false, 0);
}
central_area_layouter = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
get_content_area().pack_start(central_area_layouter, true, true, 0);
- close_cancel_button = new Gtk.Button.with_mnemonic("_Cancel");
- close_cancel_button.set_can_default(true);
- close_cancel_button.clicked.connect(on_close_cancel_clicked);
if (use_header) {
+ close_cancel_button = new Gtk.Button.with_mnemonic("_Cancel");
+ close_cancel_button.set_can_default(true);
+
((Gtk.HeaderBar) get_header_bar()).pack_start(close_cancel_button);
((Gtk.HeaderBar) get_header_bar()).pack_end(service_selector_box);
}
- else
- ((Gtk.Container) get_action_area()).add(close_cancel_button);
+ else {
+ add_button (_("_Cancel"), Gtk.ResponseType.CANCEL);
+ close_cancel_button = get_widget_for_response (Gtk.ResponseType.CANCEL) as Gtk.Button;
+ }
+ close_cancel_button.clicked.connect(on_close_cancel_clicked);
set_standard_window_mode();