333
333
rate_rejected.label = Resources.rating_menu (Rating.REJECTED);
334
334
actions += rate_rejected;
336
Gtk.ActionEntry rate_unrated = { "RateUnrated", null, TRANSLATABLE,
337
"0", TRANSLATABLE, on_rate_unrated
339
rate_unrated.label = Resources.rating_menu (Rating.UNRATED);
340
actions += rate_unrated;
342
Gtk.ActionEntry rate_one = { "RateOne", null, TRANSLATABLE,
343
"1", TRANSLATABLE, on_rate_one
345
rate_one.label = Resources.rating_menu (Rating.ONE);
348
Gtk.ActionEntry rate_two = { "RateTwo", null, TRANSLATABLE,
349
"2", TRANSLATABLE, on_rate_two
351
rate_two.label = Resources.rating_menu (Rating.TWO);
354
Gtk.ActionEntry rate_three = { "RateThree", null, TRANSLATABLE,
355
"3", TRANSLATABLE, on_rate_three
357
rate_three.label = Resources.rating_menu (Rating.THREE);
358
actions += rate_three;
360
Gtk.ActionEntry rate_four = { "RateFour", null, TRANSLATABLE,
361
"4", TRANSLATABLE, on_rate_four
363
rate_four.label = Resources.rating_menu (Rating.FOUR);
364
actions += rate_four;
366
Gtk.ActionEntry rate_five = { "RateFive", null, TRANSLATABLE,
367
"5", TRANSLATABLE, on_rate_five
369
rate_five.label = Resources.rating_menu (Rating.FIVE);
370
actions += rate_five;
372
336
Gtk.ActionEntry sort_photos = { "SortPhotos", null, TRANSLATABLE, null, null, null };
373
337
sort_photos.label = _ ("Sort _Photos");
374
338
actions += sort_photos;
526
private void update_rating_sensitivities () {
527
set_action_sensitive ("RateRejected", can_rate_selected (Rating.REJECTED));
528
set_action_sensitive ("RateUnrated", can_rate_selected (Rating.UNRATED));
529
set_action_sensitive ("RateOne", can_rate_selected (Rating.ONE));
530
set_action_sensitive ("RateTwo", can_rate_selected (Rating.TWO));
531
set_action_sensitive ("RateThree", can_rate_selected (Rating.THREE));
532
set_action_sensitive ("RateFour", can_rate_selected (Rating.FOUR));
533
set_action_sensitive ("RateFive", can_rate_selected (Rating.FIVE));
490
protected void update_rating_sensitivities () {
491
if (rating_menu_item != null) {
492
rating_menu_item.sensitive = can_rate_selected ();
493
rating_menu_item.rating_value = Resources.int_to_rating (get_selected_rating ());
534
495
set_action_sensitive ("IncreaseRating", can_increase_selected_rating ());
535
496
set_action_sensitive ("DecreaseRating", can_decrease_selected_rating ());
499
protected override void on_rating_widget_activate () {
500
on_set_rating (Resources.int_to_rating(rating_menu_item.rating_value));
538
503
private void update_development_menu_item_sensitivity () {
539
504
if (get_view ().get_selected ().size == 0) {
540
505
set_action_sensitive ("RawDeveloper", false);
614
579
action.set_active (display);
617
private bool can_rate_selected (Rating rating) {
582
private bool can_rate_selected () {
583
return get_view ().get_selected ().size > 0;
586
private Rating get_selected_rating () {
588
Rating last_rating = Rating.UNRATED;
618
589
foreach (DataView view in get_view ().get_selected ()) {
619
if (((Thumbnail) view).get_media_source ().get_rating () != rating)
590
var rating = ((Thumbnail) view).get_media_source ().get_rating ();
593
else if (last_rating != rating)
594
return Rating.UNRATED;
595
last_rating = rating;
626
600
private bool can_increase_selected_rating () {
702
676
activate_action ("DecreaseRating");
706
activate_action ("RateOne");
710
activate_action ("RateTwo");
714
activate_action ("RateThree");
718
activate_action ("RateFour");
722
activate_action ("RateFive");
726
activate_action ("RateUnrated");
680
on_set_rating (Rating.ONE);
684
on_set_rating (Rating.TWO);
688
on_set_rating (Rating.THREE);
692
on_set_rating (Rating.FOUR);
696
on_set_rating (Rating.FIVE);
700
on_set_rating (Rating.UNRATED);
730
704
activate_action ("RateRejected");
920
894
on_set_rating (Rating.REJECTED);
923
protected virtual void on_rate_unrated () {
924
on_set_rating (Rating.UNRATED);
927
protected virtual void on_rate_one () {
928
on_set_rating (Rating.ONE);
931
protected virtual void on_rate_two () {
932
on_set_rating (Rating.TWO);
935
protected virtual void on_rate_three () {
936
on_set_rating (Rating.THREE);
939
protected virtual void on_rate_four () {
940
on_set_rating (Rating.FOUR);
943
protected virtual void on_rate_five () {
944
on_set_rating (Rating.FIVE);
947
897
private void on_remove_from_library () {
948
898
remove_photos_from_library ((Gee.Collection<LibraryPhoto>) get_view ().get_selected_sources ());