Merge lp:~elementary-apps/pantheon-photos/sidebar-camera-info into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by Danielle Foré
Status: Merged
Merged at revision: 3043
Proposed branch: lp:~elementary-apps/pantheon-photos/sidebar-camera-info
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 98 lines (+23/-12)
2 files modified
src/sidebar/metadata/BasicProperties.vala (+23/-0)
src/sidebar/metadata/ExtendedProperties.vala (+0/-12)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-photos/sidebar-camera-info
Reviewer Review Type Date Requested Status
Danielle Foré Needs Fixing
Review via email: mp+310129@code.launchpad.net

Commit message

BasicProperties.vala: Add camera make and model as a single line above other camera-related info

ExtendedProperties.vala: Remove camera make and model

Description of the change

This moves the camera make and model info near the other camera-related info (like aperture) and combines it into a single line

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

We need to add some magic to make sure we don't duplicate make and model name

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sidebar/metadata/BasicProperties.vala'
2--- src/sidebar/metadata/BasicProperties.vala 2016-11-06 16:56:17 +0000
3+++ src/sidebar/metadata/BasicProperties.vala 2016-11-06 18:15:40 +0000
4@@ -13,6 +13,8 @@
5 private int photo_count;
6 private int event_count;
7 private int video_count;
8+ private string camera_make;
9+ private string camera_model;
10 private string exposure;
11 private string focal_length;
12 private string title;
13@@ -31,6 +33,8 @@
14
15 protected override void clear_properties () {
16 base.clear_properties ();
17+ camera_make = "";
18+ camera_model = "";
19 title = "";
20 start_time = 0;
21 end_time = 0;
22@@ -63,6 +67,9 @@
23 ((PhotoImportSource) source).get_metadata ();
24
25 if (metadata != null) {
26+ camera_make = metadata.get_camera_make ();
27+ camera_model = metadata.get_camera_model ();
28+
29 exposure = metadata.get_exposure_string ();
30 if (exposure == null)
31 exposure = "";
32@@ -284,6 +291,22 @@
33 add_line ("", raw_assoc);
34 }
35
36+ if (camera_make != "" && camera_model != "") {
37+ string camera_string;
38+
39+ if (camera_make in camera_model) {
40+ camera_string = camera_model;
41+ } else {
42+ camera_string = camera_make + " " + camera_model;
43+ }
44+
45+ var camera_label = new Gtk.Label (camera_string);
46+ camera_label.margin_top = 12;
47+ camera_label.xalign = 0;
48+
49+ attach (camera_label, 0, 8, 2, 1);
50+ }
51+
52 var flowbox = new Gtk.FlowBox ();
53 flowbox.column_spacing = 12;
54 flowbox.row_spacing = 12;
55
56=== modified file 'src/sidebar/metadata/ExtendedProperties.vala'
57--- src/sidebar/metadata/ExtendedProperties.vala 2016-11-06 17:15:40 +0000
58+++ src/sidebar/metadata/ExtendedProperties.vala 2016-11-06 18:15:40 +0000
59@@ -9,8 +9,6 @@
60 // Photo stuff
61 private string file_path;
62 private uint64 filesize;
63- private string camera_make;
64- private string camera_model;
65 private string flash;
66 private double gps_lat;
67 private string gps_lat_ref;
68@@ -43,8 +41,6 @@
69 development_path = "";
70 is_raw = false;
71 filesize = 0;
72- camera_make = "";
73- camera_model = "";
74 flash = "";
75 gps_lat = -1;
76 gps_lat_ref = "";
77@@ -102,8 +98,6 @@
78 metadata.set_exposure_date_time (new MetadataDateTime (photo.get_timestamp ()));
79
80 is_raw = (photo.get_master_file_format () == PhotoFileFormat.RAW);
81- camera_make = metadata.get_camera_make ();
82- camera_model = metadata.get_camera_model ();
83 flash = metadata.get_flash_string ();
84 metadata.get_gps (out gps_long, out gps_long_ref, out gps_lat, out gps_lat_ref, out gps_alt);
85 artist = metadata.get_artist ();
86@@ -133,12 +127,6 @@
87 if (is_raw)
88 add_line (_ ("Developer:"), development_path);
89
90- add_line (_ ("Camera make:"), (camera_make != "" && camera_make != null) ?
91- camera_make : NO_VALUE);
92-
93- add_line (_ ("Camera model:"), (camera_model != "" && camera_model != null) ?
94- camera_model : NO_VALUE);
95-
96 add_line (_ ("Flash:"), (flash != "" && flash != null) ? flash : NO_VALUE);
97
98 add_line (_ ("Exposure date:"), (exposure_date != "" && exposure_date != null) ?

Subscribers

People subscribed via source and target branches