Merge lp:~meese/pantheon-photos/fix-1374926 into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by meese
Status: Work in progress
Proposed branch: lp:~meese/pantheon-photos/fix-1374926
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 38 lines (+8/-1)
1 file modified
src/sidebar/metadata/LibraryProperties.vala (+8/-1)
To merge this branch: bzr merge lp:~meese/pantheon-photos/fix-1374926
Reviewer Review Type Date Requested Status
Victor Martinez (community) Needs Fixing
Review via email: mp+236652@code.launchpad.net

Commit message

Pressing enter in title entry changes the title immediately (lp:1374926)

Description of the change

makes pressing enter in title entry change the title immediatley

To post a comment you must log in.
Revision history for this message
Victor Martinez (victored) wrote :

Looks good. There's just one minor detail to take care of.

review: Needs Fixing
Revision history for this message
Victor Martinez (victored) :

Unmerged revisions

2649. By meese

makes pressing enter in title entry change the title immediatley

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sidebar/metadata/LibraryProperties.vala'
2--- src/sidebar/metadata/LibraryProperties.vala 2014-09-17 01:31:12 +0000
3+++ src/sidebar/metadata/LibraryProperties.vala 2014-10-01 04:08:05 +0000
4@@ -38,6 +38,7 @@
5 tags = "";
6 is_media = false;
7 }
8+
9 public override void update_properties (Page page) {
10 internal_update_properties (page);
11 show_all ();
12@@ -74,6 +75,7 @@
13 title_entry.set_text (title);
14 title_entry.changed.connect (title_entry_changed);
15 add_entry_line (_("Title"), title_entry);
16+ title_entry.activate.connect (title_entry_activate);
17
18 comment_entry = new PlaceHolderTextView (comment, _("Comment"));
19 comment_entry.set_wrap_mode (Gtk.WrapMode.WORD);
20@@ -165,12 +167,17 @@
21 save_changes_to_source ();
22 }
23
24+ private void title_entry_activate () {
25+ title = title_entry.get_text ();
26+ save_changes_to_source ();
27+ }
28+
29 public override void save_changes_to_source () {
30 if (media_source != null && is_media) {
31 comment = comment_entry.get_text ().strip ();
32 if (title != null && title != media_source.get_name ())
33 AppWindow.get_command_manager ().execute (new EditTitleCommand (media_source, title));
34- if (comment != null && comment != media_source.get_comment ())
35+ if (comment.strip () != null && comment != media_source.get_comment ().strip ())
36 AppWindow.get_command_manager ().execute (new EditCommentCommand (media_source, comment));
37 Gee.ArrayList<Tag>? new_tags = tag_entry_to_array ();
38 if (new_tags != null && tags != get_initial_tag_text (media_source))

Subscribers

People subscribed via source and target branches

to all changes: