Merge lp:~ozzmos/pantheon-files/fix-1011176 into lp:~elementary-apps/pantheon-files/trunk

Proposed by Christophe Bastin
Status: Merged
Merged at revision: 1387
Proposed branch: lp:~ozzmos/pantheon-files/fix-1011176
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 45 lines (+24/-0)
2 files modified
po/pantheon-files.pot (+8/-0)
src/View/PropertiesWindow.vala (+16/-0)
To merge this branch: bzr merge lp:~ozzmos/pantheon-files/fix-1011176
Reviewer Review Type Date Requested Status
Julián Unrrein (community) Needs Fixing
David Gomes (community) Needs Fixing
Danielle Foré Needs Fixing
Cody Garver Pending
Review via email: mp+197280@code.launchpad.net

This proposal supersedes a proposal from 2013-11-28.

Description of the change

show image size in Properties Window

To post a comment you must log in.
Revision history for this message
Julián Unrrein (junrrein) wrote : Posted in a previous version of this proposal

Hi Christophe,

I tested your branch and it works as intended.

The code is fine too, though you'll have to fix the code style:
* Newline before line 27.
* In lines 33 and 34: (pixbuf.get_width ().to_string ()) -> pixbuf.get_width ().to_string ();
* Put a space before an opening parenthesis. Lines 29 and 38.
* Move "catch(Error e){" to the previous line -> "} catch (Error e) {"
* Put a space before an opening curly brace. Lines 31 and 38.

You can read our coding style guide at http://elementaryos.org/docs/code/code-style.

Also, it seems you updated the translation template in this branch. When it's necessary, we tend do it in another branch, so the revision log gets less polluted. You don't need to revert it this time, just keep it in mind for the future.

review: Needs Fixing
Revision history for this message
Christophe Bastin (ozzmos) wrote : Posted in a previous version of this proposal

Thanks for the review. I'm going to fix that.

Revision history for this message
Cody Garver (codygarver) wrote : Posted in a previous version of this proposal

Design team wants it to be "Size: 852 x 576 px"

review: Needs Fixing
Revision history for this message
David Gomes (davidgomes) wrote :

Diff line 36 should be:

>info.add (new Pair<string, string> (_("Size") + (": "), width + " x " + height + " px"));

Also newline after diff line 31.

review: Needs Fixing
1379. By Christophe Bastin

fix coding style

Revision history for this message
Danielle Foré (danrabbit) wrote :

Instead of an " x " we should be using the " × " character

review: Needs Fixing
Revision history for this message
Julián Unrrein (junrrein) wrote :

After pushing new commits, you don't need to "Resubmit" the merge proposal. Just leave a comment saying that you applied the requested changes and we will be notified.

1380. By Christophe Bastin

fix typo

Revision history for this message
Christophe Bastin (ozzmos) wrote :

Ok, sorry for that ;)

Revision history for this message
David Gomes (davidgomes) wrote :

Diff line 28 is over-indented.

review: Needs Fixing
Revision history for this message
David Gomes (davidgomes) wrote :

Diff line 30 should be if ("image" in mime) {

Make sure you fix these two when you manually merge it Cody.

review: Needs Fixing
1381. By Christophe Bastin

fix coding style

Revision history for this message
Julián Unrrein (junrrein) wrote :

Insert a new line after diff line 41.

This should be the last thing to fix.

review: Needs Fixing
1382. By Christophe Bastin

fix coding style

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/pantheon-files.pot'
2--- po/pantheon-files.pot 2013-10-02 16:59:49 +0000
3+++ po/pantheon-files.pot 2013-12-09 16:56:45 +0000
4@@ -408,6 +408,14 @@
5 msgid "MimeTypes"
6 msgstr ""
7
8+#: /home/codygarver/f/po/../src/View/PropertiesWindow.vala:431
9+msgid "Width"
10+msgstr ""
11+
12+#: /home/codygarver/f/po/../src/View/PropertiesWindow.vala:432
13+msgid "Height"
14+msgstr ""
15+
16 #: /home/codygarver/f/po/../src/View/PropertiesWindow.vala:424
17 msgid "Location"
18 msgstr ""
19
20=== modified file 'src/View/PropertiesWindow.vala'
21--- src/View/PropertiesWindow.vala 2013-09-09 03:08:16 +0000
22+++ src/View/PropertiesWindow.vala 2013-12-09 16:56:45 +0000
23@@ -420,6 +420,22 @@
24 info.add (new Pair<string, string>(_("MimeTypes") + (": "), str));
25 }
26 }
27+
28+ /* get image size in pixels */
29+ var mime = file.icon.to_string ();
30+ if ("image" in mime) {
31+ var path = file.location.get_path ();
32+
33+ try {
34+ Gdk.Pixbuf pixbuf = new Gdk.Pixbuf.from_file (path);
35+ var width = pixbuf.get_width ().to_string ();
36+ var height = pixbuf.get_height ().to_string ();
37+ info.add (new Pair<string, string> (_("Size") + (": "), width +" × " + height + " px"));
38+ } catch (Error e) {
39+ stdout.printf ("Error: %s\n", e.message);
40+ }
41+ }
42+
43 if (got_common_location ())
44 info.add (new Pair<string, string>(_("Location") + (": "), "<a href=\"" + Markup.escape_text (file.directory.get_uri ()) + "\">"
45 + Markup.escape_text (file.directory.get_parse_name ()) + "</a>"));

Subscribers

People subscribed via source and target branches

to all changes: