Merge lp:~vikoadi/pantheon-photos/export-contextmenu into lp:~pantheon-photos/pantheon-photos/trunk

Proposed by Viko Adi Rahmawan
Status: Merged
Approved by: Danielle Foré
Approved revision: 2591
Merged at revision: 2592
Proposed branch: lp:~vikoadi/pantheon-photos/export-contextmenu
Merge into: lp:~pantheon-photos/pantheon-photos/trunk
Diff against target: 345 lines (+5/-137)
12 files modified
src/CollectionPage.vala (+0/-1)
src/DesktopIntegration.vala (+0/-71)
src/MediaPage.vala (+1/-24)
src/PhotoPage.vala (+0/-20)
src/direct/DirectPhotoPage.vala (+0/-12)
src/util/system.vala (+1/-1)
ui/collection.ui (+1/-1)
ui/direct.ui (+0/-1)
ui/direct_context.ui (+0/-1)
ui/media.ui (+0/-1)
ui/photo.ui (+0/-2)
ui/photo_context.ui (+2/-2)
To merge this branch: bzr merge lp:~vikoadi/pantheon-photos/export-contextmenu
Reviewer Review Type Date Requested Status
Danielle Foré Approve
Review via email: mp+231982@code.launchpad.net

Commit message

* move export menuitem from menubar to contextmenu in PhotoPage and CollectionPage
* Drop Nautilus Send to entirely

Description of the change

* move export menuitem from menubar to contextmenu in PhotoPage and CollectionPage
* Drop Nautilus Send to entirely

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

