Bug 288042 - Option to reset forms
AbandonedPublic

Authored by aacid on Feb 14 2018, 12:24 PM.

Details

Reviewers
ahmadosama
Summary

These changes are done to add a button to Reset pdf forms when clicked.

Changes are to the following files:

  • part.cpp: Just changing the text displayed to the user when the document has forms
  • pageview.cpp/pageview.h: add an action to reset forms just like the Show Form/Hide form (aToggleForm QAction)
  • formwidget.cpp/formwidger.h: add a virtual function 'clearWidgetContents()' to the parent class (FormWidgetIface) that clears the contents of the widget, then overriding this function in its children to clear the contents differently in each widget, ex. clearing the FormLineEditClass (that iherits from QLineEdit) is done by setting text to an empty string ("").
  • the clearWidgetContents() is called when the QAction associated with it is triggered.

*the clearWidgetContent() is added to the FormLineEdit, radioButton, checkBoxEdit and KTextEdit

Diff Detail

Repository
R223 Okular
Lint
Lint Skipped
Unit
Unit Tests Skipped
ahmadosama created this revision.Feb 14 2018, 12:24 PM
Restricted Application added a subscriber: Okular. · View Herald TranscriptFeb 14 2018, 12:24 PM
ahmadosama requested review of this revision.Feb 14 2018, 12:24 PM
aacid added a subscriber: aacid.Feb 14 2018, 7:05 PM

Same as I asked Gilbert in reviewboard.

Do you think you could do an autotest using formSamples.pdf ?

part.cpp
1548

This is not how you do coding, you don't leave the old code commented around.

ui/formwidgets.cpp
552

this is wrong, you want QString()

ui/formwidgets.h
160

Remove all those markers, we can see the changes.

aacid requested changes to this revision.Feb 14 2018, 7:05 PM
This revision now requires changes to proceed.Feb 14 2018, 7:05 PM
ahmadosama updated this revision to Diff 27427.Feb 17 2018, 9:06 PM

Removing unnecessary comments, add clear widget function for other widgets.

Do you plan to work on the autotest?

I have not created an auto test before, I am currently going through current auto tests to understand how it works, then I will try creating an auto test for this bug.

aacid requested changes to this revision.Feb 21 2018, 10:48 PM

Ok, ask if you have questions :)

This revision now requires changes to proceed.Feb 21 2018, 10:48 PM

I implemented the reset option using Okular::FormFields inspired by the comments here:
https://git.reviewboard.kde.org/r/130057/

I submitted another patch for this new implementation here:
https://phabricator.kde.org/D10932

I am currently working on the creation of the auto tests, I think using this implementation the auto test will be similar to editformstext.cpp and I will upload the auto test for review once it is done.

So will you cancel this one in favor of the other one?

yes I am going to cancel this revision.

aacid commandeered this revision.Apr 24 2018, 9:39 AM
aacid abandoned this revision.
aacid edited reviewers, added: ahmadosama; removed: aacid.