summaryrefslogtreecommitdiff
path: root/src/PhotoPage.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-01-21 19:19:04 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-01-21 19:19:04 +0100
commitf39ea21098340bd99c48669f152c9068046c2c99 (patch)
treed1166fce1a4a8c470dfaf364816f767678c4729e /src/PhotoPage.vala
parentbc48a4cff815ed156b603c92e684779c317417ba (diff)
parenta7ff7c49085c320c1e0a2ffb66cc6d283c5acb8e (diff)
Merge tag 'upstream/0.25.3'
Upstream version 0.25.3
Diffstat (limited to 'src/PhotoPage.vala')
-rw-r--r--src/PhotoPage.vala32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/PhotoPage.vala b/src/PhotoPage.vala
index a6fb529..962c80e 100644
--- a/src/PhotoPage.vala
+++ b/src/PhotoPage.vala
@@ -2431,17 +2431,26 @@ public class LibraryPhotoPage : EditingHostPage {
{ "ViewRatings", on_action_toggle, null, "false", on_display_ratings },
// Radio actions
- { "RawDeveloper", on_action_radio, "s", "'Shotwell'", on_raw_developer_changed }
};
- protected override void add_actions () {
- base.add_actions ();
+ protected override void add_actions (GLib.ActionMap map) {
+ base.add_actions (map);
- AppWindow.get_instance ().add_action_entries (entries, this);
+ map.add_action_entries (entries, this);
(get_action ("ViewRatings") as GLib.SimpleAction).change_state (Config.Facade.get_instance ().get_display_photo_ratings ());
var d = Config.Facade.get_instance().get_default_raw_developer();
- var action = get_action ("RawDeveloper") as GLib.SimpleAction;
- action.change_state (d == RawDeveloper.SHOTWELL ? "Shotwell" : "Camera");
+ var action = new GLib.SimpleAction.stateful("RawDeveloper",
+ GLib.VariantType.STRING, d == RawDeveloper.SHOTWELL ? "Shotwell" : "Camera");
+ action.change_state.connect(on_raw_developer_changed);
+ action.set_enabled(true);
+ map.add_action(action);
+ }
+
+ protected override void remove_actions(GLib.ActionMap map) {
+ base.remove_actions(map);
+ foreach (var entry in entries) {
+ map.remove_action(entry.name);
+ }
}
protected override InjectionGroup[] init_collect_injection_groups() {
@@ -2573,7 +2582,7 @@ public class LibraryPhotoPage : EditingHostPage {
}
// Displays a photo from a specific CollectionPage. When the user exits this view,
- // they will be sent back to the return_page. The optional view paramters is for using
+ // they will be sent back to the return_page. The optional view parameters is for using
// a ViewCollection other than the one inside return_page; this is necessary if the
// view and return_page have different filters.
public void display_for_collection(CollectionPage return_page, Photo photo,
@@ -2608,6 +2617,14 @@ public class LibraryPhotoPage : EditingHostPage {
set_display_ratings(Config.Facade.get_instance().get_display_photo_ratings());
}
+
+
+ public override void switching_from() {
+ base.switching_from();
+ foreach (var entry in entries) {
+ AppWindow.get_instance().remove_action(entry.name);
+ }
+ }
protected override Gdk.Pixbuf? get_bottom_left_trinket(int scale) {
if (!has_photo() || !Config.Facade.get_instance().get_display_photo_ratings())
@@ -3123,6 +3140,5 @@ public class LibraryPhotoPage : EditingHostPage {
get_command_manager().execute(new ModifyTagsCommand(photo, new_tags));
}
-
}