Merge lp:~jmiguelbenitez/pantheon-photos/fix-1360068 into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by José M. Benítez
Status: Rejected
Rejected by: Zisu Andrei
Proposed branch: lp:~jmiguelbenitez/pantheon-photos/fix-1360068
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 100 lines (+45/-1)
2 files modified
src/Photo.vala (+1/-1)
src/editing_tools/EditingTools.vala (+44/-0)
To merge this branch: bzr merge lp:~jmiguelbenitez/pantheon-photos/fix-1360068
Reviewer Review Type Date Requested Status
Zisu Andrei (community) Needs Information
Review via email: mp+281361@code.launchpad.net

Description of the change

Improved button's sensitivity state in the "Adjust" tool dialog to reflect the item's current state (fix to bug #1360068).

To post a comment you must log in.
Revision history for this message
Zisu Andrei (matzipan) wrote :

Can you please advise on how I can see the effects of this change?

review: Needs Information

Unmerged revisions

2834. By José M. Benítez

Improved buttons' sensitivity state in the Adjustment Tool dialog.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Photo.vala'
--- src/Photo.vala 2014-08-25 01:41:46 +0000
+++ src/Photo.vala 2015-12-26 18:04:06 +0000
@@ -5490,4 +5490,4 @@
5490 }5490 }
5491 }5491 }
5492 }5492 }
5493}
5494\ No newline at end of file5493\ No newline at end of file
5494}
54955495
=== modified file 'src/editing_tools/EditingTools.vala'
--- src/editing_tools/EditingTools.vala 2015-08-09 23:40:46 +0000
+++ src/editing_tools/EditingTools.vala 2015-12-26 18:04:06 +0000
@@ -456,6 +456,12 @@
456 protected Cairo.Surface surface;456 protected Cairo.Surface surface;
457 public string name;457 public string name;
458458
459 /**
460 * Whether the item this instance is associated to is edited when the object
461 * is created.
462 */
463 protected bool item_initially_edited = false;
464
459 [CCode (has_target = false)]465 [CCode (has_target = false)]
460 public delegate EditingTool Factory ();466 public delegate EditingTool Factory ();
461467
@@ -485,6 +491,8 @@
485491
486 this.canvas = canvas;492 this.canvas = canvas;
487493
494 item_initially_edited = canvas.get_photo ().has_transformations () || canvas.get_photo ().has_editable ();
495
488 tool_window = get_tool_window ();496 tool_window = get_tool_window ();
489 if (tool_window != null)497 if (tool_window != null)
490 tool_window.key_press_event.connect (on_keypress);498 tool_window.key_press_event.connect (on_keypress);
@@ -2259,6 +2267,33 @@
22592267
2260 add (pane_layouter);2268 add (pane_layouter);
2261 }2269 }
2270
2271 /**
2272 * Sets this editing tool into the "edited" state.
2273 *
2274 * A tool is said to be in its "edited" state when the item is
2275 * associated to has any modification with respect to its initial state.
2276 *
2277 * Please note that the initial state of the item may be different from
2278 * the original one (because of a previous saved transformation).
2279 *
2280 * @param modified Whether the editing tool is in the "edited" state.
2281 */
2282 public void set_edited_state (bool modified) {
2283 ok_button.sensitive = modified;
2284 }
2285
2286 /**
2287 * Sets this editing tool into the "reset" state.
2288 *
2289 * A tool is said to be in its "reset" state when the item is associated
2290 * to has no modifications at all with respect to its original state.
2291 *
2292 * @param reset Whether the editing tool is in the "reset" state.
2293 */
2294 public void set_reset_state (bool reset) {
2295 reset_button.sensitive = !reset;
2296 }
2262 }2297 }
22632298
2264 private abstract class AdjustToolCommand : Command {2299 private abstract class AdjustToolCommand : Command {
@@ -2538,6 +2573,9 @@
2538 owner.items_altered.connect (on_photos_altered);2573 owner.items_altered.connect (on_photos_altered);
25392574
2540 base.activate (canvas);2575 base.activate (canvas);
2576
2577 adjust_tool_window.set_edited_state (false);
2578 adjust_tool_window.set_reset_state (!item_initially_edited);
2541 }2579 }
25422580
2543 public override EditingToolWindow? get_tool_window () {2581 public override EditingToolWindow? get_tool_window () {
@@ -2594,6 +2632,10 @@
2594 private void on_reset () {2632 private void on_reset () {
2595 AdjustResetCommand command = new AdjustResetCommand (this, transformations);2633 AdjustResetCommand command = new AdjustResetCommand (this, transformations);
2596 AppWindow.get_command_manager ().execute (command);2634 AppWindow.get_command_manager ().execute (command);
2635 adjust_tool_window.set_reset_state (true);
2636 /* it will be edited if the reset state is different from the one which
2637 the dialog was started in (a modified version of the original item) */
2638 adjust_tool_window.set_edited_state (item_initially_edited);
2597 }2639 }
25982640
2599 private void on_ok () {2641 private void on_ok () {
@@ -2628,6 +2670,8 @@
2628 SliderAdjustmentCommand command = new SliderAdjustmentCommand (this, old_transformation,2670 SliderAdjustmentCommand command = new SliderAdjustmentCommand (this, old_transformation,
2629 new_transformation, name);2671 new_transformation, name);
2630 AppWindow.get_command_manager ().execute (command);2672 AppWindow.get_command_manager ().execute (command);
2673 adjust_tool_window.set_edited_state (true);
2674 adjust_tool_window.set_reset_state (false);
2631 }2675 }
26322676
2633 private void on_temperature_adjustment () {2677 private void on_temperature_adjustment () {

Subscribers

People subscribed via source and target branches