Merge lp:~gero-bare/scratch/scratch-save_as-on-tempfile into lp:~elementary-apps/scratch/scratch

Proposed by Gero.Bare
Status: Merged
Approved by: Cody Garver
Approved revision: 1504
Merged at revision: 1503
Proposed branch: lp:~gero-bare/scratch/scratch-save_as-on-tempfile
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 16 lines (+5/-1)
1 file modified
src/MainWindow.vala (+5/-1)
To merge this branch: bzr merge lp:~gero-bare/scratch/scratch-save_as-on-tempfile
Reviewer Review Type Date Requested Status
Lewis Goddard (community) Approve
elementary Apps team Pending
Review via email: mp+257810@code.launchpad.net

Commit message

Ctrl+S calls save_as for temporary files instead of doing nothing

Description of the change

When trying to save a file, if this is a tempfile, then call save_as action instead.

To post a comment you must log in.
1503. By Gero.Bare

Add "this" for clarity.

1504. By Gero.Bare

Fix code style.

Revision history for this message
Lewis Goddard (lewisgoddard) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/MainWindow.vala'
2--- src/MainWindow.vala 2015-03-30 21:06:18 +0000
3+++ src/MainWindow.vala 2015-04-29 19:40:36 +0000
4@@ -661,7 +661,11 @@
5 }
6
7 void action_save () {
8- this.get_current_document ().save.begin ();
9+ var doc = this.get_current_document ();
10+ if (doc.is_file_temporary == true) {
11+ this.action_save_as ();
12+ } else
13+ doc.save.begin ();
14 }
15
16 void action_save_as () {

Subscribers

People subscribed via source and target branches