Atelier Aware if a file is modified on close/ print
ClosedPublic

Authored by rizzitello on Jul 8 2018, 5:47 PM.

Details

Summary
  • GCodeEditor::modifiedFiles to return list of modified files
  • GCodeEditor::Save to allow for saving.
  • New Icons for several new actions
  • Ask to save if files open in gcodeview unsaved and closing.
  • Ask to save if trying to print a file that was modified
Test Plan

Open files modify them close atelier.
you should see prompts telling you to you have modified some files and test the buttons.

Open a file connect to printer modified file attempt to print before saving.
You should see A prompt asking you to save you modified file before printing (try the buttons to check their functions.

Diff Detail

Repository
R231 Atelier
Branch
askToSave
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 989
Build 1002: arc lint + arc unit
rizzitello requested review of this revision.Jul 8 2018, 5:47 PM
rizzitello created this revision.
rizzitello retitled this revision from Make GcodeWidget / Atelier Aware of if a file is modified on close/ print to Atelier Aware if a file is modified on close/ print.Jul 8 2018, 5:51 PM
rizzitello edited the summary of this revision. (Show Details)
rizzitello edited the test plan for this revision. (Show Details)
rizzitello updated this revision to Diff 37356.Jul 8 2018, 5:54 PM
rizzitello edited the test plan for this revision. (Show Details)
  • Remove wayward space
tcanabrava added inline comments.Jul 9 2018, 7:58 PM
src/mainwindow.cpp
474

Why not use a QFileDialog to save the file instead of manually mounting one?

src/widgets/gcodeeditorwidget.cpp
118

QVector, QList should only be used if the item is <= a pointer.
also, modList.reserve(count)

133

return doc->save();

rizzitello marked 3 inline comments as done.Jul 9 2018, 8:28 PM
rizzitello added inline comments.
src/mainwindow.cpp
474

This is a list based dialog of all the files we have open not a normal picker.

src/widgets/gcodeeditorwidget.cpp
118

didn't set reserve since I don't know how many files will be modified.

rizzitello updated this revision to Diff 37480.Jul 9 2018, 8:29 PM
rizzitello marked 2 inline comments as done.
  • Tomaz' suggestions.
tcanabrava accepted this revision.Jul 11 2018, 4:07 PM
This revision is now accepted and ready to land.Jul 11 2018, 4:07 PM

can you add screeshots of your use case tests?
Not able to test this at this time.

rizzitello edited the test plan for this revision. (Show Details)Jul 16 2018, 4:59 PM
patrickelectric requested changes to this revision.Jul 17 2018, 11:10 AM
patrickelectric added inline comments.
src/mainwindow.cpp
173

This breaks the code style.

184

else after return is not necessary.

424

for(const auto& item: listWidget->selectedItems())

438

Same thing.

src/widgets/gcodeeditorwidget.cpp
137

check if urlDoc contains url.
auto doc is not explicit.

This revision now requires changes to proceed.Jul 17 2018, 11:10 AM
rizzitello marked an inline comment as done.Jul 17 2018, 11:59 AM
rizzitello added inline comments.
src/mainwindow.cpp
173

There are no other larger function to follow style of in this project

MessageBox:: info( this, "TITLE"
                           , "TEXT"
                           ,  ...
                       );

is the style of the others . Should i put the title and parent on the first line or am i just missing the previous "style " here ?

184

I personally find if / else if to be an easier logic to follow Then a collection of "if" when checking the same variable.

424

Selected Items != Count

IIrc i had to use this style if. I will check again when I can get back to the code.

src/widgets/gcodeeditorwidget.cpp
137

if no url doc->save should return false. If you think we need more checks i can add them

I will use an explict QURL here.

rizzitello marked 3 inline comments as done.
  • Add public Save File
  • Add Icons for several new actions
  • Ask to save if files open in gcodeview unsaved
  • Ask to save if trying to print a file that was modified
patrickelectric accepted this revision.Jul 25 2018, 3:48 PM
This revision is now accepted and ready to land.Jul 25 2018, 3:48 PM
laysrodrigues accepted this revision.Jul 25 2018, 7:07 PM
rizzitello closed this revision.Jul 25 2018, 7:37 PM