Can you also remove "Send To.." in this branch since it does pretty much the same thing (except it's broken) :p

2591. By Viko Adi Rahmawan

drop nautilus send to

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

Drop Nautilus send to

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CollectionPage.vala'
2--- src/CollectionPage.vala 2014-08-23 07:54:47 +0000
3+++ src/CollectionPage.vala 2014-08-24 00:42:32 +0000
4@@ -74,7 +74,6 @@
5 private static InjectionGroup create_file_menu_injectables () {
6 InjectionGroup group = new InjectionGroup ("/MenuBar/FileMenu/FileExtrasPlaceholder");
7
8- group.add_menu_item ("SendTo");
9 group.add_menu_item ("SetBackground");
10
11 return group;
12
13=== modified file 'src/DesktopIntegration.vala'
14--- src/DesktopIntegration.vala 2014-08-12 01:16:54 +0000
15+++ src/DesktopIntegration.vala 2014-08-24 00:42:32 +0000
16@@ -6,12 +6,9 @@
17
18 namespace DesktopIntegration {
19
20-private const string SENDTO_EXEC = "nautilus-sendto";
21 private const string DESKTOP_SLIDESHOW_XML_FILENAME = "wallpaper.xml";
22
23 private int init_count = 0;
24-private bool send_to_installed = false;
25-private ExporterUI send_to_exporter = null;
26 private ExporterUI desktop_slideshow_exporter = null;
27 private double desktop_slideshow_transition = 0.0;
28 private double desktop_slideshow_duration = 0.0;
29@@ -19,8 +16,6 @@
30 public void init () {
31 if (init_count++ != 0)
32 return;
33-
34- send_to_installed = Environment.find_program_in_path (SENDTO_EXEC) != null;
35 }
36
37 public void terminate () {
38@@ -86,72 +81,6 @@
39 return str != null ? str : app_info.get_executable ();
40 }
41
42-public bool is_send_to_installed () {
43- return send_to_installed;
44-}
45-
46-public void files_send_to (File[] files) {
47- if (files.length == 0)
48- return;
49-
50- string[] argv = new string[files.length + 1];
51- argv[0] = SENDTO_EXEC;
52-
53- for (int ctr = 0; ctr < files.length; ctr++)
54- argv[ctr + 1] = files[ctr].get_path ();
55-
56- try {
57- AppWindow.get_instance ().set_busy_cursor ();
58-
59- Pid child_pid;
60- Process.spawn_async (
61- "/",
62- argv,
63- null, // environment
64- SpawnFlags.SEARCH_PATH,
65- null, // child setup
66- out child_pid);
67-
68- AppWindow.get_instance ().set_normal_cursor ();
69- } catch (Error err) {
70- AppWindow.get_instance ().set_normal_cursor ();
71- AppWindow.error_message (_ ("Unable to launch Nautilus Send-To: %s").printf (err.message));
72- }
73-}
74-
75-public void send_to (Gee.Collection<MediaSource> media) {
76- if (media.size == 0 || send_to_exporter != null)
77- return;
78-
79- ExportDialog dialog = new ExportDialog (_ ("Send To"));
80-
81- // determine the mix of media in the export collection -- if it contains only
82- // videos then we can use the Video.export_many( ) fast path and not have to
83- // worry about ExportFormatParameters or the Export... dialog
84- if (MediaSourceCollection.has_video (media) && !MediaSourceCollection.has_photo (media)) {
85- send_to_exporter = Video.export_many ((Gee.Collection<Video>) media,
86- on_send_to_export_completed, true);
87- return;
88- }
89-
90- int scale;
91- ScaleConstraint constraint;
92- ExportFormatParameters export_params = ExportFormatParameters.current ();
93- if (!dialog.execute (out scale, out constraint, ref export_params))
94- return;
95-
96- send_to_exporter = new ExporterUI (new Exporter.for_temp_file (media,
97- Scaling.for_constraint (constraint, scale, false), export_params));
98- send_to_exporter.export (on_send_to_export_completed);
99-}
100-
101-private void on_send_to_export_completed (Exporter exporter, bool is_cancelled) {
102- if (!is_cancelled)
103- files_send_to (exporter.get_exported_files ());
104-
105- send_to_exporter = null;
106-}
107-
108 public void set_background (Photo photo) {
109 // attempt to set the wallpaper to the photo's native format, but if not writeable, go to the
110 // system default
111
112=== modified file 'src/MediaPage.vala'
113--- src/MediaPage.vala 2014-08-08 21:13:09 +0000
114+++ src/MediaPage.vala 2014-08-24 00:42:32 +0000
115@@ -275,20 +275,6 @@
116 export.label = Resources.EXPORT_MENU;
117 actions += export;
118
119- Gtk.ActionEntry send_to = { "SendTo", "document-send", TRANSLATABLE, null,
120- TRANSLATABLE, on_send_to
121- };
122- send_to.label = Resources.SEND_TO_MENU;
123- actions += send_to;
124-
125- // This is identical to the above action, except that it has different
126- // mnemonics and is _only_ for use in the context menu.
127- Gtk.ActionEntry send_to_context_menu = { "SendToContextMenu", "document-send", TRANSLATABLE, null,
128- TRANSLATABLE, on_send_to
129- };
130- send_to_context_menu.label = Resources.SEND_TO_CONTEXT_MENU;
131- actions += send_to_context_menu;
132-
133 Gtk.ActionEntry remove_from_library = { "RemoveFromLibrary", Gtk.Stock.REMOVE, TRANSLATABLE,
134 "<Shift>Delete", TRANSLATABLE, on_remove_from_library
135 };
136@@ -548,11 +534,6 @@
137 set_action_sensitive ("RemoveFromLibrary", selected_count > 0);
138 set_action_sensitive ("MoveToTrash", selected_count > 0);
139
140- if (DesktopIntegration.is_send_to_installed ())
141- set_action_sensitive ("SendTo", selected_count > 0);
142- else
143- set_action_visible ("SendTo", false);
144-
145 set_action_sensitive ("Rate", selected_count > 0);
146 update_rating_sensitivities ();
147
148@@ -716,10 +697,6 @@
149 }
150 }
151
152- private void on_send_to () {
153- DesktopIntegration.send_to ((Gee.Collection<MediaSource>) get_view ().get_selected_sources ());
154- }
155-
156 protected void on_play_video () {
157 if (get_view ().get_selected_count () != 1)
158 return;
159@@ -1336,4 +1313,4 @@
160
161 return get_checkerboard_layout ().get_scale ();
162 }
163-}
164+}
165\ No newline at end of file
166
167=== modified file 'src/PhotoPage.vala'
168--- src/PhotoPage.vala 2014-08-23 07:54:47 +0000
169+++ src/PhotoPage.vala 2014-08-24 00:42:32 +0000
170@@ -2553,12 +2553,6 @@
171 };
172 adjust_date_time.label = Resources.ADJUST_DATE_TIME_MENU;
173 actions += adjust_date_time;
174-
175- Gtk.ActionEntry send_to = { "SendTo", "document-send", TRANSLATABLE, null,
176- TRANSLATABLE, on_send_to
177- };
178- send_to.label = Resources.SEND_TO_MENU;
179- actions += send_to;
180
181 Gtk.ActionEntry set_background = { "SetBackground", null, TRANSLATABLE, "<Ctrl>B",
182 TRANSLATABLE, on_set_background
183@@ -2699,14 +2693,6 @@
184 open_with_raw.label = Resources.OPEN_WITH_RAW_MENU;
185 actions += open_with_raw;
186
187- // These are identical to add_tags and send_to, except that they have
188- // different mnemonics and are _only_ for use in the context menu.
189- Gtk.ActionEntry send_to_context_menu = { "SendToContextMenu", "document-send", TRANSLATABLE, null,
190- TRANSLATABLE, on_send_to
191- };
192- send_to_context_menu.label = Resources.SEND_TO_CONTEXT_MENU;
193- actions += send_to_context_menu;
194-
195 Gtk.ActionEntry add_tags_context_menu = { "AddTagsContextMenu", null, TRANSLATABLE, "<Ctrl>A", TRANSLATABLE,
196 on_add_tags
197 };
198@@ -2961,7 +2947,6 @@
199 protected override void update_ui (bool missing) {
200 bool sensitivity = !missing;
201
202- set_action_sensitive ("SendTo", sensitivity);
203 set_action_sensitive ("Publish", sensitivity);
204 set_action_sensitive ("Print", sensitivity);
205 set_action_sensitive ("CommonJumpToFile", sensitivity);
206@@ -3296,11 +3281,6 @@
207 }
208 }
209
210- private void on_send_to () {
211- if (has_photo ())
212- DesktopIntegration.send_to ((Gee.Collection<Photo>) get_view ().get_selected_sources ());
213- }
214-
215 private void on_export () {
216 if (!has_photo ())
217 return;
218
219=== modified file 'src/direct/DirectPhotoPage.vala'
220--- src/direct/DirectPhotoPage.vala 2014-08-17 07:06:58 +0000
221+++ src/direct/DirectPhotoPage.vala 2014-08-24 00:42:32 +0000
222@@ -59,12 +59,6 @@
223 save_as.tooltip = _ ("Save photo with a different name");
224 actions += save_as;
225
226- Gtk.ActionEntry send_to = { "SendTo", "document-send", TRANSLATABLE, null,
227- TRANSLATABLE, on_send_to
228- };
229- send_to.label = Resources.SEND_TO_MENU;
230- actions += send_to;
231-
232 Gtk.ActionEntry print = { "Print", Gtk.Stock.PRINT, TRANSLATABLE, "<Ctrl>P",
233 TRANSLATABLE, on_print
234 };
235@@ -355,7 +349,6 @@
236
237 set_action_sensitive ("Save", sensitivity);
238 set_action_sensitive ("SaveAs", sensitivity);
239- set_action_sensitive ("SendTo", sensitivity);
240 set_action_sensitive ("Publish", sensitivity);
241 set_action_sensitive ("Print", sensitivity);
242 set_action_sensitive ("CommonJumpToFile", sensitivity);
243@@ -547,11 +540,6 @@
244 save_as_dialog.destroy ();
245 }
246
247- private void on_send_to () {
248- if (has_photo ())
249- DesktopIntegration.send_to ((Gee.Collection<Photo>) get_view ().get_selected_sources ());
250- }
251-
252 protected override bool on_app_key_pressed (Gdk.EventKey event) {
253 bool handled = true;
254
255
256=== modified file 'src/util/system.vala'
257--- src/util/system.vala 2014-08-08 21:13:09 +0000
258+++ src/util/system.vala 2014-08-24 00:42:32 +0000
259@@ -37,4 +37,4 @@
260
261 int posix_wexitstatus (int status) {
262 return (((status) & 0xff00) >> 8);
263-}
264+}
265\ No newline at end of file
266
267=== modified file 'ui/collection.ui'
268--- ui/collection.ui 2014-08-23 07:54:47 +0000
269+++ ui/collection.ui 2014-08-24 00:42:32 +0000
270@@ -42,7 +42,7 @@
271 <menuitem name="ContextJumpToEvent" action="CommonJumpToEvent" />
272 <menuitem name="ContextJumpToFile" action="CommonJumpToFile" />
273 <menuitem name="ContextPrint" action="Print"/>
274- <menuitem name="ContextSendTo" action="SendToContextMenu" />
275+ <menuitem name="ContextExport" action="Export" />
276 <separator />
277 <menuitem name="ContextMoveToTrash" action="MoveToTrash" />
278 </popup>
279
280=== modified file 'ui/direct.ui'
281--- ui/direct.ui 2014-08-23 07:54:47 +0000
282+++ ui/direct.ui 2014-08-24 00:42:32 +0000
283@@ -5,7 +5,6 @@
284 <menuitem name="Save" action="Save" />
285 <menuitem name="SaveAs" action="SaveAs" />
286 <separator />
287- <menuitem name="SendTo" action="SendTo" />
288 <placeholder name="SetBackgroundPlaceholder" />
289 <separator />
290 <menuitem name="JumpToFile" action="CommonJumpToFile" />
291
292=== modified file 'ui/direct_context.ui'
293--- ui/direct_context.ui 2014-08-08 15:28:05 +0000
294+++ ui/direct_context.ui 2014-08-24 00:42:32 +0000
295@@ -7,6 +7,5 @@
296 <separator />
297 <placeholder name="ContextJumpPlaceholder" />
298 <placeholder name="PrintPlaceholder"/>
299- <menuitem name="ContextSendTo" action="SendTo" />
300 </popup>
301 </ui>
302\ No newline at end of file
303
304=== modified file 'ui/media.ui'
305--- ui/media.ui 2014-08-10 13:08:34 +0000
306+++ ui/media.ui 2014-08-24 00:42:32 +0000
307@@ -4,7 +4,6 @@
308 <menu name="FileMenu" action="FileMenu">
309 <menuitem name="Import" action="CommonFileImport" />
310 <menuitem name="ImportExternal" action="ExternalLibraryImport" />
311- <menuitem name="Export" action="Export" />
312 <separator />
313 <placeholder name="FileExtrasPlaceholder" />
314 </menu>
315
316=== modified file 'ui/photo.ui'
317--- ui/photo.ui 2014-08-23 07:54:47 +0000
318+++ ui/photo.ui 2014-08-24 00:42:32 +0000
319@@ -4,9 +4,7 @@
320 <menu name="FileMenu" action="FileMenu">
321 <menuitem name="Import" action="CommonFileImport" />
322 <menuitem name="ImportExternal" action="ExternalLibraryImport" />
323- <menuitem name="Export" action="Export" />
324 <separator />
325- <menuitem name="SendTo" action="SendTo" />
326 <placeholder name="SetBackgroundPlaceholder" />
327 </menu>
328
329
330=== modified file 'ui/photo_context.ui'
331--- ui/photo_context.ui 2014-08-17 07:06:58 +0000
332+++ ui/photo_context.ui 2014-08-24 00:42:32 +0000
333@@ -37,9 +37,9 @@
334 <separator />
335 <placeholder name="ContextJumpPlaceholder" />
336 <placeholder name="PrintPlaceholder" />
337- <menuitem name="ContextSendTo" action="SendToContextMenu" />
338+ <menuitem name="ContextExport" action="Export" />
339 <separator />
340 <menuitem name="ContextMoveToTrash" action="MoveToTrash" />
341 </popup>
342
343-</ui>
344+</ui>
345\ No newline at end of file

Subscribers

People subscribed via source and target branches