Add Save As action to Scripter file menu
ClosedPublic

Authored by brendanbd on Feb 9 2018, 6:07 AM.

Details

Reviewers
rempt
Group Reviewers
Krita
Maniphest Tasks
T7627: Generic Scripter UI improvements task
Summary

Adds new Save As action to Scripter File menu with Ctrl-Shift-S binding.

Some consequential changes:
Existing document.Document class write file using print. This adds the default carriage return character at the end of the print/file. Changed to file.write()
File validation in Save action was redundant as it's already handled by QFileDialog. I could not trigger an exception when using the file dialog. It also didn't specify an exception type. Bare except clauses are frowned on. Have removed try: except: structure.
Removed unused imports
Added docstring and new save_as parameter to DocumentController.saveDocument() method.

my ref: bbd/saveas

Test Plan

Open scripter

  1. test changes to existing Save function

create new file
Save file - confirm saved
Save file with filename collision - test that QFileDialog displays an overwrite warning dialog

  1. test Save As function

use existing file
Save As to new name - confirm saved
Save As with filename collision - test that QFileDialog displays an overwrite warning dialog

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
brendanbd created this revision.Feb 9 2018, 6:07 AM
Restricted Application added a subscriber: woltherav. ยท View Herald TranscriptFeb 9 2018, 6:07 AM
brendanbd requested review of this revision.Feb 9 2018, 6:07 AM
brendanbd edited the summary of this revision. (Show Details)
rempt accepted this revision.Feb 9 2018, 9:16 AM
This revision is now accepted and ready to land.Feb 9 2018, 9:16 AM